[AArch64] Use std::swap instead of manually swapping in aarch64-ldpstp.md
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Wed, 4 Feb 2015 13:53:56 +0000 (13:53 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Wed, 4 Feb 2015 13:53:56 +0000 (13:53 +0000)
* config/aarch64/aarch64-ldpstp.md: Use std::swap instead of
manual swaps in all peepholes.

From-SVN: r220403

gcc/ChangeLog
gcc/config/aarch64/aarch64-ldpstp.md

index 165f521f806bf51c36595e3e645a6e1f95b1d667..d63c59cacbeecd31ea870de32f4f3fde3991ddd8 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * config/aarch64/aarch64-ldpstp.md: Use std::swap instead of
+       manual swaps in all peepholes.
+
 2015-02-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
index af8d50e18919a57c4bd6fdcecc5fdeb324e6f921..8d6d88259d5931a38b152791bc1a7f5e2681b2f5 100644 (file)
   [(parallel [(set (match_dup 0) (match_dup 1))
              (set (match_dup 2) (match_dup 3))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   [(parallel [(set (match_dup 0) (match_dup 1))
              (set (match_dup 2) (match_dup 3))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[0], &base, &offset_1);
   extract_base_offset_in_addr (operands[2], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   [(parallel [(set (match_dup 0) (match_dup 1))
              (set (match_dup 2) (match_dup 3))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   [(parallel [(set (match_dup 0) (match_dup 1))
              (set (match_dup 2) (match_dup 3))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[0], &base, &offset_1);
   extract_base_offset_in_addr (operands[2], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   [(parallel [(set (match_dup 0) (sign_extend:DI (match_dup 1)))
              (set (match_dup 2) (sign_extend:DI (match_dup 3)))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   [(parallel [(set (match_dup 0) (zero_extend:DI (match_dup 1)))
              (set (match_dup 2) (zero_extend:DI (match_dup 3)))])]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[2];
-      operands[2] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[3];
-      operands[3] = tmp;
+      std::swap (operands[0], operands[2]);
+      std::swap (operands[1], operands[3]);
     }
 })
 
   "aarch64_operands_adjust_ok_for_ldpstp (operands, true, <MODE>mode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, true, <MODE>mode, UNKNOWN))
   "aarch64_operands_adjust_ok_for_ldpstp (operands, true, <MODE>mode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, true, <MODE>mode, UNKNOWN))
   "aarch64_operands_adjust_ok_for_ldpstp (operands, true, SImode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, true, SImode, SIGN_EXTEND))
   "aarch64_operands_adjust_ok_for_ldpstp (operands, true, SImode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[1], &base, &offset_1);
   extract_base_offset_in_addr (operands[3], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, true, SImode, ZERO_EXTEND))
   "aarch64_operands_adjust_ok_for_ldpstp (operands, false, <MODE>mode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[0], &base, &offset_1);
   extract_base_offset_in_addr (operands[2], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, false, <MODE>mode, UNKNOWN))
   "aarch64_operands_adjust_ok_for_ldpstp (operands, false, <MODE>mode)"
   [(const_int 0)]
 {
-  rtx base, offset_1, offset_2, tmp;
+  rtx base, offset_1, offset_2;
 
   extract_base_offset_in_addr (operands[0], &base, &offset_1);
   extract_base_offset_in_addr (operands[2], &base, &offset_2);
   if (INTVAL (offset_1) > INTVAL (offset_2))
     {
-      tmp = operands[0];
-      operands[0] = operands[6];
-      operands[6] = tmp;
-      tmp = operands[1];
-      operands[1] = operands[7];
-      operands[7] = tmp;
-      tmp = operands[2];
-      operands[2] = operands[4];
-      operands[4] = tmp;
-      tmp = operands[3];
-      operands[3] = operands[5];
-      operands[5] = tmp;
+      std::swap (operands[0], operands[6]);
+      std::swap (operands[1], operands[7]);
+      std::swap (operands[2], operands[4]);
+      std::swap (operands[3], operands[5]);
     }
 
   if (aarch64_gen_adjusted_ldpstp (operands, false, <MODE>mode, UNKNOWN))