[AArch64] Make SVE UNSPEC_COND_*s match the insn mnemonic
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 7 Aug 2019 18:43:01 +0000 (18:43 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 7 Aug 2019 18:43:01 +0000 (18:43 +0000)
This patch makes the UNSPEC_COND* names match the instruction mnemonics,
rather than having the previous mixture in which some used instructions
while others used operator names.

2019-08-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/iterators.md (UNSPEC_COND_ADD): Rename to...
(UNSPEC_COND_FADD): ...this.
(UNSPEC_COND_SUB): Rename to...
(UNSPEC_COND_FSUB): ...this.
(UNSPEC_COND_MUL): Rename to...
(UNSPEC_COND_FMUL): ...this.
(UNSPEC_COND_DIV): Rename to...
(UNSPEC_COND_FDIV): ...this.
(UNSPEC_COND_MAX): Rename to...
(UNSPEC_COND_FMAXNM): ...this.
(UNSPEC_COND_MIN): Rename to...
(UNSPEC_COND_FMINNM): ...this.
(UNSPEC_COND_LT): Rename to...
(UNSPEC_COND_FCMLT): ...this.
(UNSPEC_COND_LE): Rename to...
(UNSPEC_COND_FCMLE): ...this.
(UNSPEC_COND_EQ): Rename to...
(UNSPEC_COND_FCMEQ): ...this.
(UNSPEC_COND_NE): Rename to...
(UNSPEC_COND_FCMNE): ...this.
(UNSPEC_COND_GE): Rename to...
(UNSPEC_COND_FCMGE): ...this.
(UNSPEC_COND_GT): Rename to...
(UNSPEC_COND_FCMGT): ...this.
(SVE_COND_FP_BINARY, SVE_COND_FP_CMP, optab, cmp_op, sve_fp_op)
(sve_fp_op_rev): Update accordingly.
* config/aarch64/aarch64.c (aarch64_unspec_cond_code): Likewise.

From-SVN: r274185

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/iterators.md

index 4328352cb9a0e8b5ca2bfb26ac186ed5d8b40f04..aa0ad4aff3e499ec3aef4fded641c655331ba4ad 100644 (file)
@@ -1,3 +1,33 @@
+2019-08-07  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/aarch64/iterators.md (UNSPEC_COND_ADD): Rename to...
+       (UNSPEC_COND_FADD): ...this.
+       (UNSPEC_COND_SUB): Rename to...
+       (UNSPEC_COND_FSUB): ...this.
+       (UNSPEC_COND_MUL): Rename to...
+       (UNSPEC_COND_FMUL): ...this.
+       (UNSPEC_COND_DIV): Rename to...
+       (UNSPEC_COND_FDIV): ...this.
+       (UNSPEC_COND_MAX): Rename to...
+       (UNSPEC_COND_FMAXNM): ...this.
+       (UNSPEC_COND_MIN): Rename to...
+       (UNSPEC_COND_FMINNM): ...this.
+       (UNSPEC_COND_LT): Rename to...
+       (UNSPEC_COND_FCMLT): ...this.
+       (UNSPEC_COND_LE): Rename to...
+       (UNSPEC_COND_FCMLE): ...this.
+       (UNSPEC_COND_EQ): Rename to...
+       (UNSPEC_COND_FCMEQ): ...this.
+       (UNSPEC_COND_NE): Rename to...
+       (UNSPEC_COND_FCMNE): ...this.
+       (UNSPEC_COND_GE): Rename to...
+       (UNSPEC_COND_FCMGE): ...this.
+       (UNSPEC_COND_GT): Rename to...
+       (UNSPEC_COND_FCMGT): ...this.
+       (SVE_COND_FP_BINARY, SVE_COND_FP_CMP, optab, cmp_op, sve_fp_op)
+       (sve_fp_op_rev): Update accordingly.
+       * config/aarch64/aarch64.c (aarch64_unspec_cond_code): Likewise.
+
 2019-08-07  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64-sve.md: Reorganize contents and add
index 5bf182ccc0c3db9940c2d811374e5de012e64904..b99d5ec0e2b06521bd5b59df22926a9a56d2688d 100644 (file)
@@ -17097,17 +17097,17 @@ aarch64_unspec_cond_code (rtx_code code)
   switch (code)
     {
     case NE:
-      return UNSPEC_COND_NE;
+      return UNSPEC_COND_FCMNE;
     case EQ:
-      return UNSPEC_COND_EQ;
+      return UNSPEC_COND_FCMEQ;
     case LT:
-      return UNSPEC_COND_LT;
+      return UNSPEC_COND_FCMLT;
     case GT:
-      return UNSPEC_COND_GT;
+      return UNSPEC_COND_FCMGT;
     case LE:
-      return UNSPEC_COND_LE;
+      return UNSPEC_COND_FCMLE;
     case GE:
-      return UNSPEC_COND_GE;
+      return UNSPEC_COND_FCMGE;
     default:
       gcc_unreachable ();
     }
index a81b2f017c6ace3740f1885cbf94d3033b672859..fcd550ce7448279b3634d8b8cb2f1f70afcdd4de 100644 (file)
     UNSPEC_XORF                ; Used in aarch64-sve.md.
     UNSPEC_SMUL_HIGHPART ; Used in aarch64-sve.md.
     UNSPEC_UMUL_HIGHPART ; Used in aarch64-sve.md.
-    UNSPEC_COND_ADD    ; Used in aarch64-sve.md.
-    UNSPEC_COND_SUB    ; Used in aarch64-sve.md.
-    UNSPEC_COND_MUL    ; Used in aarch64-sve.md.
-    UNSPEC_COND_DIV    ; Used in aarch64-sve.md.
-    UNSPEC_COND_MAX    ; Used in aarch64-sve.md.
-    UNSPEC_COND_MIN    ; Used in aarch64-sve.md.
+    UNSPEC_COND_FADD   ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMEQ  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMGE  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMGT  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMLE  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMLT  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FCMNE  ; Used in aarch64-sve.md.
+    UNSPEC_COND_FDIV   ; Used in aarch64-sve.md.
+    UNSPEC_COND_FMAXNM ; Used in aarch64-sve.md.
+    UNSPEC_COND_FMINNM ; Used in aarch64-sve.md.
     UNSPEC_COND_FMLA   ; Used in aarch64-sve.md.
     UNSPEC_COND_FMLS   ; Used in aarch64-sve.md.
+    UNSPEC_COND_FMUL   ; Used in aarch64-sve.md.
     UNSPEC_COND_FNMLA  ; Used in aarch64-sve.md.
     UNSPEC_COND_FNMLS  ; Used in aarch64-sve.md.
-    UNSPEC_COND_LT     ; Used in aarch64-sve.md.
-    UNSPEC_COND_LE     ; Used in aarch64-sve.md.
-    UNSPEC_COND_EQ     ; Used in aarch64-sve.md.
-    UNSPEC_COND_NE     ; Used in aarch64-sve.md.
-    UNSPEC_COND_GE     ; Used in aarch64-sve.md.
-    UNSPEC_COND_GT     ; Used in aarch64-sve.md.
+    UNSPEC_COND_FSUB   ; Used in aarch64-sve.md.
     UNSPEC_LASTB       ; Used in aarch64-sve.md.
     UNSPEC_FCADD90     ; Used in aarch64-simd.md.
     UNSPEC_FCADD270    ; Used in aarch64-simd.md.
 
 (define_int_iterator MUL_HIGHPART [UNSPEC_SMUL_HIGHPART UNSPEC_UMUL_HIGHPART])
 
-(define_int_iterator SVE_COND_FP_BINARY [UNSPEC_COND_ADD UNSPEC_COND_SUB
-                                        UNSPEC_COND_MUL UNSPEC_COND_DIV
-                                        UNSPEC_COND_MAX UNSPEC_COND_MIN])
+(define_int_iterator SVE_COND_FP_BINARY [UNSPEC_COND_FADD
+                                        UNSPEC_COND_FDIV
+                                        UNSPEC_COND_FMAXNM
+                                        UNSPEC_COND_FMINNM
+                                        UNSPEC_COND_FMUL
+                                        UNSPEC_COND_FSUB])
 
 (define_int_iterator SVE_COND_FP_TERNARY [UNSPEC_COND_FMLA
                                          UNSPEC_COND_FMLS
                                          UNSPEC_COND_FNMLA
                                          UNSPEC_COND_FNMLS])
 
-(define_int_iterator SVE_COND_FP_CMP [UNSPEC_COND_LT UNSPEC_COND_LE
-                                     UNSPEC_COND_EQ UNSPEC_COND_NE
-                                     UNSPEC_COND_GE UNSPEC_COND_GT])
+(define_int_iterator SVE_COND_FP_CMP [UNSPEC_COND_FCMEQ
+                                     UNSPEC_COND_FCMGE
+                                     UNSPEC_COND_FCMGT
+                                     UNSPEC_COND_FCMLE
+                                     UNSPEC_COND_FCMLT
+                                     UNSPEC_COND_FCMNE])
 
 (define_int_iterator FCADD [UNSPEC_FCADD90
                            UNSPEC_FCADD270])
                        (UNSPEC_ANDV "and")
                        (UNSPEC_IORV "ior")
                        (UNSPEC_XORV "xor")
-                       (UNSPEC_COND_ADD "add")
-                       (UNSPEC_COND_SUB "sub")
-                       (UNSPEC_COND_MUL "mul")
-                       (UNSPEC_COND_DIV "div")
-                       (UNSPEC_COND_MAX "smax")
-                       (UNSPEC_COND_MIN "smin")
+                       (UNSPEC_COND_FADD "add")
+                       (UNSPEC_COND_FDIV "div")
+                       (UNSPEC_COND_FMAXNM "smax")
+                       (UNSPEC_COND_FMINNM "smin")
                        (UNSPEC_COND_FMLA "fma")
                        (UNSPEC_COND_FMLS "fnma")
+                       (UNSPEC_COND_FMUL "mul")
                        (UNSPEC_COND_FNMLA "fnms")
-                       (UNSPEC_COND_FNMLS "fms")])
+                       (UNSPEC_COND_FNMLS "fms")
+                       (UNSPEC_COND_FSUB "sub")])
 
 (define_int_attr  maxmin_uns [(UNSPEC_UMAXV "umax")
                              (UNSPEC_UMINV "umin")
                          (UNSPEC_FMLAL2 "a") (UNSPEC_FMLSL2 "s")])
 
 ;; The condition associated with an UNSPEC_COND_<xx>.
