summaryrefslogtreecommitdiff
path: root/gcc/config/nds32
diff options
context:
space:
mode:
authorjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-13 05:17:54 +0000
committerjasonwucj <jasonwucj@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-13 05:17:54 +0000
commitda2e70a9ce3679a777391dc426b6454106483f60 (patch)
tree7378dca118ac738e565a0f11a6561f0b7b847d0d /gcc/config/nds32
parent8624ddf65be5bbf20a20a3f6692f105c1f35ce09 (diff)
downloadgcc-da2e70a9ce3679a777391dc426b6454106483f60.tar.gz
[NDS32] Add -mcmodel= option to support different code model.
* config/nds32/nds32.opt (mcmodel): Add new option. * config/nds32/nds32-opts.h (nds32_cmodel_type): Add new enum type to describe code model. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219509 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nds32')
-rw-r--r--gcc/config/nds32/nds32-opts.h8
-rw-r--r--gcc/config/nds32/nds32.opt17
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/config/nds32/nds32-opts.h b/gcc/config/nds32/nds32-opts.h
index 3f244874621..1aa0d31dff4 100644
--- a/gcc/config/nds32/nds32-opts.h
+++ b/gcc/config/nds32/nds32-opts.h
@@ -32,4 +32,12 @@ enum nds32_arch_type
ARCH_V3M
};
+/* The code model defines the address generation strategy. */
+enum nds32_cmodel_type
+{
+ CMODEL_SMALL,
+ CMODEL_MEDIUM,
+ CMODEL_LARGE
+};
+
#endif
diff --git a/gcc/config/nds32/nds32.opt b/gcc/config/nds32/nds32.opt
index 53928b57efc..346c9c073f1 100644
--- a/gcc/config/nds32/nds32.opt
+++ b/gcc/config/nds32/nds32.opt
@@ -82,6 +82,23 @@ Enum(nds32_arch_type) String(v3) Value(ARCH_V3)
EnumValue
Enum(nds32_arch_type) String(v3m) Value(ARCH_V3M)
+mcmodel=
+Target RejectNegative Joined Enum(nds32_cmodel_type) Var(nds32_cmodel_option) Init(CMODEL_MEDIUM)
+Specify the address generation strategy for code model.
+
+Enum
+Name(nds32_cmodel_type) Type(enum nds32_cmodel_type)
+Known cmodel types (for use with the -mcmodel= option):
+
+EnumValue
+Enum(nds32_cmodel_type) String(small) Value(CMODEL_SMALL)
+
+EnumValue
+Enum(nds32_cmodel_type) String(medium) Value(CMODEL_MEDIUM)
+
+EnumValue
+Enum(nds32_cmodel_type) String(large) Value(CMODEL_LARGE)
+
mforce-fp-as-gp
Target Report Mask(FORCE_FP_AS_GP)
Prevent $fp being allocated during register allocation so that compiler is able to force performing fp-as-gp optimization.