I'd like you to defer to you commit my patch with your test (Jeff has approved my patch, just feel free to commit).
Here is the description: We have 3 configuration for "-march" 1. zve32* (TARGET_MIN_VLEN == 32), the LMUL = 1 mode will be VNx4QI, VNx2HI, VNx1SI 2. zve64* (TARGET_MIN_VLEN == 64), the LMUL = 1 mode will be VNx8QI, VNx4HI, VNx2SI 3. zve64*_zvl128b (TARGET_MIN_VLEN >= 128), the LMUL = 1 mode will be VNx16QI, VNx8HI, VNx4SI We dynamically adjust BYTES_PER_VECTOR according to TARGET_MIN_VLEN. For TARGET_MIN_VLEN = 32 (chunk=32), the LMUL = 1 size = (4,4) bytes. For TARGET_MIN_VLEN = 64 (chunk=64), the LMUL = 1 size = (8,8) bytes. For TARGET_MIN_VLEN >= 128 (chunk=128), the LMUL = 1 size = (16*n,16*n) bytes. I have explained it many times. https://gcc.gnu.org/pipermail/gcc-patches/2023-March/614935.html https://gcc.gnu.org/pipermail/gcc-patches/2023-February/612574.html juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-06-12 17:51 To: 钟居哲; gcc-patches CC: rdapp.gcc; kito.cheng; palmer; Jeff Law Subject: Re: [PATCH] RISC-V: Fix V_WHOLE && V_FRACT iterator requirement > + (VNx16QI "TARGET_MIN_VLEN <= 128") > + (VNx32QI "TARGET_MIN_VLEN <= 256") > + (VNx64QI "TARGET_MIN_VLEN >= 64 && TARGET_MIN_VLEN <= 512") > + (VNx128QI "TARGET_MIN_VLEN >= 128 && TARGET_MIN_VLEN <= 1024") > > This not correct, we always use VNx16QI as LMUL = m1 for min_vlen >= 128. > Requirement of TARGET_MIN_VLEN <= 128 is incorrect for VNx16QI. > VNx32QI,...etc likewise. Please elaborate. What happens with a VNx16QI on a target with min_vlen == 256? Is it a full 256-bit vector with only the first half populated? If so, this need documentation either here or somewhere else (but with a reference here). Either you can pick my testcase and amend your patch (plus streamline formatting as well adding a proper comment) or I change mine. Your call. Regards Robin