[arm] iWMMXt and hardware floating point

Paul Brook paul@codesourcery.com
Fri Apr 21 17:06:00 GMT 2006


GCC doesn't support Arm hardware floating point on iWMMXt CPUs.
This isn't really a problem as such hardware is unlikely to ever exist.
The patch below makes this a hard error, instead of ICEing later on.

Tested with cross to arm-none-eabi.
Applied to mainline and 4.1.

Not strictly a regression, but it's nice to have proper errors when users 
deliberately shoot themselves in the foot.

Paul

2006-04-21  Paul Brook  <paul@codesourcery.com>

gcc/
	* config/arm/arm.c (arm_override_options): Error on iWMMXt and
	hardware floating point.
gcc/testsuite/
	* gcc.dg/arm-vfp1.c: Skip on iWMMXt cpus.

Index: gcc/testsuite/gcc.dg/arm-vfp1.c
===================================================================
--- gcc/testsuite/gcc.dg/arm-vfp1.c	(revision 113136)
+++ gcc/testsuite/gcc.dg/arm-vfp1.c	(working copy)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
 /* { dg-require-effective-target arm32 } */
+/* { dg-skip-if "" { *-*-* } { "-mcpu=iwmmxt" "-march=iwmmxt" } { "" } } */
 
 extern float fabsf (float);
 extern float sqrtf (float);
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 113136)
+++ gcc/config/arm/arm.c	(working copy)
@@ -1279,6 +1279,12 @@ arm_override_options (void)
   if (TARGET_THUMB2 && TARGET_IWMMXT)
     sorry ("Thumb-2 iWMMXt");
 
+  /* FPA and iWMMXt are incompatible because the insn encodings overlap.
+     VFP and iWMMXt can theoretically coexist, but it's unlikely such silicon
+     will ever exist.  GCC makes no attempt to support this combination.  */
+  if (TARGET_IWMMXT && !TARGET_SOFT_FLOAT)
+    sorry ("iWMMXt and hardware floating point");
+
   /* If soft-float is specified then don't use FPU.  */
   if (TARGET_SOFT_FLOAT)
     arm_fpu_arch = FPUTYPE_NONE;



More information about the Gcc-patches mailing list