]> gcc.gnu.org Git - gcc.git/commitdiff
c4x.md (decrement_and_branch_on_count): Disabled.
authorMichael Hayes <m.hayes@elec.canterbury.ac.nz>
Fri, 14 May 1999 19:16:36 +0000 (19:16 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Fri, 14 May 1999 19:16:36 +0000 (19:16 +0000)
* config/c4x/c4x.md (decrement_and_branch_on_count): Disabled.
(doloop_begin, doloop_end): New patterns.
(*rptb_init): Added extra operands.

From-SVN: r26939

gcc/ChangeLog
gcc/config/c4x/c4x.md

index cbd52b1f00f20f1b4e867796e9e7c7a186692fb2..461524bae615834d1a57d7f96492823b7d74467c 100644 (file)
@@ -1,3 +1,9 @@
+Sat May 15 14:09:08 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * config/c4x/c4x.md (decrement_and_branch_on_count): Disabled.
+       (doloop_begin, doloop_end): New patterns.
+       (*rptb_init): Added extra operands.
+
 Fri May 14 21:31:36 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * config/c4x/c4x.md (*umulqi3_highpart_clobber): Fix operand 2
index 467bf100c356577536ad4a2e20adf39173878662..1b7bd2b287b18714a1874fbac5724aca3825fe68 100644 (file)
 ; say that RS and RE are loaded.
 (define_insn "*rptb_init"
   [(unspec[(match_operand:QI 0 "register_operand" "va")] 22)
+   (use (match_operand:QI 1 "const_int_operand" ""))
+   (use (match_operand:QI 2 "const_int_operand" ""))
+   (use (match_operand:QI 3 "const_int_operand" ""))
    (clobber (reg:QI 25))
    (clobber (reg:QI 26))]
   ""
   [(set_attr "type" "repeat")])
 
 
+(define_expand "doloop_begin"
+  [(parallel [(unspec[(match_operand:QI 0 "register_operand" "va")] 22)
+              (use (match_operand:QI 1 "const_int_operand" ""))
+              (use (match_operand:QI 2 "const_int_operand" ""))
+              (use (match_operand:QI 3 "const_int_operand" ""))
+              (clobber (reg:QI 25))
+              (clobber (reg:QI 26))])]
+  ""
+  "if (INTVAL (operands[3]) > 1 || ! TARGET_RPTB)
+     FAIL;")
+
+
 ; The RS (25) and RE (26) registers must be unviolate from the top of the loop
 ; to here.
 (define_insn "rptb_end"
    (set (match_dup 0)
         (plus:QI (match_dup 0)
                  (const_int -1)))
+   (use (match_operand:QI 2 "const_int_operand" ""))
+   (use (match_operand:QI 3 "const_int_operand" ""))
+   (use (match_operand:QI 4 "const_int_operand" ""))
    (use (reg:QI 25))
    (use (reg:QI 26))
    (clobber (reg:CC_NOOV 21))]
   "
   [(set_attr "type" "repeat,db,jmpc,jmpc,jmpc")])
 
-
-(define_expand "decrement_and_branch_on_count"
+; operand 0 is the loop count register
+; operand 1 is the label to jump to at the top of the loop
+; operand 2 is the number of loop iterations or 0 if it is unknown
+; operand 3 is the maximum number of loop iterations
+; operand 4 is the number of levels of enclosed loops
+(define_expand "doloop_end"
   [(parallel [(set (pc)
                    (if_then_else (ge (match_operand:QI 0 "register_operand" "")
                                      (const_int 0))
               (set (match_dup 0)
                   (plus:QI (match_dup 0)
                            (const_int -1)))
+              (use (match_operand:QI 2 "const_int_operand" ""))
+              (use (match_operand:QI 3 "const_int_operand" ""))
+              (use (match_operand:QI 4 "const_int_operand" ""))
               (use (reg:QI 25))
               (use (reg:QI 26))
               (clobber (reg:CC_NOOV 21))])]
   ""
-  "if (0)
+  "if (! TARGET_LOOP_UNSIGNED 
+       && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) > (1U << 31))
+     FAIL;
+   if (INTVAL (operands[4]) > 1 || ! TARGET_RPTB)
      {
         /* The C30 maximum iteration count for DB is 2^24.  */
-       if (!TARGET_DB)
-            FAIL;
+       if (! TARGET_DB)
+          FAIL;
         emit_insn (gen_decrement_and_branch_until_zero (operands[0],
                                                         operands[1]));
        DONE;
      }")
 
+; The current low overhead looping code is naff and is not failsafe
+; If you want RTPB instructions to be generated, apply the patches
+; from www.elec.canterbury.ac.nz/c4x.  This will utilise the
+; doloop_begin and doloop_end patterns in this MD.
+(define_expand "decrement_and_branch_on_count"
+  [(parallel [(set (pc)
+                   (if_then_else (ge (match_operand:QI 0 "register_operand" "")
+                                     (const_int 0))
+                                 (label_ref (match_operand 1 "" ""))
+                                 (pc)))
+              (set (match_dup 0)
+                  (plus:QI (match_dup 0)
+                           (const_int -1)))
+              (use (reg:QI 25))
+              (use (reg:QI 26))
+              (clobber (reg:CC_NOOV 21))])]
+  "0"
+  "")
+
 (define_expand "movstrqi_small2"
   [(parallel [(set (mem:BLK (match_operand:BLK 0 "src_operand" ""))
                    (mem:BLK (match_operand:BLK 1 "src_operand" "")))
This page took 0.075059 seconds and 5 git commands to generate.