]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Enable undefined support for RVV auto-vectorization[PR110751]
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Thu, 21 Sep 2023 07:19:29 +0000 (15:19 +0800)
committerLehua Ding <lehua.ding@rivai.ai>
Thu, 21 Sep 2023 09:12:49 +0000 (17:12 +0800)
Now GCC middle-end can support undefined value which is traslated into (scratch:mode).

This patch is to enable RISC-V backend undefine value in ELSE value of COND_LEN_xxx/COND_xxx.

Consider this following case:

  __attribute__((noipa))
  void vrem_int8_t (int8_t * __restrict dst, int8_t * __restrict a, int8_t * __restrict b, int n)
  {
    for (int i = 0; i < n; i++)
      dst[i] = a[i] % b[i];
  }

Before this patch:

vrem_int8_t:
        ble     a3,zero,.L5
        vsetvli a5,zero,e8,m1,ta,ma
        vmv.v.i v4,0                          ---> redundant.
.L3:
        vsetvli a5,a3,e8,m1,tu,ma             ---> should be TA.
        vmv1r.v v1,v4                         ---> redudant.
        vle8.v  v3,0(a1)
        vle8.v  v2,0(a2)
        sub     a3,a3,a5
        vrem.vv v1,v3,v2
        vse8.v  v1,0(a0)
        add     a1,a1,a5
        add     a2,a2,a5
        add     a0,a0,a5
        bne     a3,zero,.L3
.L5:
        ret

After this patch:

vrem_int8_t:
ble a3,zero,.L5
.L3:
vsetvli a5,a3,e8,m1,ta,ma
vle8.v v1,0(a1)
vle8.v v2,0(a2)
sub a3,a3,a5
vrem.vv v1,v1,v2
vse8.v v1,0(a0)
add a1,a1,a5
add a2,a2,a5
add a0,a0,a5
bne a3,zero,.L3
.L5:
ret

PR target/110751

gcc/ChangeLog:

* config/riscv/autovec.md: Enable scratch rtx in ELSE operand.
* config/riscv/predicates.md (autovec_else_operand): New predicate.
* config/riscv/riscv-v.cc (get_else_operand): New function.
(expand_cond_len_unop): Adapt ELSE value.
(expand_cond_len_binop): Ditto.
(expand_cond_len_ternop): Ditto.
* config/riscv/riscv.cc (riscv_preferred_else_value): New function.
(TARGET_PREFERRED_ELSE_VALUE): New targethook.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv-nofm.c: Adapt test.
* gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv.c: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv-nofm.c: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv.c: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vrem-rv32gcv.c: Ditto.
* gcc.target/riscv/rvv/autovec/binop/vrem-rv64gcv.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-1.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-10.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-11.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-12.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-2.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-3.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-4.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-5.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-6.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-7.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-8.c: Ditto.
* gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-9.c: Ditto.

22 files changed:
gcc/config/riscv/autovec.md
gcc/config/riscv/predicates.md
gcc/config/riscv/riscv-v.cc
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv-nofm.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv-nofm.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vdiv-rv64gcv.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vrem-rv32gcv.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/binop/vrem-rv64gcv.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-1.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-10.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-11.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-12.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-2.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-3.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-4.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-5.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-6.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-7.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-8.c
gcc/testsuite/gcc.target/riscv/rvv/autovec/ternop/ternop_nofm-9.c

index 55c0a04df3b86f60e43831b2c65cb2b4a629e6ec..f0f1abc4e824647488936eafd9bb2ef28e99c40d 100644 (file)
    (match_operand:<VM> 1 "vector_mask_operand")
    (any_int_unop:VI
      (match_operand:VI 2 "register_operand"))
-   (match_operand:VI 3 "register_operand")]
+   (match_operand:VI 3 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:<VM> 1 "vector_mask_operand")
    (any_int_unop:VI
      (match_operand:VI 2 "register_operand"))
-   (match_operand:VI 3 "register_operand")
+   (match_operand:VI 3 "autovec_else_operand")
    (match_operand 4 "autovec_length_operand")
    (match_operand 5 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:<VM> 1 "vector_mask_operand")
    (any_float_unop_nofrm:VF
      (match_operand:VF 2 "register_operand"))
-   (match_operand:VF 3 "register_operand")]
+   (match_operand:VF 3 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:<VM> 1 "vector_mask_operand")
    (any_float_unop_nofrm:VF
      (match_operand:VF 2 "register_operand"))
-   (match_operand:VF 3 "register_operand")
+   (match_operand:VF 3 "autovec_else_operand")
    (match_operand 4 "autovec_length_operand")
    (match_operand 5 "const_0_operand")]
   "TARGET_VECTOR"
    (any_shift:VI
      (match_operand:VI 2 "register_operand")
      (match_operand:VI 3 "vector_shift_operand"))