-(define_int_attr cmp_op [(UNSPEC_COND_LT "lt")
-                        (UNSPEC_COND_LE "le")
-                        (UNSPEC_COND_EQ "eq")
-                        (UNSPEC_COND_NE "ne")
-                        (UNSPEC_COND_GE "ge")
-                        (UNSPEC_COND_GT "gt")])
-
-(define_int_attr sve_fp_op [(UNSPEC_COND_ADD "fadd")
-                           (UNSPEC_COND_SUB "fsub")
-                           (UNSPEC_COND_MUL "fmul")
-                           (UNSPEC_COND_DIV "fdiv")
-                           (UNSPEC_COND_MAX "fmaxnm")
-                           (UNSPEC_COND_MIN "fminnm")])
-
-(define_int_attr sve_fp_op_rev [(UNSPEC_COND_ADD "fadd")
-                               (UNSPEC_COND_SUB "fsubr")
-                               (UNSPEC_COND_MUL "fmul")
-                               (UNSPEC_COND_DIV "fdivr")
-                               (UNSPEC_COND_MAX "fmaxnm")
-                               (UNSPEC_COND_MIN "fminnm")])
+(define_int_attr cmp_op [(UNSPEC_COND_FCMEQ "eq")
+                        (UNSPEC_COND_FCMGE "ge")
+                        (UNSPEC_COND_FCMGT "gt")
+                        (UNSPEC_COND_FCMLE "le")
+                        (UNSPEC_COND_FCMLT "lt")
+                        (UNSPEC_COND_FCMNE "ne")])
+
+(define_int_attr sve_fp_op [(UNSPEC_COND_FADD "fadd")
+                           (UNSPEC_COND_FDIV "fdiv")
+                           (UNSPEC_COND_FMAXNM "fmaxnm")
+                           (UNSPEC_COND_FMINNM "fminnm")
+                           (UNSPEC_COND_FMUL "fmul")
+                           (UNSPEC_COND_FSUB "fsub")])
+
+(define_int_attr sve_fp_op_rev [(UNSPEC_COND_FADD "fadd")
+                               (UNSPEC_COND_FDIV "fdivr")
+                               (UNSPEC_COND_FMAXNM "fmaxnm")
+                               (UNSPEC_COND_FMINNM "fminnm")
+                               (UNSPEC_COND_FMUL "fmul")
+                               (UNSPEC_COND_FSUB "fsubr")])
 
 (define_int_attr rot [(UNSPEC_FCADD90 "90")
                      (UNSPEC_FCADD270 "270")