[ARM,9/n] Split scc patterns using movsicc

Submitted by Greta Yorsh on April 12, 2013, 11:03 a.m.

Details

Message ID 000001ce376d$662cd460$32867d20$@yorsh@arm.com
State New
Headers show

Commit Message

Greta Yorsh April 12, 2013, 11:03 a.m.
This patch converts define_insn into define_insn_and_split for simple scc
patterns and emits RTL insns that match movsicc pattern.
 
Tested as part of the series for splitting arm.md patterns that output
multiple asm instructions. No regression on qemu with arm-none-eabi and
bootstrap successful.

Ok for trunk?

Thanks,
Greta

gcc/

2013-02-19  Greta Yorsh  <Greta.Yorsh@arm.com>

        * config/arm/arm.md (mov_scc,mov_negscc,mov_notscc): Convert
        define_insn into define_insn_and_split and emit movsicc
        patterns.
commit f678aaf7cdab589f34b1bf92b3f9fcabd7f29593
Author: Greta <Greta.Yorsh@arm.com>
Date:   Thu Apr 11 10:54:27 2013 +0100

    9

Comments

Richard Earnshaw April 12, 2013, 1:06 p.m.
On 12/04/13 12:03, Greta Yorsh wrote:
> This patch converts define_insn into define_insn_and_split for simple scc
> patterns and emits RTL insns that match movsicc pattern.
>
> Tested as part of the series for splitting arm.md patterns that output
> multiple asm instructions. No regression on qemu with arm-none-eabi and
> bootstrap successful.
>
> Ok for trunk?
>
> Thanks,
> Greta
>
> gcc/
>
> 2013-02-19  Greta Yorsh  <Greta.Yorsh@arm.com>
>
>          * config/arm/arm.md (mov_scc,mov_negscc,mov_notscc): Convert
>          define_insn into define_insn_and_split and emit movsicc
>          patterns.
>

OK.

R.

Patch hide | download patch | download mbox

diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 073ee6b..4284535 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -8259,36 +8259,56 @@ 
    operands[3] = const0_rtx;"
 )
 
-(define_insn "*mov_scc"
+(define_insn_and_split "*mov_scc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
 	(match_operator:SI 1 "arm_comparison_operator"
 	 [(match_operand 2 "cc_register" "") (const_int 0)]))]
   "TARGET_ARM"
-  "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
+  "#"   ; "mov%D1\\t%0, #0\;mov%d1\\t%0, #1"
+  "TARGET_ARM"
+  [(set (match_dup 0)
+        (if_then_else:SI (match_dup 1)
+                         (const_int 1)
+                         (const_int 0)))]
+  ""
   [(set_attr "conds" "use")
-   (set_attr "insn" "mov")
    (set_attr "length" "8")]
 )
 
-(define_insn "*mov_negscc"
+(define_insn_and_split "*mov_negscc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
 	(neg:SI (match_operator:SI 1 "arm_comparison_operator"
 		 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_ARM"
-  "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
+  "#"   ; "mov%D1\\t%0, #0\;mvn%d1\\t%0, #0"
+  "TARGET_ARM"
+  [(set (match_dup 0)
+        (if_then_else:SI (match_dup 1)
+                         (match_dup 3)
+                         (const_int 0)))]
+  {
+    operands[3] = GEN_INT (~0);
+  }
   [(set_attr "conds" "use")
-   (set_attr "insn" "mov")
    (set_attr "length" "8")]
 )
 
-(define_insn "*mov_notscc"
+(define_insn_and_split "*mov_notscc"
   [(set (match_operand:SI 0 "s_register_operand" "=r")
 	(not:SI (match_operator:SI 1 "arm_comparison_operator"
 		 [(match_operand 2 "cc_register" "") (const_int 0)])))]
   "TARGET_ARM"
-  "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
+  "#"   ; "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1"
+  "TARGET_ARM"
+  [(set (match_dup 0)
+        (if_then_else:SI (match_dup 1)
+                         (match_dup 3)
+                         (match_dup 4)))]
+  {
+    operands[3] = GEN_INT (~1);
+    operands[4] = GEN_INT (~0);
+  }
   [(set_attr "conds" "use")
-   (set_attr "insn" "mov")
    (set_attr "length" "8")]
 )