LGTM this patch (fix for vfwadd.wf). And here is a simpel case to reproduce same bug for vwadd.wx:
https://compiler-explorer.com/z/4rP9Yvdq1 #include <stdint.h> #include <riscv_vector.h> vint64m8_t test_vwadd_wx_i64m8_m(vbool8_t vm, vint64m8_t vs2, int rs1, size_t vl) { return __riscv_vwadd_wx_i64m8_m(vm, vs2, rs1, vl); } char global_memory[1024]; void *fake_memory = (void *)global_memory; int main () { asm volatile("fence":::"memory"); long x; asm volatile("":"=r"(x)::"memory"); vint64m8_t vwadd_wx_i64m8_m_vd = test_vwadd_wx_i64m8_m( __riscv_vreinterpret_v_i8m1_b8(__riscv_vundefined_i8m1()), __riscv_vundefined_i64m8(), x, __riscv_vsetvlmax_e64m8()); asm volatile(""::"vr"(vwadd_wx_i64m8_m_vd):"memory"); return 0; } main: fence vsetvli a4,zero,e32,m4,ta,ma vwadd.wx v0,v8,a5,v0.t ----> vd and vm are both v0 which is wrong. li a0,0 ret juzhe.zh...@rivai.ai From: Robin Dapp Date: 2024-05-16 03:31 To: 钟居哲; gcc-patches CC: rdapp.gcc; palmer; kito.cheng; Jeff Law Subject: Re: [PATCH] RISC-V: Do not allow v0 as dest when merging [PR115068]. > I saw vwadd/vwsub.wx have same issue. Could you change them and add test too ? Yes, will do. At first I didn't manage to reproduce it because we seem to be lacking a combine-opt pattern for it. I'm going to post it separately. Regards Robin