diff mbox

[3/9] rs6000: Clean up one_cmpl<mode>2

Message ID 0b3dde22d75d9b64800efc8501b9ae4a059b9889.1411216924.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool Sept. 20, 2014, 6:23 p.m. UTC
Just the usual tidying.  Also use the "not" extended mnemonic instead
of the "nor" that translates to.


2014-09-20  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (*one_cmpl<mode>2): Generate "not" insn.
	(two anonymous define_insn and two define_split): Delete.
	(*one_cmpl<mode>2_dot, *one_cmpl<mode>2_dot2): New.


---
 gcc/config/rs6000/rs6000.md | 68 +++++++++++++++++++--------------------------
 1 file changed, 28 insertions(+), 40 deletions(-)

Comments

David Edelsohn Sept. 21, 2014, 5:46 p.m. UTC | #1
On Sat, Sep 20, 2014 at 2:23 PM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> Just the usual tidying.  Also use the "not" extended mnemonic instead
> of the "nor" that translates to.
>
>
> 2014-09-20  Segher Boessenkool  <segher@kernel.crashing.org>
>
>         * config/rs6000/rs6000.md (*one_cmpl<mode>2): Generate "not" insn.
>         (two anonymous define_insn and two define_split): Delete.
>         (*one_cmpl<mode>2_dot, *one_cmpl<mode>2_dot2): New.

Okay.

Thanks, David
diff mbox

Patch

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 1e73e6a..1a289d6 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1594,61 +1594,49 @@  (define_insn "*one_cmpl<mode>2"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))]
   ""
-  "nor %0,%1,%1")
+  "not %0,%1")
 
-(define_insn ""
-  [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y")
-	(compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r"))
+(define_insn_and_split "*one_cmpl<mode>2_dot"
+  [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
+	(compare:CC (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r"))
 		    (const_int 0)))
-   (clobber (match_scratch:P 2 "=r,r"))]
-  ""
+   (clobber (match_scratch:GPR 0 "=r,r"))]
+  "<MODE>mode == Pmode && rs6000_gen_cell_microcode"
   "@
-   nor. %2,%1,%1
+   not. %0,%1
    #"
-  [(set_attr "type" "logical,compare")
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
+  [(set (match_dup 0)
+	(not:GPR (match_dup 1)))
+   (set (match_dup 2)
+	(compare:CC (match_dup 0)
+		    (const_int 0)))]
+  ""
+  [(set_attr "type" "logical")
    (set_attr "dot" "yes")
    (set_attr "length" "4,8")])
 
-(define_split
-  [(set (match_operand:CC 0 "cc_reg_not_micro_cr0_operand" "")
-	(compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" ""))
-		    (const_int 0)))
-   (clobber (match_scratch:P 2 ""))]
-  "reload_completed"
-  [(set (match_dup 2)
-	(not:P (match_dup 1)))
-   (set (match_dup 0)
-	(compare:CC (match_dup 2)
-		    (const_int 0)))]
-  "")
-
-(define_insn ""
+(define_insn_and_split "*one_cmpl<mode>2_dot2"
   [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y")
-	(compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r"))
+	(compare:CC (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r,r"))
 		    (const_int 0)))
-   (set (match_operand:P 0 "gpc_reg_operand" "=r,r")
-	(not:P (match_dup 1)))]
-  ""
+   (set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
+	(not:GPR (match_dup 1)))]
+  "<MODE>mode == Pmode && rs6000_gen_cell_microcode"
   "@
-   nor. %0,%1,%1
+   not. %0,%1
    #"
-  [(set_attr "type" "logical,compare")
-   (set_attr "dot" "yes")
-   (set_attr "length" "4,8")])
-
-(define_split
-  [(set (match_operand:CC 2 "cc_reg_not_micro_cr0_operand" "")
-	(compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" ""))
-		    (const_int 0)))
-   (set (match_operand:P 0 "gpc_reg_operand" "")
-	(not:P (match_dup 1)))]
-  "reload_completed"
+  "&& reload_completed && cc_reg_not_cr0_operand (operands[2], CCmode)"
   [(set (match_dup 0)
-	(not:P (match_dup 1)))
+	(not:GPR (match_dup 1)))
    (set (match_dup 2)
 	(compare:CC (match_dup 0)
 		    (const_int 0)))]
-  "")
+  ""
+  [(set_attr "type" "logical")
+   (set_attr "dot" "yes")
+   (set_attr "length" "4,8")])
+
 
 (define_insn ""
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")