aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/msp430
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-06-16 14:27:59 +0000
committerNick Clifton <nickc@gcc.gnu.org>2016-06-16 14:27:59 +0000
commitb07447ba5e2764c5a59c0e40fff91bea0e9f3114 (patch)
tree31e15702b399aaec20fe61eb6a5ae56e1dff63e6 /gcc/config/msp430
parent33ac58d5299c7eba6be3c112817fe917bed48043 (diff)
downloadgcc-b07447ba5e2764c5a59c0e40fff91bea0e9f3114.zip
gcc-b07447ba5e2764c5a59c0e40fff91bea0e9f3114.tar.gz
gcc-b07447ba5e2764c5a59c0e40fff91bea0e9f3114.tar.bz2
msp430-opts.h (msp430_hwmult_types): Add MSP430_HWMULT_ prefix to enum values.
* config/msp430/msp430-opts.h (msp430_hwmult_types): Add MSP430_HWMULT_ prefix to enum values. (msp430_regions): Add MSP430_REGION_ prefix to enum values. * config/msp430/msp430.c: Update use of enum values. * config/msp430/msp430.md: Likewise. * config/msp430/msp430.opt: Likewise. From-SVN: r237529
Diffstat (limited to 'gcc/config/msp430')
-rw-r--r--gcc/config/msp430/msp430-opts.h18
-rw-r--r--gcc/config/msp430/msp430.c61
-rw-r--r--gcc/config/msp430/msp430.md8
-rw-r--r--gcc/config/msp430/msp430.opt24
4 files changed, 56 insertions, 55 deletions
diff --git a/gcc/config/msp430/msp430-opts.h b/gcc/config/msp430/msp430-opts.h
index d009d10..98baee1 100644
--- a/gcc/config/msp430/msp430-opts.h
+++ b/gcc/config/msp430/msp430-opts.h
@@ -22,19 +22,19 @@
enum msp430_hwmult_types
{
- NONE,
- AUTO,
- SMALL,
- LARGE,
- F5SERIES
+ MSP430_HWMULT_NONE,
+ MSP430_HWMULT_AUTO,
+ MSP430_HWMULT_SMALL,
+ MSP430_HWMULT_LARGE,
+ MSP430_HWMULT_F5SERIES
};
enum msp430_regions
{
- ANY,
- EITHER,
- LOWER,
- UPPER
+ MSP430_REGION_ANY,
+ MSP430_REGION_EITHER,
+ MSP430_REGION_LOWER,
+ MSP430_REGION_UPPER
};
#endif
diff --git a/gcc/config/msp430/msp430.c b/gcc/config/msp430/msp430.c
index 65d5767..dba4d19 100644
--- a/gcc/config/msp430/msp430.c
+++ b/gcc/config/msp430/msp430.c
@@ -777,20 +777,21 @@ msp430_option_override (void)
target_mcu, xisa ? "430X" : "430", msp430x ? "430X" : "430");
if (msp430_mcu_data[i].hwmpy == 0
- && msp430_hwmult_type != AUTO
- && msp430_hwmult_type != NONE)
+ && msp430_hwmult_type != MSP430_HWMULT_AUTO
+ && msp430_hwmult_type != MSP430_HWMULT_NONE)
warning (0, "MCU '%s' does not have hardware multiply support, but -mhwmult is set to %s",
target_mcu,
- msp430_hwmult_type == SMALL ? "16-bit" : msp430_hwmult_type == LARGE ? "32-bit" : "f5series");
- else if (msp430_hwmult_type == SMALL
+ msp430_hwmult_type == MSP430_HWMULT_SMALL ? "16-bit"
+ : msp430_hwmult_type == MSP430_HWMULT_LARGE ? "32-bit" : "f5series");
+ else if (msp430_hwmult_type == MSP430_HWMULT_SMALL
&& msp430_mcu_data[i].hwmpy != 1
&& msp430_mcu_data[i].hwmpy != 2 )
warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to 16-bit",
target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
- else if (msp430_hwmult_type == LARGE && msp430_mcu_data[i].hwmpy != 4)
+ else if (msp430_hwmult_type == MSP430_HWMULT_LARGE && msp430_mcu_data[i].hwmpy != 4)
warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to 32-bit",
target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
- else if (msp430_hwmult_type == F5SERIES && msp430_mcu_data[i].hwmpy != 8)
+ else if (msp430_hwmult_type == MSP430_HWMULT_F5SERIES && msp430_mcu_data[i].hwmpy != 8)
warning (0, "MCU '%s' supports %s hardware multiply, but -mhwmult is set to f5series",
target_mcu, hwmult_name (msp430_mcu_data[i].hwmpy));
}
@@ -801,7 +802,7 @@ msp430_option_override (void)
if (i < 0)
{
- if (msp430_hwmult_type == AUTO)
+ if (msp430_hwmult_type == MSP430_HWMULT_AUTO)
{
if (msp430_warn_mcu)
{
@@ -815,7 +816,7 @@ msp430_option_override (void)
target_mcu);
}
- msp430_hwmult_type = NONE;
+ msp430_hwmult_type = MSP430_HWMULT_NONE;
}
else if (target_cpu == NULL)
{
@@ -833,15 +834,15 @@ msp430_option_override (void)
}
/* The F5 series are all able to support the 430X ISA. */
- if (target_cpu == NULL && target_mcu == NULL && msp430_hwmult_type == F5SERIES)
+ if (target_cpu == NULL && target_mcu == NULL && msp430_hwmult_type == MSP430_HWMULT_F5SERIES)
msp430x = true;
if (TARGET_LARGE && !msp430x)
error ("-mlarge requires a 430X-compatible -mmcu=");
- if (msp430_code_region == UPPER && ! msp430x)
+ if (msp430_code_region == MSP430_REGION_UPPER && ! msp430x)
error ("-mcode-region=upper requires 430X-compatible cpu");
- if (msp430_data_region == UPPER && ! msp430x)
+ if (msp430_data_region == MSP430_REGION_UPPER && ! msp430x)
error ("-mdata-region=upper requires 430X-compatible cpu");
if (flag_exceptions || flag_non_call_exceptions
@@ -2166,24 +2167,24 @@ gen_prefix (tree decl)
if (TREE_CODE (decl) == FUNCTION_DECL)
{
- if (msp430_code_region == LOWER)
+ if (msp430_code_region == MSP430_REGION_LOWER)
return lower_prefix;
- if (msp430_code_region == UPPER)
+ if (msp430_code_region == MSP430_REGION_UPPER)
return upper_prefix;
- if (msp430_code_region == EITHER)
+ if (msp430_code_region == MSP430_REGION_EITHER)
return either_prefix;
}
else
{
- if (msp430_data_region == LOWER)
+ if (msp430_data_region == MSP430_REGION_LOWER)
return lower_prefix;
- if (msp430_data_region == UPPER)
+ if (msp430_data_region == MSP430_REGION_UPPER)
return upper_prefix;
- if (msp430_data_region == EITHER)
+ if (msp430_data_region == MSP430_REGION_EITHER)
return either_prefix;
}
@@ -2354,7 +2355,7 @@ msp430_output_aligned_decl_common (FILE * stream,
unsigned HOST_WIDE_INT size,
unsigned int align)
{
- if (msp430_data_region == ANY)
+ if (msp430_data_region == MSP430_REGION_ANY)
{
fprintf (stream, COMMON_ASM_OP);
assemble_name (stream, name);
@@ -2370,9 +2371,9 @@ msp430_output_aligned_decl_common (FILE * stream,
else
switch (msp430_data_region)
{
- case UPPER: sec = get_named_section (NULL, ".upper.bss", 0); break;
- case LOWER: sec = get_named_section (NULL, ".lower.bss", 0); break;
- case EITHER: sec = get_named_section (NULL, ".either.bss", 0); break;
+ case MSP430_REGION_UPPER: sec = get_named_section (NULL, ".upper.bss", 0); break;
+ case MSP430_REGION_LOWER: sec = get_named_section (NULL, ".lower.bss", 0); break;
+ case MSP430_REGION_EITHER: sec = get_named_section (NULL, ".either.bss", 0); break;
default:
gcc_unreachable ();
}
@@ -2396,8 +2397,8 @@ msp430_do_not_relax_short_jumps (void)
short jumps when there is a chance that the instructions will end up in a low
section. */
return
- msp430_code_region == EITHER
- || msp430_code_region == LOWER
+ msp430_code_region == MSP430_REGION_EITHER
+ || msp430_code_region == MSP430_REGION_LOWER
|| has_attr (ATTR_EITHER, current_function_decl)
|| has_attr (ATTR_LOWER, current_function_decl);
}
@@ -3204,10 +3205,10 @@ msp430_use_f5_series_hwmult (void)
static const char * cached_match = NULL;
static bool cached_result;
- if (msp430_hwmult_type == F5SERIES)
+ if (msp430_hwmult_type == MSP430_HWMULT_F5SERIES)
return true;
- if (target_mcu == NULL || msp430_hwmult_type != AUTO)
+ if (target_mcu == NULL || msp430_hwmult_type != MSP430_HWMULT_AUTO)
return false;
if (target_mcu == cached_match)
@@ -3242,10 +3243,10 @@ use_32bit_hwmult (void)
static bool cached_result;
int i;
- if (msp430_hwmult_type == LARGE)
+ if (msp430_hwmult_type == MSP430_HWMULT_LARGE)
return true;
- if (target_mcu == NULL || msp430_hwmult_type != AUTO)
+ if (target_mcu == NULL || msp430_hwmult_type != MSP430_HWMULT_AUTO)
return false;
if (target_mcu == cached_match)
@@ -3271,10 +3272,10 @@ msp430_no_hwmult (void)
static bool cached_result;
int i;
- if (msp430_hwmult_type == NONE)
+ if (msp430_hwmult_type == MSP430_HWMULT_NONE)
return true;
- if (msp430_hwmult_type != AUTO)
+ if (msp430_hwmult_type != MSP430_HWMULT_AUTO)
return false;
if (target_mcu == NULL)
@@ -3312,7 +3313,7 @@ msp430_output_labelref (FILE *file, const char *name)
/* If we have been given a specific MCU name then we may be
able to make use of its hardware multiply capabilities. */
- if (msp430_hwmult_type != NONE)
+ if (msp430_hwmult_type != MSP430_HWMULT_NONE)
{
if (strcmp ("__mspabi_mpyi", name) == 0)
{
diff --git a/gcc/config/msp430/msp430.md b/gcc/config/msp430/msp430.md
index 3a3fbf1..bdec202 100644
--- a/gcc/config/msp430/msp430.md
+++ b/gcc/config/msp430/msp430.md
@@ -1510,7 +1510,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI (sign_extend:SI (match_operand:HI 1 "register_operand" "%0"))
(sign_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
- "optimize > 2 && msp430_hwmult_type != NONE"
+ "optimize > 2 && msp430_hwmult_type != MSP430_HWMULT_NONE"
"*
if (msp430_use_f5_series_hwmult ())
return \"PUSH.W sr { DINT { NOP { MOV.W %1, &0x04C2 { MOV.W %2, &0x04C8 { MOV.W &0x04CA, %L0 { MOV.W &0x04CC, %H0 { POP.W sr\";
@@ -1523,7 +1523,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "%0"))
(zero_extend:SI (match_operand:HI 2 "register_operand" "r"))))]
- "optimize > 2 && msp430_hwmult_type != NONE"
+ "optimize > 2 && msp430_hwmult_type != MSP430_HWMULT_NONE"
"*
if (msp430_use_f5_series_hwmult ())
return \"PUSH.W sr { DINT { NOP { MOV.W %1, &0x04C0 { MOV.W %2, &0x04C8 { MOV.W &0x04CA, %L0 { MOV.W &0x04CC, %H0 { POP.W sr\";
@@ -1536,7 +1536,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(sign_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
- "optimize > 2 && msp430_hwmult_type != NONE"
+ "optimize > 2 && msp430_hwmult_type != MSP430_HWMULT_NONE"
"*
if (msp430_use_f5_series_hwmult ())
return \"PUSH.W sr { DINT { NOP { MOV.W %L1, &0x04D4 { MOV.W %H1, &0x04D6 { MOV.W %L2, &0x04E0 { MOV.W %H2, &0x04E2 { MOV.W &0x04E4, %A0 { MOV.W &0x04E6, %B0 { MOV.W &0x04E8, %C0 { MOV.W &0x04EA, %D0 { POP.W sr\";
@@ -1549,7 +1549,7 @@
[(set (match_operand:DI 0 "register_operand" "=r")
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
(zero_extend:DI (match_operand:SI 2 "register_operand" "r"))))]
- "optimize > 2 && msp430_hwmult_type != NONE"
+ "optimize > 2 && msp430_hwmult_type != MSP430_HWMULT_NONE"
"*
if (msp430_use_f5_series_hwmult ())
return \"PUSH.W sr { DINT { NOP { MOV.W %L1, &0x04D0 { MOV.W %H1, &0x04D2 { MOV.W %L2, &0x04E0 { MOV.W %H2, &0x04E2 { MOV.W &0x04E4, %A0 { MOV.W &0x04E6, %B0 { MOV.W &0x04E8, %C0 { MOV.W &0x04EA, %D0 { POP.W sr\";
diff --git a/gcc/config/msp430/msp430.opt b/gcc/config/msp430/msp430.opt
index 51e38f5..bc42723 100644
--- a/gcc/config/msp430/msp430.opt
+++ b/gcc/config/msp430/msp430.opt
@@ -41,49 +41,49 @@ HeaderInclude
config/msp430/msp430-opts.h
mhwmult=
-Target Joined RejectNegative Report ToLower Var(msp430_hwmult_type) Enum(msp430_hwmult_types) Init(AUTO)
+Target Joined RejectNegative Report ToLower Var(msp430_hwmult_type) Enum(msp430_hwmult_types) Init(MSP430_HWMULT_AUTO)
Specify the type of hardware multiply to support.
Enum
Name(msp430_hwmult_types) Type(enum msp430_hwmult_types)
EnumValue
-Enum(msp430_hwmult_types) String(none) Value(NONE)
+Enum(msp430_hwmult_types) String(none) Value(MSP430_HWMULT_NONE)
EnumValue
-Enum(msp430_hwmult_types) String(auto) Value(AUTO)
+Enum(msp430_hwmult_types) String(auto) Value(MSP430_HWMULT_AUTO)
EnumValue
-Enum(msp430_hwmult_types) String(16bit) Value(SMALL)
+Enum(msp430_hwmult_types) String(16bit) Value(MSP430_HWMULT_SMALL)
EnumValue
-Enum(msp430_hwmult_types) String(32bit) Value(LARGE)
+Enum(msp430_hwmult_types) String(32bit) Value(MSP430_HWMULT_LARGE)
EnumValue
-Enum(msp430_hwmult_types) String(f5series) Value(F5SERIES)
+Enum(msp430_hwmult_types) String(f5series) Value(MSP430_HWMULT_F5SERIES)
mcode-region=
-Target Joined RejectNegative Report ToLower Var(msp430_code_region) Enum(msp430_regions) Init(ANY)
+Target Joined RejectNegative Report ToLower Var(msp430_code_region) Enum(msp430_regions) Init(MSP430_REGION_ANY)
Specify whether functions should be placed into low or high memory.
mdata-region=
-Target Joined RejectNegative Report ToLower Var(msp430_data_region) Enum(msp430_regions) Init(ANY)
+Target Joined RejectNegative Report ToLower Var(msp430_data_region) Enum(msp430_regions) Init(MSP430_REGION_ANY)
Specify whether variables should be placed into low or high memory.
Enum
Name(msp430_regions) Type(enum msp430_regions)
EnumValue
-Enum(msp430_regions) String(none) Value(ANY)
+Enum(msp430_regions) String(none) Value(MSP430_REGION_ANY)
EnumValue
-Enum(msp430_regions) String(either) Value(EITHER)
+Enum(msp430_regions) String(either) Value(MSP430_REGION_EITHER)
EnumValue
-Enum(msp430_regions) String(lower) Value(LOWER)
+Enum(msp430_regions) String(lower) Value(MSP430_REGION_LOWER)
EnumValue
-Enum(msp430_regions) String(upper) Value(UPPER)
+Enum(msp430_regions) String(upper) Value(MSP430_REGION_UPPER)
msilicon-errata=
Target Joined RejectNegative Report ToLower