On 6/26/25 8:53 AM, Paul-Antoine Arras wrote:
This pattern enables the combine pass (or late-combine, depending on the case)
to merge a vec_duplicate into a (possibly negated) minus-mult RTL instruction.

Before this patch, we have two instructions, e.g.:
   vfmv.v.f        v6,fa0
   vfnmacc.vv      v2,v6,v4

After, we get only one:
   vfnmacc.vf      v2,fa0,v4

        PR target/119100

gcc/ChangeLog:

        * config/riscv/autovec-opt.md (*vfnmsub_<mode>,*vfnmadd_<mode>): Handle
        both add and acc variants.
        * config/riscv/vector.md (*pred_mul_neg_<optab><mode>_scalar_undef): New
        pattern.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f16.c: Add vfnmacc and
        vfnmsac.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f32.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-1-f64.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f16.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f32.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-2-f64.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f16.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f32.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-3-f64.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f16.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f32.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf-4-f64.c: Likewise.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_mulop.h (DEF_VF_MULOP_CASE_1):
        Fix return type.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmacc-run-1-f16.c: New test.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmacc-run-1-f32.c: New test.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmacc-run-1-f64.c: New test.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmsac-run-1-f16.c: New test.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmsac-run-1-f32.c: New test.
        * gcc.target/riscv/rvv/autovec/vx_vf/vf_vfnmsac-run-1-f64.c: New test.
This is failing pre-commit testing:

linux rv64gcv lp64d medlow multilib:

FAIL: gcc.target/riscv/rvv/base/bug-4.c (internal compiler error: in 
extract_insn, at recog.cc:2882)
FAIL: gcc.target/riscv/rvv/base/bug-4.c (test for excess errors)
linux rv32gcv ilp32d medlow multilib:

FAIL: gcc.target/riscv/rvv/base/bug-4.c (internal compiler error: in 
extract_insn, at recog.cc:2882)
FAIL: gcc.target/riscv/rvv/base/bug-4.c (test for excess errors)
newlib rv64gcv lp64d medlow multilib:

FAIL: gcc.target/riscv/rvv/base/bug-4.c (internal compiler error: in 
extract_insn, at recog.cc:2882)
FAIL: gcc.target/riscv/rvv/base/bug-4.c (test for excess errors)


Reply via email to