rs6000: Clean up the cstore code a bit
authorSegher Boessenkool <segher@gcc.gnu.org>
Fri, 4 Dec 2015 17:28:54 +0000 (18:28 +0100)
committerSegher Boessenkool <segher@gcc.gnu.org>
Fri, 4 Dec 2015 17:28:54 +0000 (18:28 +0100)
"register_operand" was a bit confusing.  Also some other minor cleanups.

* (cstore<mode>4_unsigned): Use gpc_reg_operand instead of
register_operand.  Remove empty constraints.  Use std::swap.
(cstore_si_as_di, cstore<mode>4_signed_imm,
cstore<mode>4_unsigned_imm, cstore<mode>4 for GPR): Use
gpc_reg_operand instead of register_operand.
(cstore<mode>4 for FP): Use gpc_reg_operand instead of
register_operand.  Remove empty constraints.

From-SVN: r231287

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index c918cf92931aed1dbe02f4e08b099f8f9270b395..572b9a68d84764e38d632b014fde98d408883232 100644 (file)
@@ -1,4 +1,14 @@
-2015-11-25  Nick Clifton  <nickc@redhat.com>
+2015-12-04  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * (cstore<mode>4_unsigned): Use gpc_reg_operand instead of
+       register_operand.  Remove empty constraints.  Use std::swap.
+       (cstore_si_as_di, cstore<mode>4_signed_imm,
+       cstore<mode>4_unsigned_imm, cstore<mode>4 for GPR): Use
+       gpc_reg_operand instead of register_operand.
+       (cstore<mode>4 for FP): Use gpc_reg_operand instead of
+       register_operand.  Remove empty constraints.
+
+2015-12-04  Nick Clifton  <nickc@redhat.com>
 
        * config.gcc (extra_gcc_objs): Define for MSP430.
         * common/config/msp430/msp430-common.c (msp430_handle_option):
index f346cba8e08de13f9ef6151044d1e4a31f142731..39e1b299a72e89b2abb4d52a084ed07d6ed48cfe 100644 (file)
 
 (define_expand "cstore<mode>4_unsigned"
   [(use (match_operator 1 "unsigned_comparison_operator"
-         [(match_operand:P 2 "gpc_reg_operand" "")
-          (match_operand:P 3 "reg_or_short_operand" "")]))
-   (clobber (match_operand:P 0 "register_operand"))]
+         [(match_operand:P 2 "gpc_reg_operand")
+          (match_operand:P 3 "reg_or_short_operand")]))
+   (clobber (match_operand:P 0 "gpc_reg_operand"))]
   ""
 {
   enum rtx_code cond_code = GET_CODE (operands[1]);
   if (cond_code == GEU || cond_code == LTU)
     {
       cond_code = swap_condition (cond_code);
-      op1 = operands[3];
-      op2 = operands[2];
+      std::swap (op1, op2);
     }
 
   if (!gpc_reg_operand (op1, <MODE>mode))
   [(use (match_operator 1 "unsigned_comparison_operator"
          [(match_operand:SI 2 "gpc_reg_operand")
           (match_operand:SI 3 "reg_or_short_operand")]))
-   (clobber (match_operand:SI 0 "register_operand"))]
+   (clobber (match_operand:SI 0 "gpc_reg_operand"))]
   ""
 {
   int uns_flag = unsigned_comparison_operator (operands[1], VOIDmode) ? 1 : 0;
   [(use (match_operator 1 "signed_comparison_operator"
          [(match_operand:GPR 2 "gpc_reg_operand")
           (match_operand:GPR 3 "immediate_operand")]))
-   (clobber (match_operand:GPR 0 "register_operand"))]
+   (clobber (match_operand:GPR 0 "gpc_reg_operand"))]
   ""
 {
   bool invert = false;
   [(use (match_operator 1 "unsigned_comparison_operator"
          [(match_operand:GPR 2 "gpc_reg_operand")
           (match_operand:GPR 3 "immediate_operand")]))
-   (clobber (match_operand:GPR 0 "register_operand"))]
+   (clobber (match_operand:GPR 0 "gpc_reg_operand"))]
   ""
 {
   bool invert = false;
   [(use (match_operator 1 "rs6000_cbranch_operator"
          [(match_operand:GPR 2 "gpc_reg_operand")
           (match_operand:GPR 3 "reg_or_short_operand")]))
-   (clobber (match_operand:GPR 0 "register_operand"))]
+   (clobber (match_operand:GPR 0 "gpc_reg_operand"))]
   ""
 {
   /* Use ISEL if the user asked for it.  */
 
 (define_expand "cstore<mode>4"
   [(use (match_operator 1 "rs6000_cbranch_operator"
-         [(match_operand:FP 2 "gpc_reg_operand" "")
-          (match_operand:FP 3 "gpc_reg_operand" "")]))
-   (clobber (match_operand:SI 0 "register_operand"))]
+         [(match_operand:FP 2 "gpc_reg_operand")
+          (match_operand:FP 3 "gpc_reg_operand")]))
+   (clobber (match_operand:SI 0 "gpc_reg_operand"))]
   ""
 {
   rs6000_emit_sCOND (<MODE>mode, operands);