From fe4c07dc48d92369c030a216831fe6aff8b860bd Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Tue, 13 Jan 2015 05:17:54 +0000 Subject: [PATCH] [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. From-SVN: r219509 --- gcc/ChangeLog | 6 ++++++ gcc/config/nds32/nds32-opts.h | 8 ++++++++ gcc/config/nds32/nds32.opt | 17 +++++++++++++++++ 3 files changed, 31 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8b86f54573d..c585d0d518b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-13 Chung-Ju Wu + + * config/nds32/nds32.opt (mcmodel): Add new option. + * config/nds32/nds32-opts.h (nds32_cmodel_type): Add new enum type + to describe code model. + 2015-01-13 Oleg Endo PR target/64479 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. -- 2.30.2