This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 128 bit floats on PA64


> Do you have a suggestion about what CLASS_CANNOT_CHANGE_MODE_P should
> look like?  Here is an example of what I get with the existing
> CLASS_CANNOT_CHANGE_MODE_P and 128 bit floats.

The following compiles your test ok.  I have a full bootstrap in
progress.  I'm still not completely happy with the comment but
I think it is more or less explains why we don't want SImode values
changed to a wider mode.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

Index: config/pa/pa-64.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa-64.h,v
retrieving revision 1.10
diff -u -3 -p -r1.10 pa-64.h
--- config/pa/pa-64.h	8 May 2002 23:10:59 -0000	1.10
+++ config/pa/pa-64.h	31 Aug 2002 03:28:14 -0000
@@ -65,10 +65,8 @@ Boston, MA 02111-1307, USA.  */
 #define FLOAT_TYPE_SIZE 32
 #undef DOUBLE_TYPE_SIZE
 #define DOUBLE_TYPE_SIZE 64
-/* This should be 128, but until we work out the ABI for the 128bit
-   FP codes supplied by HP we'll keep it at 64 bits.  */
 #undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE 64
+#define LONG_DOUBLE_TYPE_SIZE 128
 
 /* Temporary until we figure out what to do with those *(&@$ 32bit
    relocs which appear in stabs.  */
Index: config/pa/pa64-regs.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/pa/pa64-regs.h,v
retrieving revision 1.9
diff -u -3 -p -r1.9 pa64-regs.h
--- config/pa/pa64-regs.h	11 Nov 2001 17:45:02 -0000	1.9
+++ config/pa/pa64-regs.h	31 Aug 2002 03:28:14 -0000
@@ -234,16 +234,19 @@ enum reg_class { NO_REGS, R1_REGS, GENER
 
 /* 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.  */
-/* ??? This may not actually be necessary anymore.  But until I can prove
-   otherwise it will stay.  */
+
 #define CLASS_CANNOT_CHANGE_MODE	(FP_REGS)
 
-/* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE.  */
-#define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \
-  (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))
+/* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE.  A SImode
+   value is not zero extended when it is loaded to floating-point register.
+   The default for integral modes narrower than a word is to ZERO_EXTEND.
+   As a result, we don't want SImode values to change to a wider mode
+   when the value is in a floating-point register.  */
+
+#define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO)				\
+  ((FROM) == SImode && GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO))
 
-/* The same information, inverted:
-   Return the class number of the smallest class containing
+/* Return the class number of the smallest class containing
    reg number REGNO.  This could be a conditional expression
    or could index an array.  */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]