GAS PATCH ARM: Fix the floating point flavour for Linux and NetBSD

Richard Earnshaw rearnsha@arm.com
Fri Jun 13 15:24:00 GMT 2003


Both Linux and NetBSD mandate a particular floating point architecture as 
part of their ABI.  Having gas select a different one because the user 
wants better performance on a particular CPU is incorrect.  This patch 
makes gas respect the OS ABI preference over the -mcpu option.  It's still 
possible to force a different floating point format with -mfpu=...

R.

2003-06-13  Richard Earnshaw  <rearnsha@arm.com>

	* tc-arm.c (FPU_DEFAULT, case TE_LINUX): Default to FPU_ARCH_FPA.
	(FPU_DEFAULT, case TE_NetBSD): Default to FPU_ARCH_VFP for ELF,
	FPU_ARCH_FPA for AOUT.
	(md_begin): Don't try to guess the floating point architecture from
	the CPU if the OS ABI (Linux, NetBSD) mandates a particular form.


-------------- next part --------------
Index: tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.141
diff -p -r1.141 tc-arm.c
*** tc-arm.c	21 May 2003 12:07:55 -0000	1.141
--- tc-arm.c	12 Jun 2003 17:05:15 -0000
***************
*** 134,139 ****
--- 134,152 ----
  #endif
  #endif
  
+ #ifdef TE_LINUX
+ #define FPU_DEFAULT FPU_ARCH_FPA
+ #endif
+ 
+ #ifdef TE_NetBSD
+ #ifdef OBJ_ELF
+ #define FPU_DEFAULT FPU_ARCH_VFP	/* Soft-float, but VFP order.  */
+ #else
+ /* Legacy a.out format.  */
+ #define FPU_DEFAULT FPU_ARCH_FPA	/* Soft-float, but FPA order.  */
+ #endif
+ #endif
+ 
  /* For backwards compatibility we default to the FPA.  */
  #ifndef FPU_DEFAULT
  #define FPU_DEFAULT FPU_ARCH_FPA
*************** md_begin ()
*** 10183,10192 ****
--- 10196,10211 ----
      }
    else if (mfpu_opt == -1)
      {
+ #if !(defined (TE_LINUX) || defined (TE_NetBSD))
+       /* Some environments specify a default FPU.  If they don't, infer it
+ 	 from the processor.  */
        if (mcpu_fpu_opt != -1)
  	mfpu_opt = mcpu_fpu_opt;
        else
  	mfpu_opt = march_fpu_opt;
+ #else
+       mfpu_opt = FPU_DEFAULT;
+ #endif
      }
  
    if (mfpu_opt == -1)


More information about the Binutils mailing list