-   (match_operand:VI 4 "register_operand")]
+   (match_operand:VI 4 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (any_shift:VI
      (match_operand:VI 2 "register_operand")
      (match_operand:VI 3 "vector_shift_operand"))
-   (match_operand:VI 4 "register_operand")
+   (match_operand:VI 4 "autovec_else_operand")
    (match_operand 5 "autovec_length_operand")
    (match_operand 6 "const_0_operand")]
   "TARGET_VECTOR"
    (any_int_binop_no_shift:VI
      (match_operand:VI 2 "<binop_rhs1_predicate>")
      (match_operand:VI 3 "<binop_rhs2_predicate>"))
-   (match_operand:VI 4 "register_operand")]
+   (match_operand:VI 4 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (any_int_binop_no_shift:VI
      (match_operand:VI 2 "<binop_rhs1_predicate>")
      (match_operand:VI 3 "<binop_rhs2_predicate>"))
-   (match_operand:VI 4 "register_operand")
+   (match_operand:VI 4 "autovec_else_operand")
    (match_operand 5 "autovec_length_operand")
    (match_operand 6 "const_0_operand")]
   "TARGET_VECTOR"
    (any_float_binop:VF
      (match_operand:VF 2 "register_operand")
      (match_operand:VF 3 "register_operand"))
-   (match_operand:VF 4 "register_operand")]
+   (match_operand:VF 4 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (any_float_binop:VF
      (match_operand:VF 2 "register_operand")
      (match_operand:VF 3 "register_operand"))
-   (match_operand:VF 4 "register_operand")
+   (match_operand:VF 4 "autovec_else_operand")
    (match_operand 5 "autovec_length_operand")
    (match_operand 6 "const_0_operand")]
   "TARGET_VECTOR"
    (any_float_binop_nofrm:VF
      (match_operand:VF 2 "register_operand")
      (match_operand:VF 3 "register_operand"))
-   (match_operand:VF 4 "register_operand")]
+   (match_operand:VF 4 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (any_float_binop_nofrm:VF
      (match_operand:VF 2 "register_operand")
      (match_operand:VF 3 "register_operand"))
-   (match_operand:VF 4 "register_operand")
+   (match_operand:VF 4 "autovec_else_operand")
    (match_operand 5 "autovec_length_operand")
    (match_operand 6 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VI 2 "register_operand")
    (match_operand:VI 3 "register_operand")
    (match_operand:VI 4 "register_operand")
-   (match_operand:VI 5 "register_operand")]
+   (match_operand:VI 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VI 2 "register_operand")
    (match_operand:VI 3 "register_operand")
    (match_operand:VI 4 "register_operand")
-   (match_operand:VI 5 "register_operand")
+   (match_operand:VI 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VI 2 "register_operand")
    (match_operand:VI 3 "register_operand")
    (match_operand:VI 4 "register_operand")
-   (match_operand:VI 5 "register_operand")]
+   (match_operand:VI 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VI 2 "register_operand")
    (match_operand:VI 3 "register_operand")
    (match_operand:VI 4 "register_operand")
