[ColdFire 14/63] Make "long double" the same as "double" on ColdFire

Richard Sandiford richard@codesourcery.com
Thu Jan 18 18:46:00 GMT 2007


Jeffrey Law <law@redhat.com> writes:
> On Thu, 2007-01-11 at 10:51 +0000, Nathan Sidwell wrote:
>
>> Just so we're all on the same page, do you still want the long double change 
>> held back -- just so you know, 'to table' has opposite meanings in American and 
>> British English, I'm guessing you're using the American meaning :)
>> 
>> The original, rather short, thread discussing the long double change is 
>> http://gcc.gnu.org/ml/gcc/2005-12/msg00221.html.
> No need to hold it back if there's never been an XFmode emulation
> library for the coldfire.  Though we should still document the
> ABI change.

Thanks.  For the record, here's the patch I applied.  It restores
the 80-bit long double for the new uclinuxoldabi configuration,
but it's otherwise unchanged.  I've queued the changes.html text
until the entire patch series is in; I'll post a single documentation
patch then.

Richard


gcc/
200x-xx-xx  Julian Brown  <julian@codesourcery.com>
	    Richard Sandiford  <richard@codesourcery.com>

	* config/m68k/m68k.h (LONG_DOUBLE_TYPE_SIZE): Make 64-bit on ColdFire.
	(LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Likewise.
	* config/m68k/netbsd-elf.h (LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Undefine
	before redefining.
	* config/m68k/uclinux-oldabi.h (LONG_DOUBLE_TYPE_SIZE): Redefine to
	80 unconditionally.
	(LIBGCC2_LONG_DOUBLE_TYPE_SIZE): Likewise.

Index: gcc/config/m68k/m68k.h
===================================================================
--- gcc/config/m68k/m68k.h	2007-01-09 15:01:54.000000000 +0000
+++ gcc/config/m68k/m68k.h	2007-01-09 15:01:56.000000000 +0000
@@ -259,7 +259,17 @@ #define SUBTARGET_OVERRIDE_OPTIONS
 
 /* target machine storage layout */
 
-#define LONG_DOUBLE_TYPE_SIZE 80
+/* "long double" is the same as "double" on ColdFire targets.  */
+
+#define LONG_DOUBLE_TYPE_SIZE (TARGET_COLDFIRE ? 64 : 80)
+
+/* We need to know the size of long double at compile-time in libgcc2.  */
+
+#ifdef __mcoldfire__
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
+#else
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
+#endif
 
 /* Set the value of FLT_EVAL_METHOD in float.h.  When using 68040 fp
    instructions, we get proper intermediate rounding, otherwise we
Index: gcc/config/m68k/netbsd-elf.h
===================================================================
--- gcc/config/m68k/netbsd-elf.h	2007-01-09 15:01:51.000000000 +0000
+++ gcc/config/m68k/netbsd-elf.h	2007-01-09 15:01:56.000000000 +0000
@@ -40,6 +40,7 @@ #define TARGET_OS_CPP_BUILTINS()		\
 #undef LONG_DOUBLE_TYPE_SIZE
 #define LONG_DOUBLE_TYPE_SIZE (TARGET_68020 ? 80 : 64)
 
+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
 #ifdef __mc68010__
 #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
 #else
Index: gcc/config/m68k/uclinux-oldabi.h
===================================================================
--- gcc/config/m68k/uclinux-oldabi.h	(revision 120909)
+++ gcc/config/m68k/uclinux-oldabi.h	(working copy)
@@ -22,6 +22,12 @@ the Free Software Foundation; either ver
 Boston, MA 02110-1301, USA.  */
 
 
+/* The old uClinux ABI used 80-byte "long double"s for ColdFire too.  */
+#undef LONG_DOUBLE_TYPE_SIZE
+#define LONG_DOUBLE_TYPE_SIZE 80
+#undef LIBGCC2_LONG_DOUBLE_TYPE_SIZE
+#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
+
 /* Undo the definition of STARTFILE_SPEC from m68kelf.h so we'll
    pick the default from gcc.c (just link crt0.o from multilib dir).  */
 #undef	STARTFILE_SPEC



More information about the Gcc-patches mailing list