Skip to content

Commit 0e0bd03

Browse files
author
Claudiu Zissulescu
committed
New cpu/configuration options
1 parent 5b3cc51 commit 0e0bd03

File tree

5 files changed

+74
-26
lines changed

5 files changed

+74
-26
lines changed

gcc/ChangeLog.ARC

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2013-06-27 Claudiu Zissulescu <[email protected]>
2+
3+
* common/config/arc/arc-common.c: Atomic option set default on for HS.
4+
* config.gcc: Add arcem. archs configuration variants.
5+
* config/arc/arc.h: Translate marc600, macr601, marcem, and marchs options.
6+
* config/arc/arc.opt: Add marc600, macr601, marcem, and marchs options.
7+
18
2013-06-26 Claudiu Zissulescu <[email protected]>
29

310
* config/arc/arc.h (ASM_DEFOPT): Define.

gcc/common/config/arc/arc-common.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
9494
opts->x_target_flags |= MASK_NORM_SET; /* Default: on. */
9595
if ( !(opts_set->x_target_flags & MASK_SWAP_SET))
9696
opts->x_target_flags &= ~MASK_SWAP_SET; /* Default: off. */
97+
if ( !(opts_set->x_target_flags & MASK_ATOMIC))
98+
opts->x_target_flags &= ~MASK_ATOMIC; /* Default: off */
9799
/* For ARC700, mpy16 makes no sense. */
98100
opts->x_target_flags &= ~MASK_MPY16_SET;
99101
opts->x_target_flags &= ~MASK_CODE_DENSITY;
@@ -111,6 +113,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
111113
opts->x_target_flags &= ~MASK_MPY_SET;
112114
opts->x_target_flags &= ~MASK_CODE_DENSITY;
113115
opts->x_target_flags &= ~MASK_SHIFT_ASSIST;
116+
opts->x_target_flags &= ~MASK_ATOMIC;
114117
break;
115118

116119
case PROCESSOR_ARCv2HS:
@@ -131,6 +134,8 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
131134
opts->x_target_flags |= MASK_NORM_SET; /* Default: on. */
132135
if ( !(opts_set->x_target_flags & MASK_SWAP_SET))
133136
opts->x_target_flags |= MASK_SWAP_SET; /* Default: on. */
137+
if ( !(opts_set->x_target_flags & MASK_ATOMIC))
138+
opts->x_target_flags |= MASK_ATOMIC; /* Default: on. */
134139
break;
135140

136141
case PROCESSOR_ARCv2EM:
@@ -151,6 +156,8 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
151156
opts->x_target_flags &= ~MASK_NORM_SET; /* Default: off. */
152157
if ( !(opts_set->x_target_flags & MASK_SWAP_SET))
153158
opts->x_target_flags &= ~MASK_SWAP_SET; /* Default: off. */
159+
if ( !(opts_set->x_target_flags & MASK_ATOMIC))
160+
opts->x_target_flags &= ~MASK_ATOMIC; /* Default: off */
154161
break;
155162

156163
case PROCESSOR_ARC601:
@@ -164,6 +171,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
164171
opts->x_target_flags &= ~MASK_MPY_SET;
165172
opts->x_target_flags &= ~MASK_CODE_DENSITY;
166173
opts->x_target_flags &= ~MASK_SHIFT_ASSIST;
174+
opts->x_target_flags &= ~MASK_ATOMIC;
167175
break;
168176

169177
default:
@@ -216,17 +224,17 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
216224

