]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Change (reg:CC 17) to (reg:SI 17)
authorNick Clifton <nickc@cygnus.com>
Thu, 3 Sep 1998 17:49:11 +0000 (17:49 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 3 Sep 1998 17:49:11 +0000 (17:49 +0000)
From-SVN: r22221

gcc/ChangeLog
gcc/config/m32r/m32r.c
gcc/config/m32r/m32r.h
gcc/config/m32r/m32r.md

index b1dc2c967a48feb25155a3c6bffd93a5bf3f913a..2c025c6fd51dd7e34f0c801237e330c599240419 100644 (file)
@@ -1,3 +1,9 @@
+Tue Sep  1 11:30:33 1998  Nick Clifton  <nickc@cygnus.com>
+
+       * config/m32r/m32r.md: Change (reg:CC 17) to (reg:SI 17).
+       * config/m32r/m32r.h: Make register 17 be fixed.
+       * config/m32r/m32r.c: Use SImode for cc operations.
+
 Thu Sep  3 18:17:34 1998 Benjamin Kosnik  <bkoz@cygnus.com>
 
        * invoke.texi (Warning Options): Add -Wnon-template-friend
index a667dbd9eac6448551b6ab3f354d968898908c5f..f88f35b68f4368a336008503b09227bacc45452f 100644 (file)
@@ -898,7 +898,7 @@ m32r_select_cc_mode (op, x, y)
      int op;
      rtx x, y;
 {
-  return (int)CCmode;
+  return (int)SImode;
 }
 
 /* X and Y are two things to compare using CODE.  Emit the compare insn and
@@ -2150,7 +2150,7 @@ carry_compare_operand (op, int_mode)
 {
   rtx x;
 
-  if (GET_MODE (op) != CCmode && GET_MODE (op) != VOIDmode)
+  if (GET_MODE (op) != SImode && GET_MODE (op) != VOIDmode)
     return FALSE;
 
   if (GET_CODE (op) != NE && GET_CODE (op) != EQ)
@@ -2179,7 +2179,8 @@ emit_cond_move (operands, insn)
      rtx   insn;
 {
   static char buffer [100];
-
+  char * dest = reg_names [REGNO (operands [0])];
+  
   buffer [0] = 0;
   
   /* Destination must be a register.  */
@@ -2190,7 +2191,6 @@ emit_cond_move (operands, insn)
   if (! conditional_move_operand (operands [3], SImode))
     abort();
       
-
   /* Check to see if the test is reversed.  */
   if (GET_CODE (operands [1]) == NE)
     {
@@ -2199,24 +2199,13 @@ emit_cond_move (operands, insn)
       operands [3] = tmp;
     }
 
-  /* Catch a special case where 0 or 1 is being loaded into the destination.
-     Since we already have these values in the C bit we can use a special
-     instruction.  */
-  if (zero_and_one (operands [2], operands [3]))
-    {
-      char * dest = reg_names [REGNO (operands [0])];
-      
-      sprintf (buffer, "mvfc %s, cbr", dest);
-
-      /* If the true value was '0' then we need to invert the results of the move.  */
-      if (INTVAL (operands [2]) == 0)
-       sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1",
-                dest, dest);
-      
-      return buffer;
-    }
-
-
+  sprintf (buffer, "mvfc %s, cbr", dest);
+  
+  /* If the true value was '0' then we need to invert the results of the move.  */
+  if (INTVAL (operands [2]) == 0)
+    sprintf (buffer + strlen (buffer), "\n\txor3 %s, %s, #1",
+            dest, dest);
+  
   return buffer;
 }
 
