This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Add a builtin define for when the floating point registersare not available
Hi Aldy,
You are right of course. Further testing of the patch showed me that I
needed this anyway, so imagine if you will that I had submitted the
patch with an identical change to gcc/config/rs6000/linux.h. :-)
How about you put it in rs6000_override_options, and only do it once?
Good idea, although I think that maybe rs6000_cpu_cpp_builtins() might
be a better place, so what do you think of this alternative patch ?
Cheers
Nick
gcc/ChangeLog
2005-05-23 Nick Clifton <nickc@redhat.com>
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
__NO_FPRS__ when 'f' class registers will not be available.
Index: gcc/config/rs6000/rs6000-c.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000-c.c,v
retrieving revision 1.17
diff -c -3 -p -r1.17 rs6000-c.c
*** gcc/config/rs6000/rs6000-c.c 2 May 2005 16:02:44 -0000 1.17
--- gcc/config/rs6000/rs6000-c.c 23 May 2005 08:33:55 -0000
*************** rs6000_cpu_cpp_builtins (cpp_reader *pfi
*** 140,145 ****
--- 140,149 ----
break;
}
+ /* Let the compiled code know if 'f' class registers will not be
available. */
+ if (TARGET_SOFT_FLOAT || !TARGET_FPRS)
+ builtin_define ("__NO_FPRS__");
+
targetm.resolve_overloaded_builtin =
altivec_resolve_overloaded_builtin;
}