Plz put your testcases into: # widening operation only test on LMUL < 8 set AUTOVEC_TEST_OPTS [list \ {-ftree-vectorize -O3 --param riscv-autovec-lmul=m1} \ {-ftree-vectorize -O3 --param riscv-autovec-lmul=m2} \ {-ftree-vectorize -O3 --param riscv-autovec-lmul=m4} \ {-ftree-vectorize -O2 --param riscv-autovec-lmul=m1} \ {-ftree-vectorize -O2 --param riscv-autovec-lmul=m2} \ {-ftree-vectorize -O2 --param riscv-autovec-lmul=m4} ] foreach op $AUTOVEC_TEST_OPTS { dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/autovec/widen/*.\[cS\]]] \ "" "$op" } You could either simpilfy put them into "widen" directory or create a new directly. Anyway, make sure you have fully tested it with LMUL = 1/2/4. juzhe.zhong@rivai.ai From: Robin Dapp Date: 2023-08-03 02:49 To: 钟居哲; gcc-patches; palmer; kito.cheng; Jeff Law CC: rdapp.gcc Subject: Re: [PATCH] RISC-V: Implement vector "average" autovec pattern. > 1. How do you model round to +Inf (avg_floor) and round to -Inf (avg_ceil) ? That's just specified by the +1 or the lack of it in the original pattern. Actually the IFN is just a detour because we would create perfect code if not for the fallback. But as there is currently now way to check for the existence of a narrowing shift we cannot circumvent the fallback. > 2. Is it possible we could use vaadd[u] to model avg ? In principle yes (I first read it wrong that overflow must not happen but the specs actually say that it does not happen). However, we would need to set a rounding mode before vaadd or check its current value and provide a fallback. Off the spot I can't imagine a workaround like two vaadds or so. Regards Robin