index 5a93d7a15d73930e410a9c093fe61b5515b7c709..3435a177dcd45ce09b9ba681b663c861e28aaa4a 100644 (file)
@@ -434,7 +434,7 @@ if (GET_MODE_CLASS (MODE) == MODE_INT               \
 #define FIXED_REGISTERS \
 { 0, 0, 0, 0, 0, 0, 0, 0,      \
   0, 0, 0, 0, 0, 0, 0, 1,      \
-  1, 0 }
+  1, 1 }
 
 
 /* 1 for registers not available across function calls.
index 3c49e54954df8332233b0a801d268111cc0e661f..5349ca82558ddd3cf79e6d450afdbc5708b70345 100644 (file)
   [(set (match_operand:DI 0 "register_operand" "=r")
        (plus:DI (match_operand:DI 1 "register_operand" "%0")
                 (match_operand:DI 2 "register_operand" "r")))
-   (clobber (reg:CC 17))]
+   (clobber (reg:SI 17))]
   ""
   "#"
   [(set_attr "type" "multi")
 }")
 
 (define_insn "*clear_c"
-  [(set (reg:CC 17)
+  [(set (reg:SI 17)
        (const_int 0))
    (use (match_operand:SI 0 "register_operand" "r"))]
   ""
   [(set (match_operand:SI 0 "register_operand" "=r")
        (plus:SI (match_operand:SI 1 "register_operand" "%0")
                 (plus:SI (match_operand:SI 2 "register_operand" "r")
-                         (reg:CC 17))))
-   (set (reg:CC 17)
+                         (reg:SI 17))))
+   (set (reg:SI 17)
        (unspec [(const_int 0)] 3))]
   ""
   "addx %0,%2"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (minus:DI (match_operand:DI 1 "register_operand" "0")
                  (match_operand:DI 2 "register_operand" "r")))
-   (clobber (reg:CC 17))]
+   (clobber (reg:SI 17))]
   ""
   "#"
   [(set_attr "type" "multi")
   [(set (match_operand:SI 0 "register_operand" "=r")
        (minus:SI (match_operand:SI 1 "register_operand" "%0")
                  (minus:SI (match_operand:SI 2 "register_operand" "r")
-                           (reg:CC 17))))
-   (set (reg:CC 17)
+                           (reg:SI 17))))
+   (set (reg:SI 17)
        (unspec [(const_int 0)] 3))]
   ""
   "subx %0,%2"
 ;; preferred.
 
 (define_expand "cmpsi"
-  [(set (reg:CC 17)
-       (compare:CC (match_operand:SI 0 "register_operand" "")
+  [(set (reg:SI 17)
+       (compare:SI (match_operand:SI 0 "register_operand" "")
                    (match_operand:SI 1 "nonmemory_operand" "")))]
   ""
   "
 ;; is quite inefficient.  However, it is rarely used.
 
 (define_insn "cmp_eqsi_insn"
-  [(set (reg:CC 17)
-       (eq:CC (match_operand:SI 0 "register_operand" "r,r")
+  [(set (reg:SI 17)
+       (eq:SI (match_operand:SI 0 "register_operand" "r,r")
               (match_operand:SI 1 "reg_or_cmp_int16_operand" "r,P")))
    (clobber (match_scratch:SI 2 "=&r,&r"))]
   ""
    (set_attr "length" "8,8")])
 
 (define_insn "cmp_ltsi_insn"
-  [(set (reg:CC 17)
-       (lt:CC (match_operand:SI 0 "register_operand" "r,r")
+  [(set (reg:SI 17)
+       (lt:SI (match_operand:SI 0 "register_operand" "r,r")
               (match_operand:SI 1 "reg_or_int16_operand" "r,J")))]
   ""
   "@
    (set_attr "length" "2,4")])
 
 (define_insn "cmp_ltusi_insn"
-  [(set (reg:CC 17)
-       (ltu:CC (match_operand:SI 0 "register_operand" "r,r")
+  [(set (reg:SI 17)
+       (ltu:SI (match_operand:SI 0 "register_operand" "r,r")
                (match_operand:SI 1 "reg_or_uint16_operand" "r,K")))]
   ""
   "@
   ]
 )
 
-
+(define_insn "movcc_insn"
+  [(set (match_operand:SI 0 "register_operand" "=r")
+       (reg:SI 17))]
+  ""
+  "mvfc %0, cbr"
+  [(set_attr "type" "misc")
+   (set_attr "length" "2")]
+)
 
 \f
 ;; Split up troublesome insns for better scheduling.