public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, picochip] cbranch pattern change
@ 2011-05-26 13:27 Hari Sandanagobalane
  0 siblings, 0 replies; only message in thread
From: Hari Sandanagobalane @ 2011-05-26 13:27 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

Hello all,
The gimple->rtl expander phase now expects cbranch to not have a :CC 
after the match operator. This is the case for cbranch for all the other 
ports anyway, so now picochip matches this pattern. Committed to 
mainline as

ChangeLog:
         * config/picochip/picochip.md (cbranchhi4): No :CC for 
match_operator.
           The instruction is then expanded explicitly.
         (supported_compare): Callable instruction.
         (compare): Likewise.

Patch: Attached

[-- Attachment #2: patch1 --]
[-- Type: text/plain, Size: 2343 bytes --]

Index: gcc/config/picochip/picochip.md
===================================================================
--- gcc/config/picochip/picochip.md	(revision 174269)
+++ gcc/config/picochip/picochip.md	(working copy)
@@ -551,7 +551,7 @@
 (define_insn_and_split "cbranchhi4"
   [(set (pc)
         (if_then_else
-            (match_operator:CC 0 "ordered_comparison_operator"
+            (match_operator 0 "ordered_comparison_operator"
                             [(match_operand:HI 1 "register_operand" "r")
                              (match_operand:HI 2 "picochip_comparison_operand" "ri")])
             (label_ref       (match_operand    3 "" ""))
@@ -561,14 +561,15 @@
   "* return picochip_output_cbranch(operands);"
   "reload_completed
    && (picochip_schedule_type != DFA_TYPE_NONE || flag_delayed_branch)"
-  [(set (reg:CC CC_REGNUM) (match_dup 0))
-   (parallel [(set (pc)
-                   (if_then_else (match_op_dup:HI 0 [(reg:CC CC_REGNUM) (const_int 0)])
-                                 (label_ref (match_dup 3))
-                                 (pc)))
-              (use (match_dup 4))])]
+  [(const_int 0)]
   "{
-     operands[4] = GEN_INT(GET_CODE(operands[0]));
+     rtx const_int_opnd;
+     const_int_opnd = GEN_INT(GET_CODE(operands[0]));
+     if (picochip_supported_comparison_operator (operands[0], HImode))
+       emit_insn (gen_supported_compare (operands[0], operands[1], operands[2]));
+     else
+       emit_insn (gen_compare (operands[0], operands[1], operands[2]));
+     emit_jump_insn (gen_branch (operands[3], const_int_opnd, operands[0]));
    }")
 
 ;; The only difference between this and the next pattern is that the next pattern
@@ -577,7 +578,7 @@
 ;; comparison operator and hence this pattern assumes that the second constraint combo
 ;; would still generate a normal instruction.
 
-(define_insn "*supported_compare"
+(define_insn "supported_compare"
   [(set (reg:CC CC_REGNUM)
         (match_operator:CC 0 "picochip_supported_comparison_operator"
                         [(match_operand:HI 1 "register_operand" "r,r,r")
@@ -607,7 +608,7 @@
    (set_attr "length" "2,2,4")
    ])
 
-(define_insn "*compare"
+(define_insn "compare"
   [(set (reg:CC CC_REGNUM)
         (match_operator:CC 0 "comparison_operator"
                         [(match_operand:HI 1 "register_operand" "r,r,r")

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-26 12:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 13:27 [PATCH, picochip] cbranch pattern change Hari Sandanagobalane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).