217225
#if TARGET_CPU_DEFAULT == TARGET_CPU_HS
218226
/* For HS max out. */
219-
#define TARGET_DEFAULT_TARGET_FLAGS \
220-
(MASK_BARREL_SHIFTER | MASK_VOLATILE_CACHE_SET | DEFAULT_NO_SDATA \
227+
# define TARGET_DEFAULT_TARGET_FLAGS \
228+
(MASK_BARREL_SHIFTER | MASK_VOLATILE_CACHE_SET | DEFAULT_NO_SDATA \
221229
| MASK_MPY_SET | MASK_MPY16_SET | MASK_SHIFT_ASSIST | MASK_CODE_DENSITY \
222-
| MASK_NORM_SET | MASK_SWAP_SET)
230+
| MASK_NORM_SET | MASK_SWAP_SET | MASK_ATOMIC)
223231
#elif TARGET_CPU_DEFAULT == TARGET_CPU_EM
224232
/* Default for EM: no barrel shifter*/
225-
#define TARGET_DEFAULT_TARGET_FLAGS \
233+
# define TARGET_DEFAULT_TARGET_FLAGS \
226234
(MASK_BARREL_SHIFTER | MASK_VOLATILE_CACHE_SET | DEFAULT_NO_SDATA | MASK_MPY_SET | MASK_MPY16_SET)
227235
#else
228236
/* We default to ARC700, which has the barrel shifter enabled. */
229-
#define TARGET_DEFAULT_TARGET_FLAGS \
237+
# define TARGET_DEFAULT_TARGET_FLAGS \
230238
(MASK_BARREL_SHIFTER | MASK_VOLATILE_CACHE_SET | DEFAULT_NO_SDATA | MASK_MPY_SET)
231239
#endif
232240

gcc/config.gcc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,12 @@ arc*-*-elf*)
869869
xarc600|xarc601|xarc700|xEM|xHS)
870870
target_cpu_default="TARGET_CPU_$with_cpu"
871871
;;
872+
xarcem)
873+
target_cpu_default="TARGET_CPU_EM"
874+
;;
875+
xarchs)
876+
target_cpu_default="TARGET_CPU_HS"
877+
;;
872878
esac
873879
if test x${with_endian} = x; then
874880
case ${target} in
@@ -894,6 +900,12 @@ arc*-*-linux-uclibc*)
894900
xarc600|xarc601|xarc700|xEM|xHS)
895901
target_cpu_default="TARGET_CPU_$with_cpu"
896902
;;
903+
xarcem)
904+
target_cpu_default="TARGET_CPU_EM"
905+
;;
906+
xarchs)
907+
target_cpu_default="TARGET_CPU_HS"
908+
;;
897909
esac
898910
if test x${with_endian} = x; then
899911
case ${target} in
@@ -3245,7 +3257,7 @@ case "${target}" in
32453257
arc*-*-*) # was: arc*-*-linux-uclibc)
32463258
supported_defaults="cpu"
32473259
case $with_cpu in
3248-
arc600|arc601|arc700|EM|HS)
3260+
arc600|arc601|arc700|EM|HS|arcem|archs)
32493261
;;
32503262
*) echo "Unknown cpu type"
32513263
exit 1

gcc/config/arc/arc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,12 @@ ASM_DEFOPT "%{matomic:-mlock} \
277277
#define TARGET_MMEDIUM_CALLS_DEFAULT 0
278278
#endif
279279

280-
#define DRIVER_SELF_SPECS DRIVER_ENDIAN_SELF_SPECS \
281-
"%{mARC600|mA6: -mcpu=ARC600 %<mARC600 %<mA6}" \
282-
"%{mARC601: -mcpu=ARC601 %<mARC601}" \
280+
#define DRIVER_SELF_SPECS DRIVER_ENDIAN_SELF_SPECS \
281+
"%{mARC600|mA6|marc600: -mcpu=ARC600 %<mARC600 %<mA6 %<marc600}" \
282+
"%{mARC601|marc601: -mcpu=ARC601 %<mARC601 %<marc601}" \
283283
"%{mARC700|mA7|marc700: -mcpu=ARC700 %<mARC700 %<mA7 %<marc700}" \
284-
"%{mav2em|mARCv2EM|mEM: -mcpu=ARCv2EM %<mav2em %<ARCv2EM %<mEM}" \
285-
"%{mav2hs|mARCv2HS|mHS: -mcpu=ARCv2HS %<mav2hs %<ARCv2HS %<mHS}" \
284+
"%{mav2em|mARCv2EM|mEM|marcem: -mcpu=ARCv2EM %<mav2em %<ARCv2EM %<mEM %<marcem}" \
285+
"%{mav2hs|mARCv2HS|mHS|marchs: -mcpu=ARCv2HS %<mav2hs %<ARCv2HS %<mHS %<marchs}" \
286286
"%{mmpy_option*: -mmpy-option%* %<mmpy_option*}" \
287287
"%{mcode_densit*: -mcode-densit%* %<mcode_densit*}" \
288288
"%{mbarrel_shifte*: -mbarrel-shifte%* %<mbarrel_shifte*}" \