-   (match_operand:VI 5 "register_operand")
+   (match_operand:VI 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")]
+   (match_operand:VF 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")
+   (match_operand:VF 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")]
+   (match_operand:VF 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")
+   (match_operand:VF 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")]
+   (match_operand:VF 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")
+   (match_operand:VF 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")]
+   (match_operand:VF 5 "autovec_else_operand")]
   "TARGET_VECTOR"
 {
   /* Normalize into cond_len_* operations.  */
    (match_operand:VF 2 "register_operand")
    (match_operand:VF 3 "register_operand")
    (match_operand:VF 4 "register_operand")
-   (match_operand:VF 5 "register_operand")
+   (match_operand:VF 5 "autovec_else_operand")
    (match_operand 6 "autovec_length_operand")
    (match_operand 7 "const_0_operand")]
   "TARGET_VECTOR"
index bf241890e7e7fd59e600b1f4818fcbc18d93ecc2..6b72a5f4e075bad8db9fc35594f915e56107a009 100644 (file)
   (ior (match_operand 0 "register_operand")
        (match_operand 0 "vector_undef_operand")))
 
+(define_predicate "autovec_else_operand"
+  (ior (match_operand 0 "register_operand")
+       (match_operand 0 "scratch_operand")))
+
 (define_predicate "vector_arith_operand"
   (ior (match_operand 0 "register_operand")
        (and (match_code "const_vector")
index 64a71a128d45560b57bde0e773d225a7197cd345..366f0659817c22ad1db842eba26ae70eeababe4b 100644 (file)
@@ -3024,6 +3024,13 @@ expand_cond_len_op (unsigned icode, insn_flags op_type, rtx *ops, rtx len)
     emit_nonvlmax_insn (icode, insn_flags, ops, len);
 }
 
+/* Return RVV_VUNDEF if the ELSE value is scratch rtx.  */
+static rtx
+get_else_operand (rtx op)
+{
+  return GET_CODE (op) == SCRATCH ? RVV_VUNDEF (GET_MODE (op)) : op;
+}
+
 /* Expand unary ops COND_LEN_*.  */
 void
 expand_cond_len_unop (unsigned icode, rtx *ops)
@@ -3031,7 +3038,7 @@ expand_cond_len_unop (unsigned icode, rtx *ops)
   rtx dest = ops[0];
   rtx mask = ops[1];
   rtx src = ops[2];
-  rtx merge = ops[3];
+  rtx merge = get_else_operand (ops[3]);
   rtx len = ops[4];
 
   rtx cond_ops[] = {dest, mask, merge, src};
@@ -3046,7 +3053,7 @@ expand_cond_len_binop (unsigned icode, rtx *ops)
   rtx mask = ops[1];
   rtx src1 = ops[2];
   rtx src2 = ops[3];
-  rtx merge = ops[4];
+  rtx merge = get_else_operand (ops[4]);
   rtx len = ops[5];
 
   rtx cond_ops[] = {dest, mask, merge, src1, src2};
@@ -3218,7 +3225,7 @@ expand_cond_len_ternop (unsigned icode, rtx *ops)
   rtx src1 = ops[2];
   rtx src2 = ops[3];
   rtx src3 = ops[4];
-  rtx merge = ops[5];
+  rtx merge = get_else_operand (ops[5]);
   rtx len = ops[6];
 
   rtx cond_ops[] = {dest, mask, src1, src2, src3, merge};
index 6158953098db0de236e5d7cc2dfb1f1b993930b2..6e7a719e7a067e1234d667568f11295edbdee8c2 100644 (file)
@@ -72,6 +72,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "tree-vectorizer.h"
 #include "gcse.h"
+#include "tree-dfa.h"
 
 /* This file should be included last.  */
 #include "target-def.h"
@@ -9585,6 +9586,18 @@ riscv_vectorize_create_costs (vec_info *vinfo, bool costing_for_scalar)
   return new vector_costs (vinfo, costing_for_scalar);
 }
 
+/* Implement TARGET_PREFERRED_ELSE_VALUE.  */
+
+static tree
+riscv_preferred_else_value (unsigned ifn, tree vectype, unsigned int nops,
+                           tree *ops)
+{
+  if (riscv_v_ext_mode_p (TYPE_MODE (vectype)))
+    return get_or_create_ssa_default_def (cfun, create_tmp_var (vectype));
+
+  return default_preferred_else_value (ifn, vectype, nops, ops);
+}
+
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_ALIGNED_HI_OP
 #define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
@@ -9901,6 +9914,9 @@ riscv_vectorize_create_costs (vec_info *vinfo, bool costing_for_scalar)
 #undef TARGET_VECTORIZE_CREATE_COSTS
 #define TARGET_VECTORIZE_CREATE_COSTS riscv_vectorize_create_costs
 
+#undef TARGET_PREFERRED_ELSE_VALUE
+#define TARGET_PREFERRED_ELSE_VALUE riscv_preferred_else_value
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 #include "gt-riscv.h"
index 5ce2e57e2654253673b57d9eec12a5a4aa35f9ac..f7d77047ad1bbcb09be1a432a7dba0512f8eafc1 100644 (file)
@@ -10,3 +10,9 @@
 
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_DIV" 16 "optimized" } } */
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_RDIV" 6 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index 9b984dda452fd85e5ba7b892282aeedb8666d0bb..bb421fa71348a017d28141a560f507594f0852fc 100644 (file)
@@ -12,3 +12,9 @@
 /* { dg-final { scan-assembler-times {\tvfmul\.vv} 3 } } */
 
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_DIV" 16 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index 7b1aa28e45e137064eb0a6ec4d3a4001e6a54fea..0dd4df6a5c537f615c811fc30e92a66725967a87 100644 (file)
@@ -10,3 +10,9 @@
 
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_DIV" 16 "optimized" } } */
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_RDIV" 6 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index ca4d23bb1edb1c62c25bcd9baa7360dd8983dbed..9764cc3f1fdc7335e40686ae1787b4b530b93773 100644 (file)
@@ -12,3 +12,9 @@
 /* { dg-final { scan-assembler-times {\tvfmul\.vv} 3 } } */
 
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_DIV" 16 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index 6d0493b31949316e6051375c50b50612f5a6e5e1..7628f4a3d262ed45e5796712448bebf125dea586 100644 (file)
@@ -5,3 +5,9 @@
 /* { dg-final { scan-assembler-times {\tvrem\.vv} 8 } } */
 /* { dg-final { scan-assembler-times {\tvremu\.vv} 8 } } */
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_MOD" 16 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index 24b2bc81a90fc42bc41bbb9219604eb5eec7c858..8af9a8b574592a2e1939bcf3d44fde208beac027 100644 (file)
@@ -6,3 +6,9 @@
 /* { dg-final { scan-assembler-times {\tvrem\.vv} 8 } } */
 /* { dg-final { scan-assembler-times {\tvremu\.vv} 8 } } */
 /* { dg-final { scan-tree-dump-times "\.COND_LEN_MOD" 16 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv1r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv2r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv4r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv8r\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.v} } } */
+/* { dg-final { scan-assembler-not {\tvmv\.v\.i} } } */
index 52861ee104d44a839e9939f254f0cee51e645c13..c5fab3f1f38adcf090dbbcd06677d221cfaeb4cb 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-1.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMA" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index 01a5e9952536ecc95545b90f16dcc2deb7c168b8..a65c398cba3a6e23fc98434167cfa79bb0d4a7d6 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-10.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMS" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index 19671424660083acf42f33c3cbff87130899de09..9725cfad7caa6a97c218412fe81961ee70070189 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-11.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMS" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index f2c2c735db966be9a174c26b4161ba874666a0b6..97be71c4bd225e6d877b6ce55541ed7b2634b7e0 100644 (file)
@@ -4,3 +4,5 @@
 #include "ternop-12.c"
 
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMS" 3 "optimized" } } */
+/* { dg-final { scan-assembler-times {\tvmv} 3 } } */
+
index ba07596046b8d8df15f235390a83e804a0ad206d..965365da4bbbb3b01262da7c6b5f5531111a9ce7 100644 (file)
@@ -4,8 +4,6 @@
 #include "ternop-2.c"
 
 /* { dg-final { scan-assembler-times {\tvmacc\.vv} 8 } } */
-/* { dg-final { scan-assembler-times {\tvfmacc\.vv} 9 } } */
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
+/* { dg-final { scan-assembler-times {\tvfma[c-d][c-d]\.vv} 9 } } */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMA" 9 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index bc44644baf39213d926342e13b8cfc0906813d4c..de6d40431f8b6354c2d39a145978379dfd2f287d 100644 (file)
@@ -4,5 +4,6 @@
 #include "ternop-3.c"
 
 /* { dg-final { scan-assembler-times {\tvmacc\.vv} 8 } } */
-/* { dg-final { scan-assembler-times {\tvfmacc\.vv} 9 } } */
+/* { dg-final { scan-assembler-times {\tvfma[c-d][c-d]\.vv} 9 } } */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMA" 9 "optimized" } } */
+/* { dg-final { scan-assembler-times {\tvmv} 11 } } */
index 96dd8a0ddcab194a9d02a5327416aa8cf85d0315..4d73a541b0b203767d9bcd59393657ed512e1ca4 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-4.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMA" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index 2664efaeef58f72ee292dfa9363a206eedad5068..6fa28a23f3f3b632df6c1b2dc0043ef6e0c4297d 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-5.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMA" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index 9f3d1204fc57e7bb6b26b3e4f2dae670c0399a56..33faf0582a77c31802e5fc92966c89d706bbd740 100644 (file)
@@ -4,3 +4,4 @@
 #include "ternop-6.c"
 
 /* { dg-final { scan-tree-dump-times "COND_LEN_FNMA" 3 "optimized" } } */
+/* { dg-final { scan-assembler-times {\tvmv} 11 } } */
index 8c07f1941ecb224e1f3ed148a980f30fdc6f8841..44807993c33167b1c4ed0aeb8b5289fd60ccf7c1 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-7.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMS" 3 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index e0cbc53227a1f3ae034f76eb93012777e7703e24..c89f5836bcb2e01d8b2ceeee95db14516af41275 100644 (file)
@@ -3,7 +3,5 @@
 
 #include "ternop-8.c"
 
-/* TODO: we don't have undefine IR for COND_LEN_* operations,
-    which will produce redundant move instructions here.
-    Will add assembler-not check of 'vmv' instructions in the future.  */
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMS" 9 "optimized" } } */
+/* { dg-final { scan-assembler-not {\tvmv} } } */
index f080d3a3cb2f0659326fdfb02fb5c38640ebf1ca..2de649b1db8134b760d3c737f4fab1c8dbaf1a46 100644 (file)
@@ -4,3 +4,4 @@
 #include "ternop-9.c"
 
 /* { dg-final { scan-tree-dump-times "COND_LEN_FMS" 9 "optimized" } } */
+/* { dg-final { scan-assembler-times {\tvmv} 3 } } */