sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA...
authorRichard Sandiford <rsandifo@redhat.com>
Tue, 28 Jan 2003 12:45:12 +0000 (12:45 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 28 Jan 2003 12:45:12 +0000 (12:45 +0000)
* config/sh/sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA, and the given
class contains a floating-point register, return the size of the
mode in half words.

From-SVN: r61966

gcc/ChangeLog
gcc/config/sh/sh.h

index 48b1e2af80d13342229f26d5ee54b629a8aa96b4..2fcc66f83cc60b4bd064769a905c8dd57079cffa 100644 (file)
@@ -1,3 +1,9 @@
+2003-01-28  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/sh/sh.h (CLASS_MAX_NREGS): If TARGET_SHMEDIA, and the given
+       class contains a floating-point register, return the size of the
+       mode in half words.
+
 Tue Jan 28 12:15:13 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (ix86_carry_flag_operator):  New predicate.
index 7213933ad367316e35acb6b3ea991b7961d50c0f..e5d0677ed60e787331680726234a57c6ffa126dd 100644 (file)
@@ -1382,9 +1382,13 @@ extern enum reg_class reg_class_from_letter[];
 /* Return the maximum number of consecutive registers
    needed to represent mode MODE in a register of class CLASS.
 
-   On SH this is the size of MODE in words.  */
+   If TARGET_SHMEDIA, we need two FP registers per word.
+   Otherwise we will need at most one register per word.  */
 #define CLASS_MAX_NREGS(CLASS, MODE) \
-     ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+    (TARGET_SHMEDIA \
+     && TEST_HARD_REG_BIT (reg_class_contents[CLASS], FIRST_FP_REG) \
+     ? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD/2 - 1) / (UNITS_PER_WORD/2) \
+     : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
 /* If defined, gives a class of registers that cannot be used as the
    operand of a SUBREG that changes the mode of the object illegally.  */