gcc/config/arc/arc.opt

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ mno-cond-exec
3333
Target Report RejectNegative Mask(NO_COND_EXEC)
3434
Disable ARCompact specific pass to generate conditional execution instructions
3535

36+
; This is here just for documentation,
37+
; it is really handled in DRIVER_SELF_SPECS.
3638
mA6
3739
Target Report
3840
Generate ARCompact 32-bit code for ARCtangent-ARC600 processor
@@ -41,10 +43,18 @@ mARC600
4143
Target Report
4244
Same as -mA6
4345

46+
marc600
47+
Target Report
48+
Same as -mA6
49+
4450
mARC601
4551
Target Report
4652
Generate ARCompact 32-bit code for ARCtangent-ARC601 processor
4753

54+
marc601
55+
Target Report
56+
Generate ARCompact 32-bit code for ARCtangent-ARC601 processor
57+
4858
mA7
4959
Target Report
5060
Generate ARCompact 32-bit code for ARCtangent-ARC700 processor
@@ -57,8 +67,6 @@ marc700
5767
Target Report
5868
Same as -mA7
5969

60-
; This is here just for documentation,
61-
; it is really handled in DRIVER_SELF_SPECS.
6270
mav2em
6371
Target Report RejectNegative Var(arc_cpu, PROCESSOR_ARCv2EM)
6472
Generate ARCv2 code for EM processor
@@ -67,6 +75,32 @@ mav2hs
6775
Target Report RejectNegative Var(arc_cpu, PROCESSOR_ARCv2HS)
6876
Generate ARCv2 code for HS processor
6977

78+
mARCv2EM
79+
Target
80+
Same as -mcpu=arcem
81+
82+
mEM
83+
Target
84+
Same as -mcpu=arcem
85+
86+
mARCv2HS
87+
Target
88+
Same as -mcpu=archs
89+
90+
mHS
91+
Target
92+
Same as -mcpu=archs
93+
94+
marcem
95+
Target
96+
Same as -mcpu=arcem
97+
98+
marchs
99+
Target
100+
Same as -mcpu=archs
101+
102+
; END backward-compatibility aliases, translated by DRIVER_SELF_SPECS
103+
70104
mmpy-option=
71105
Target RejectNegative Joined UInteger Var(arc_mpy_option) Init(2)
72106
-mmpy-option={0,1,2,3,4,5,6,7,8,9} Compile ARCv2 code with a multiplier design option. WLH1 is default on
@@ -435,19 +469,6 @@ mucb-mcount
435469
Target Report Var(TARGET_UCB_MCOUNT)
436470
instrument with mcount calls as in the ucb code
437471

438-
; backward-compatibility aliases, translated by DRIVER_SELF_SPECS
439-
mARCv2EM
440-
Target
441-
442-
mEM
443-
Target
444-
445-
mARCv2HS
446-
Target
447-
448-
mHS
449-
Target
450-
451472
; Unfortunately, listing the full option name gives us clashes
452473
; with OPT_opt_name being claimed for both opt_name and opt-name,
453474
; so we leave out the last character or more.

0 commit comments

Comments
 (0)