[llvm-commits] [llvm-gcc-4.2] r110837 - in /llvm-gcc-4.2/trunk/gcc/config/arm: arm-cores.def arm.c arm.h darwin.h
Jim Grosbach
grosbach at apple.com
Wed Aug 11 11:22:46 PDT 2010
Author: grosbach
Date: Wed Aug 11 13:22:46 2010
New Revision: 110837
URL: http://llvm.org/viewvc/llvm-project?rev=110837&view=rev
Log:
pass along reasonable cortex-m0 processor options to the back end.
Modified:
llvm-gcc-4.2/trunk/gcc/config/arm/arm-cores.def
llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm-cores.def
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm-cores.def?rev=110837&r1=110836&r2=110837&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm-cores.def (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm-cores.def Wed Aug 11 13:22:46 2010
@@ -123,8 +123,9 @@
ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, 9e)
/* LLVM LOCAL begin */
ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, 9e)
-/* LLVM LOCAL end */
ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, 9e)
ARM_CORE("cortex-m3", cortexm3, 7M, FL_LDSCHED, 9e)
ARM_CORE("cortex-m4", cortexm4, 7M, FL_LDSCHED, 9e)
+ARM_CORE("cortex-m0", cortexm0, 6M, FL_LDSCHED, 9e)
+/* LLVM LOCAL end */
/* APPLE LOCAL end v7 support. Merge from mainline */
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.c?rev=110837&r1=110836&r2=110837&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.c (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.c Wed Aug 11 13:22:46 2010
@@ -645,6 +645,8 @@
#define FL_FOR_ARCH7A (FL_FOR_ARCH7 | FL_NOTM | FL_NEON)
#define FL_FOR_ARCH7R (FL_FOR_ARCH7A | FL_DIV)
#define FL_FOR_ARCH7M (FL_FOR_ARCH7 | FL_DIV)
+/* LLVM LOCAL processor support */
+#define FL_FOR_ARCH6M (FL_FOR_ARCH6 &~ FL_NOTM)
/* APPLE LOCAL end v7 support. Merge from mainline */
/* The bits in this mask specify which
@@ -679,6 +681,9 @@
/* Nonzero if this chip supports the ARM 6K extensions. */
int arm_arch6k = 0;
+/* Nonzero if this chip supports the ARM 6M extensions. */
+int arm_arch6m = 0;
+
/* APPLE LOCAL begin 6093388 -mfpu=neon default for v7a */
/* Nonzero if this chip supports the ARM 7A extensions. */
int arm_arch7a = 0;
@@ -834,10 +839,14 @@
{"armv5tej",arm926ejs, "5TEJ",FL_CO_PROC | FL_FOR_ARCH5TEJ, NULL},
{"xscale", xscale, "5TE", FL_CO_PROC | FL_XSCALE | FL_FOR_ARCH5TE, NULL},
{"armv6", arm1136jfs, "6", FL_CO_PROC | FL_FOR_ARCH6, NULL},
+ /* LLVM LOCAL processor support */
+ {"armv6m", cortexm0, "6M", FL_CO_PROC | FL_FOR_ARCH6M, NULL},
{"armv6j", arm1136js, "6J", FL_CO_PROC | FL_FOR_ARCH6J, NULL},
{"armv6k", arm1136jfs, "6K", FL_CO_PROC | FL_FOR_ARCH6K, NULL},
#else
{"armv6", arm1136js, "6", FL_CO_PROC | FL_FOR_ARCH6, NULL},
+ /* LLVM LOCAL processor support */
+ {"armv6m", cortexm0, "6M", FL_CO_PROC | FL_FOR_ARCH6M, NULL},
{"armv6j", arm1136js, "6J", FL_CO_PROC | FL_FOR_ARCH6J, NULL},
{"armv6k", mpcore, "6K", FL_CO_PROC | FL_FOR_ARCH6K, NULL},
#endif
@@ -848,18 +857,24 @@
{"armv6t2", arm1156t2s, "6T2", FL_CO_PROC | FL_FOR_ARCH6T2, NULL},
{"armv7", cortexa8, "7", FL_CO_PROC | FL_FOR_ARCH7, NULL},
{"armv7a", cortexa8, "7A", FL_CO_PROC | FL_FOR_ARCH7A, NULL},
+ /* LLVM LOCAL begin processor support */
{"armv7m", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
{"armv7m3", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
- {"armv7m4", cortexm4, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
+ {"armv7m4", cortexm4, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
+ {"armv6m0", cortexm0, "6M", FL_CO_PROC | FL_FOR_ARCH6M, NULL},
+ /* LLVM LOCAL end processor support */
/* APPLE LOCAL begin v7 support. Merge from Codesourcery */
{"armv7r", cortexr4, "7R", FL_CO_PROC | FL_FOR_ARCH7R, NULL},
{"armv7m", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
/* APPLE LOCAL end v7 support. Merge from Codesourcery */
{"armv7-a", cortexa8, "7A", FL_CO_PROC | FL_FOR_ARCH7A, NULL},
{"armv7-r", cortexr4, "7R", FL_CO_PROC | FL_FOR_ARCH7R, NULL},
+ /* LLVM LOCAL begin processor support */
{"armv7-m", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
{"armv7-m3", cortexm3, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
{"armv7-m4", cortexm4, "7M", FL_CO_PROC | FL_FOR_ARCH7M, NULL},
+ {"armv6-m0", cortexm0, "6M", FL_CO_PROC | FL_FOR_ARCH6M, NULL},
+ /* LLVM LOCAL end processor support */
/* APPLE LOCAL end v7 support. Merge from mainline */
{"ep9312", ep9312, "4T", FL_LDSCHED | FL_CIRRUS | FL_FOR_ARCH4, NULL},
{"iwmmxt", iwmmxt, "5TE", FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT , NULL},
@@ -1456,10 +1471,12 @@
targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs;
/* LLVM LOCAL begin */
- /* v7m processors don't have ARM mode, so default to thumb mode.
+ /* v7m and v6m processors don't have ARM mode, so default to thumb mode.
Explicitly only set for default so we can error if the user
sets -marm or -mno-thumb. */
- if ((insn_flags & FL_FOR_ARCH7M) == FL_FOR_ARCH7M && thumb_option < 0)
+ if (((insn_flags & FL_FOR_ARCH7M) == FL_FOR_ARCH7M
+ || (insn_flags & FL_FOR_ARCH6M) == FL_FOR_ARCH6M)
+ && thumb_option < 0)
thumb_option = 1;
/* LLVM LOCAL end */
@@ -1569,6 +1586,8 @@
arm_arch7a = (insn_flags & FL_FOR_ARCH7A) == FL_FOR_ARCH7A;
/* APPLE LOCAL begin v7 support. Merge from mainline */
arm_arch7m = (insn_flags & FL_FOR_ARCH7M) == FL_FOR_ARCH7M;
+ /* LLVM LOCAL processor support */
+ arm_arch6m = (insn_flags & FL_FOR_ARCH6M) == FL_FOR_ARCH6M;
arm_arch_notm = (insn_flags & FL_NOTM) != 0;
arm_arch_thumb2 = (insn_flags & FL_THUMB2) != 0;
/* APPLE LOCAL end v7 support. Merge from mainline */
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/arm.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/arm.h?rev=110837&r1=110836&r2=110837&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/arm.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/arm.h Wed Aug 11 13:22:46 2010
@@ -449,6 +449,9 @@
/* Nonzero if this chip supports the ARM Architecture 6 extensions. */
extern int arm_arch6;
+/* LLVM LOCAL Declare arm_arch6m for use when setting the target triple. */
+extern int arm_arch6m;
+
/* LLVM LOCAL Declare arm_arch7m for use when setting the target triple. */
extern int arm_arch7m;
@@ -3498,6 +3501,7 @@
case cortexr4: F.setCPU("cortex-r4"); break; \
case cortexm3: F.setCPU("cortex-m3"); break; \
case cortexm4: F.setCPU("cortex-m4"); break; \
+ case cortexm0: F.setCPU("cortex-m0"); break; \
default: \
F.setCPU("arm7tdmi"); \
break; \
@@ -3533,14 +3537,16 @@
? "thumbv7m" \
: (arm_arch_thumb2 \
? "thumbv6t2" \
- : (arm_arch6 \
- ? "thumbv6" \
- : (arm_arch5e \
- ? "thumbv5e" \
- : (arm_arch5 \
- ? "thumbv5" \
- : (arm_arch4t \
- ? "thumbv4t" : ""))))))) \
+ : (arm_arch6m \
+ ? "thumbv6m" \
+ : (arm_arch6 \
+ ? "thumbv6" \
+ : (arm_arch5e \
+ ? "thumbv5e" \
+ : (arm_arch5 \
+ ? "thumbv5" \
+ : (arm_arch4t \
+ ? "thumbv4t" : "")))))))) \
: (arm_arch7a \
? "armv7" \
: (arm_arch_thumb2 \
Modified: llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h?rev=110837&r1=110836&r2=110837&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/arm/darwin.h Wed Aug 11 13:22:46 2010
@@ -328,8 +328,10 @@
#define SUBTARGET_ASM_DECLARE_FUNCTION_NAME ARM_DECLARE_FUNCTION_NAME
/* APPLE LOCAL begin 6093388 -mfpu=neon default for v7a */
-/* We default to VFP for v6, NEON for v7 */
-#define FPUTYPE_DEFAULT (arm_arch7a ? "neon" : "vfp")
+/* We default to VFP for v6, NEON for v7. */
+#define FPUTYPE_DEFAULT (arm_arch7a ? "neon" : \
+ ((arm_tune == cortexm3 || arm_tune == cortexm0) ? \
+ "fpe2" : "vfp"))
#undef TARGET_DEFAULT_FLOAT_ABI
#define TARGET_DEFAULT_FLOAT_ABI ((arm_arch6 || arm_arch7a) ? ARM_FLOAT_ABI_SOFTFP : ARM_FLOAT_ABI_SOFT)
More information about the llvm-commits
mailing list