aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m32r/m32r.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/m32r/m32r.h')
-rw-r--r--gcc/config/m32r/m32r.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index f3289d8..77918c3 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -42,14 +42,18 @@ Boston, MA 02111-1307, USA. */
/* M32R/X overrides. */
/* Print subsidiary information on the compiler version in use. */
-#define TARGET_VERSION fprintf (stderr, " (m32r/x)");
+#define TARGET_VERSION fprintf (stderr, " (m32r/x/2)");
/* Additional flags for the preprocessor. */
-#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__} %{m32r:-U__M32RX__}"
+#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__ -D__m32rx__ -U__M32R2__ -U__m32r2__} \
+%{m32r2:-D__M32R2__ -D__m32r2__ -U__M32RX__ -U__m32rx__} \
+%{m32r:-U__M32RX__ -U__m32rx__ -U__M32R2__ -U__m32r2__} \
+ "
+
/* Assembler switches. */
#define ASM_CPU_SPEC \
-"%{m32r} %{m32rx} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts"
+"%{m32r} %{m32rx} %{m32r2} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts"
/* Use m32rx specific crt0/crtinit/crtfini files. */
#define STARTFILE_CPU_SPEC "%{!shared:crt0.o%s} %{m32rx:m32rx/crtinit.o%s} %{!m32rx:crtinit.o%s}"
@@ -58,7 +62,8 @@ Boston, MA 02111-1307, USA. */
/* Extra machine dependent switches. */
#define SUBTARGET_SWITCHES \
{ "32rx", TARGET_M32RX_MASK, "Compile for the m32rx" }, \
- { "32r", -TARGET_M32RX_MASK, "" },
+ { "32r2", TARGET_M32R2_MASK, "Compile for the m32r2" }, \
+ { "32r", -(TARGET_M32RX_MASK+TARGET_M32R2_MASK), "" },
/* Define this macro as a C expression for the initializer of an array of
strings to tell the driver program which options are defaults for this
@@ -223,6 +228,12 @@ extern int target_flags;
#undef TARGET_M32R
#define TARGET_M32R (! TARGET_M32RX)
+/* Support extended instruction set of m32r2. */
+#define TARGET_M32R2_MASK (1 << 6)
+#define TARGET_M32R2 (target_flags & TARGET_M32RX_MASK)
+#undef TARGET_M32R
+#define TARGET_M32R (! TARGET_M32RX && ! TARGET_M32R2)
+
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }