On 6/19/24 6:30 AM, demin.han wrote:
We can unify eqne and other comparison operations.

Tested on RV32 and RV64

gcc/ChangeLog:

        * config/riscv/riscv-vector-builtins-bases.cc: Remove eqne cond
        * config/riscv/vector.md (@pred_eqne<mode>_scalar): Remove patterns
        (*pred_eqne<mode>_scalar_merge_tie_mask): Ditto
        (*pred_eqne<mode>_scalar): Ditto
        (*pred_eqne<mode>_scalar_narrow): Ditto

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/rvv/base/float-point-cmp-eqne.c: New test.

Signed-off-by: demin.han <demin....@starfivetech.com>
---

v2 changes:
   1. add test

   Only intrinsics utilize those removed vf patterns.
   Auto vectorization use vv format now.
   The NaN will optimized out before expand in autovec as I tested.

  .../riscv/riscv-vector-builtins-bases.cc      |  4 -
  gcc/config/riscv/vector.md                    | 86 -------------------
  .../riscv/rvv/base/float-point-cmp-eqne.c     | 54 ++++++++++++
  3 files changed, 54 insertions(+), 90 deletions(-)
  create mode 100644 
gcc/testsuite/gcc.target/riscv/rvv/base/float-point-cmp-eqne.c

diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc 
b/gcc/config/riscv/riscv-vector-builtins-bases.cc
index b6f6e4ff37e..d414721ede8 100644
--- a/gcc/config/riscv/riscv-vector-builtins-bases.cc
+++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc
@@ -1420,10 +1420,6 @@ public:
      switch (e.op_info->op)
        {
        case OP_TYPE_vf: {
-         if (CODE == EQ || CODE == NE)
-           return e.use_compare_insn (CODE, code_for_pred_eqne_scalar (
-                                              e.vector_mode ()));
-         else
            return e.use_compare_insn (CODE, code_for_pred_cmp_scalar (
                                               e.vector_mode ()));
Formatting nit. You removed the IF-THEN-ELSE construct, leaving just the ELSE's body. You need to reindent that body, both lines of which would move left by two spaces.

I'll fix and push it momentarily.

jeff

Reply via email to