aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2015-01-13 05:32:08 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2015-01-13 05:32:08 +0000
commit77b7a1ca23b82f89ddf3561c5a7ea0cd83983b59 (patch)
tree388a2512cd1dcff6f6c9bf4432d831056248d810 /gcc/config
parentc9eb51a7f76f70476afb4ebebefe1efbc7b2d035 (diff)
downloadgcc-77b7a1ca23b82f89ddf3561c5a7ea0cd83983b59.zip
gcc-77b7a1ca23b82f89ddf3561c5a7ea0cd83983b59.tar.gz
gcc-77b7a1ca23b82f89ddf3561c5a7ea0cd83983b59.tar.bz2
[NDS32] Provide TARGET_CMODEL_[SMALL|MEDIUM|LARGE] to check which code model is specified.
gcc/ * config/nds32/nds32.h (TARGET_CMODEL_SMALL): New macro. (TARGET_CMODEL_MEDIUM): New macro. (TARGET_CMODEL_LARGE): New macro. * config/nds32/nds32.c (nds32_asm_file_start): Display corresponding code model setting in assembly code. From-SVN: r219511
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/nds32/nds32.c10
-rw-r--r--gcc/config/nds32/nds32.h13
2 files changed, 20 insertions, 3 deletions
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index d2ffb61..91e797e 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -2157,6 +2157,13 @@ nds32_asm_file_start (void)
if (TARGET_ISA_V3M)
fprintf (asm_out_file, "\t! ISA family\t\t: %s\n", "V3M");
+ if (TARGET_CMODEL_SMALL)
+ fprintf (asm_out_file, "\t! Code model\t\t: %s\n", "SMALL");
+ if (TARGET_CMODEL_MEDIUM)
+ fprintf (asm_out_file, "\t! Code model\t\t: %s\n", "MEDIUM");
+ if (TARGET_CMODEL_LARGE)
+ fprintf (asm_out_file, "\t! Code model\t\t: %s\n", "LARGE");
+
fprintf (asm_out_file, "\t! Endian setting\t: %s\n",
((TARGET_BIG_ENDIAN) ? "big-endian"
: "little-endian"));
@@ -2178,9 +2185,6 @@ nds32_asm_file_start (void)
fprintf (asm_out_file, "\t! 16-bit instructions\t: %s\n",
((TARGET_16_BIT) ? "Yes"
: "No"));
- fprintf (asm_out_file, "\t! GP base access\t: %s\n",
- ((TARGET_GP_DIRECT) ? "Yes"
- : "No"));
fprintf (asm_out_file, "\t! Reduced registers set\t: %s\n",
((TARGET_REDUCED_REGS) ? "Yes"
: "No"));
diff --git a/gcc/config/nds32/nds32.h b/gcc/config/nds32/nds32.h
index d9a55ad..ac6cf42 100644
--- a/gcc/config/nds32/nds32.h
+++ b/gcc/config/nds32/nds32.h
@@ -344,6 +344,19 @@ enum nds32_builtins
#define TARGET_ISA_V3 (nds32_arch_option == ARCH_V3)
#define TARGET_ISA_V3M (nds32_arch_option == ARCH_V3M)
+#define TARGET_CMODEL_SMALL \
+ (nds32_cmodel_option == CMODEL_SMALL)
+#define TARGET_CMODEL_MEDIUM \
+ (nds32_cmodel_option == CMODEL_MEDIUM)
+#define TARGET_CMODEL_LARGE \
+ (nds32_cmodel_option == CMODEL_LARGE)
+
+/* When -mcmodel=small or -mcmodel=medium,
+ compiler may generate gp-base instruction directly. */
+#define TARGET_GP_DIRECT \
+ (nds32_cmodel_option == CMODEL_SMALL\
+ || nds32_cmodel_option == CMODEL_MEDIUM)
+
#define TARGET_SOFT_FLOAT 1
#define TARGET_HARD_FLOAT 0