sh.c (fp_arith_reg_operand): Actually test if reg is suitable for FP arithmetic.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Wed, 10 Mar 1999 11:07:32 +0000 (11:07 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Wed, 10 Mar 1999 11:07:32 +0000 (11:07 +0000)
* sh.c (fp_arith_reg_operand): Actually test if reg is suitable
for FP arithmetic.  Changed caller.
* sh.md (subsf3, subsf_i): Use fp_arith_reg_operand.

From-SVN: r25670

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/config/sh/sh.md

index f69c8304991d551e435705d2c0e320f82213f0bd..93012fe9303f4549d70f2c0091d5ee64e7d7f0b9 100644 (file)
@@ -1,3 +1,9 @@
+Wed Mar 10 19:04:31 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * sh.c (fp_arith_reg_operand): Actually test if reg is suitable
+       for FP arithmetic.  Changed caller.
+       * sh.md (subsf3, subsf_i): Use fp_arith_reg_operand.
+
 Wed Mar 10 18:56:31 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * reload1.c (choose_reload_regs): When inheriting from the frame
index 180cce2b2aa9724e9fe2eacbc5d766fe13f8547c..41c5ac5ecac06c049000f796c2c6cad974576dc3 100644 (file)
@@ -4192,8 +4192,8 @@ fp_arith_reg_operand (op, mode)
       else
        return 1;
 
-      return (regno != T_REG && regno != PR_REG && regno > 15
-             && regno != MACH_REG && regno != MACL_REG);
+      return (regno >= FIRST_PSEUDO_REGISTER
+             || (regno >= FIRST_FP_REG && regno <= LAST_FP_REG));
     }
   return 0;
 }
@@ -4208,7 +4208,21 @@ fp_extended_operand (op, mode)
       op = XEXP (op, 0);
       mode = GET_MODE (op);
     }
-  return fp_arith_reg_operand (op, mode);
+  if (register_operand (op, mode))
+    {
+      int regno;
+
+      if (GET_CODE (op) == REG)
+       regno = REGNO (op);
+      else if (GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == REG)
+       regno = REGNO (SUBREG_REG (op));
+      else
+       return 1;
+
+      return (regno != T_REG && regno != PR_REG && regno > 15
+             && regno != MACH_REG && regno != MACL_REG);
+    }
+  return 0;
 }
 
 /* Returns 1 if OP is a valid source operand for an arithmetic insn.  */
index 8dc823cef765d03c6543617870fa50938a40598d..55c5745b6b12dd669639307e9638e1f4f491230f 100644 (file)
   [(set_attr "type" "fp")])
 
 (define_expand "subsf3"
-  [(match_operand:SF 0 "arith_reg_operand" "")
-   (match_operand:SF 1 "arith_reg_operand" "")
-   (match_operand:SF 2 "arith_reg_operand" "")]
+  [(match_operand:SF 0 "fp_arith_reg_operand" "")
+   (match_operand:SF 1 "fp_arith_reg_operand" "")
+   (match_operand:SF 2 "fp_arith_reg_operand" "")]
   "TARGET_SH3E"
   "{ expand_sf_binop (&gen_subsf3_i, operands); DONE; }")
 
 (define_insn "subsf3_i"
-  [(set (match_operand:SF 0 "arith_reg_operand" "=f")
-       (minus:SF (match_operand:SF 1 "arith_reg_operand" "0")
-                (match_operand:SF 2 "arith_reg_operand" "f")))
+  [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f")
+       (minus:SF (match_operand:SF 1 "fp_arith_reg_operand" "0")
+                (match_operand:SF 2 "fp_arith_reg_operand" "f")))
    (use (match_operand:PSI 3 "fpscr_operand" "c"))]
   "TARGET_SH3E"
   "fsub        %2,%0"