diff mbox

[2/2] rs6000: Clean up the cstore code a bit

Message ID 2c10dc4d733427f3f85b219f8b9a49e3f5034bdd.1449238455.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Dec. 4, 2015, 2:34 p.m. UTC
"register_operand" was a bit confusing.  Also some other minor cleanups.

Tested on powerpc64-linux; okay for mainline?


Segher


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.

---
 gcc/config/rs6000/rs6000.md | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

Comments

David Edelsohn Dec. 4, 2015, 2:45 p.m. UTC | #1
On Fri, Dec 4, 2015 at 9:34 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> "register_operand" was a bit confusing.  Also some other minor cleanups.
>
> Tested on powerpc64-linux; okay for mainline?
>
>
> Segher
>
>
> 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.

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 98abdb2..80f4161 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -10568,9 +10568,9 @@  (define_expand "cstore<mode>4_signed"
 
 (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]);
@@ -10582,8 +10582,7 @@  (define_expand "cstore<mode>4_unsigned"
   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))
@@ -10609,7 +10608,7 @@  (define_expand "cstore_si_as_di"
   [(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;
@@ -10654,7 +10653,7 @@  (define_expand "cstore<mode>4_signed_imm"
   [(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;
@@ -10699,7 +10698,7 @@  (define_expand "cstore<mode>4_unsigned_imm"
   [(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;
@@ -10746,7 +10745,7 @@  (define_expand "cstore<mode>4"
   [(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.  */
@@ -10806,9 +10805,9 @@  (define_expand "cstore<mode>4"
 
 (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);