Commit f50bb868 by Claudiu Zissulescu Committed by Claudiu Zissulescu

arc-common.c (arc_handle_option): Handle ARCv2 options.

2015-11-11  Claudiu Zissulescu  <claziss@synopsys.com>

	* common/config/arc/arc-common.c (arc_handle_option): Handle ARCv2
	options.
	* config/arc/arc-opts.h: Add ARCv2 CPUs.
	* config/arc/arc-protos.h (arc_secondary_reload_conv): Prototype.
	* config/arc/arc.c (arc_secondary_reload): Handle subreg (reg)
	situation, and store instructions with large offsets.
	(arc_secondary_reload_conv): New function.
	(arc_init): Add ARCv2 options.
	(arc_conditional_register_usage): Select the proper register usage
	for ARCv2 processors.
	(arc_handle_interrupt_attribute): ILINK2 is only valid for ARCv1
	architecture.
	(arc_compute_function_type): Likewise.
	(arc_print_operand): Handle new ARCv2 punctuation characters.
	(arc_return_in_memory): ARCv2 ABI returns in registers up to 16
	bytes.
	(workaround_arc_anomaly, arc_asm_insn_p, arc_loop_hazard): New
	function.
	(arc_reorg, arc_hazard): Use it.
	* config/arc/arc.h (TARGET_CPU_CPP_BUILTINS): Define __HS__ and
	__EM__.
	(ASM_SPEC): Add ARCv2 options.
	(TARGET_NORM): ARC HS has norm instructions by default.
	(TARGET_OPTFPE): Use optimized floating point emulation for ARC
	HS.
	(TARGET_AT_DBR_CONDEXEC): Only for ARC600 family.
	(TARGET_EM, TARGET_HS, TARGET_V2, TARGET_MPYW, TARGET_MULTI):
	Define.
	(SIGNED_INT16, TARGET_MPY, TARGET_ARC700_MPY, TARGET_ANY_MPY):
	Likewise.
	(TARGET_ARC600_FAMILY, TARGET_ARCOMPACT_FAMILY): Likewise.
	(TARGET_LP_WR_INTERLOCK): Likewise.
	* config/arc/arc.md
	(commutative_binary_mult_comparison_result_used, movsicc_insn)
	(mulsi3, mulsi3_600_lib, mulsidi3, mulsidi3_700, mulsi3_highpart)
	(umulsi3_highpart_i, umulsi3_highpart_int, umulsi3_highpart)
	(umulsidi3, umulsidi3_700, cstoresi4, simple_return, p_return_i):
	Use it for ARCv2.
	(mulhisi3, mulhisi3_imm, mulhisi3_reg, umulhisi3, umulhisi3_imm)
	(umulhisi3_reg, umulhisi3_reg, mulsi3_v2, nopv, bswapsi2)
	(prefetch, divsi3, udivsi3 modsi3, umodsi3, arcset, arcsetltu)
	(arcsetgeu, arcsethi, arcsetls, reload_*_load, reload_*_store)
	(extzvsi): New pattern.
	* config/arc/arc.opt: New ARCv2 options.
	* config/arc/arcEM.md: New file.
	* config/arc/arcHS.md: Likewise.
	* config/arc/constraints.md (C3p): New constraint, accepts 1 and 2
	values.
	(Cm2): A signed 9-bit integer constant constraint.
	(C62): An unsigned 6-bit integer constant constraint.
	(C16): A signed 16-bit integer constant constraint.
	* config/arc/predicates.md (mult_operator): Add ARCv2 processort.
	(short_const_int_operand): New predicate.
	* config/arc/t-arc-newlib: Add ARCv2 multilib options.
	* doc/invoke.texi: Add documentation for -mcpu=<archs/arcem>
	-mcode-density and -mdiv-rem.

From-SVN: r230156
parent 9e0c852b
2015-11-11 Claudiu Zissulescu <claziss@synopsys.com>
* common/config/arc/arc-common.c (arc_handle_option): Handle ARCv2
options.
* config/arc/arc-opts.h: Add ARCv2 CPUs.
* config/arc/arc-protos.h (arc_secondary_reload_conv): Prototype.
* config/arc/arc.c (arc_secondary_reload): Handle subreg (reg)
situation, and store instructions with large offsets.
(arc_secondary_reload_conv): New function.
(arc_init): Add ARCv2 options.
(arc_conditional_register_usage): Select the proper register usage
for ARCv2 processors.
(arc_handle_interrupt_attribute): ILINK2 is only valid for ARCv1
architecture.
(arc_compute_function_type): Likewise.
(arc_print_operand): Handle new ARCv2 punctuation characters.
(arc_return_in_memory): ARCv2 ABI returns in registers up to 16
bytes.
(workaround_arc_anomaly, arc_asm_insn_p, arc_loop_hazard): New
function.
(arc_reorg, arc_hazard): Use it.
* config/arc/arc.h (TARGET_CPU_CPP_BUILTINS): Define __HS__ and
__EM__.
(ASM_SPEC): Add ARCv2 options.
(TARGET_NORM): ARC HS has norm instructions by default.
(TARGET_OPTFPE): Use optimized floating point emulation for ARC
HS.
(TARGET_AT_DBR_CONDEXEC): Only for ARC600 family.
(TARGET_EM, TARGET_HS, TARGET_V2, TARGET_MPYW, TARGET_MULTI):
Define.
(SIGNED_INT16, TARGET_MPY, TARGET_ARC700_MPY, TARGET_ANY_MPY):
Likewise.
(TARGET_ARC600_FAMILY, TARGET_ARCOMPACT_FAMILY): Likewise.
(TARGET_LP_WR_INTERLOCK): Likewise.
* config/arc/arc.md
(commutative_binary_mult_comparison_result_used, movsicc_insn)
(mulsi3, mulsi3_600_lib, mulsidi3, mulsidi3_700, mulsi3_highpart)
(umulsi3_highpart_i, umulsi3_highpart_int, umulsi3_highpart)
(umulsidi3, umulsidi3_700, cstoresi4, simple_return, p_return_i):
Use it for ARCv2.
(mulhisi3, mulhisi3_imm, mulhisi3_reg, umulhisi3, umulhisi3_imm)
(umulhisi3_reg, umulhisi3_reg, mulsi3_v2, nopv, bswapsi2)
(prefetch, divsi3, udivsi3 modsi3, umodsi3, arcset, arcsetltu)
(arcsetgeu, arcsethi, arcsetls, reload_*_load, reload_*_store)
(extzvsi): New pattern.
* config/arc/arc.opt: New ARCv2 options.
* config/arc/arcEM.md: New file.
* config/arc/arcHS.md: Likewise.
* config/arc/constraints.md (C3p): New constraint, accepts 1 and 2
values.
(Cm2): A signed 9-bit integer constant constraint.
(C62): An unsigned 6-bit integer constant constraint.
(C16): A signed 16-bit integer constant constraint.
* config/arc/predicates.md (mult_operator): Add ARCv2 processort.
(short_const_int_operand): New predicate.
* config/arc/t-arc-newlib: Add ARCv2 multilib options.
* doc/invoke.texi: Add documentation for -mcpu=<archs/arcem>
-mcode-density and -mdiv-rem.
2015-11-11 Julia Koval <julia.koval@intel.com> 2015-11-11 Julia Koval <julia.koval@intel.com>
* config/i386/i386.c (m_SKYLAKE_AVX512): Fix typo. * config/i386/i386.c (m_SKYLAKE_AVX512): Fix typo.
...@@ -33,7 +33,7 @@ arc_option_init_struct (struct gcc_options *opts) ...@@ -33,7 +33,7 @@ arc_option_init_struct (struct gcc_options *opts)
{ {
opts->x_flag_no_common = 255; /* Mark as not user-initialized. */ opts->x_flag_no_common = 255; /* Mark as not user-initialized. */
/* Which cpu we're compiling for (ARC600, ARC601, ARC700). */ /* Which cpu we're compiling for (ARC600, ARC601, ARC700, ARCv2). */
arc_cpu = PROCESSOR_NONE; arc_cpu = PROCESSOR_NONE;
} }
...@@ -68,6 +68,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -68,6 +68,7 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
{ {
size_t code = decoded->opt_index; size_t code = decoded->opt_index;
int value = decoded->value; int value = decoded->value;
const char *arg = decoded->arg;
switch (code) switch (code)
{ {
...@@ -91,9 +92,40 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, ...@@ -91,9 +92,40 @@ arc_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
if (! (opts_set->x_target_flags & MASK_BARREL_SHIFTER) ) if (! (opts_set->x_target_flags & MASK_BARREL_SHIFTER) )
opts->x_target_flags &= ~MASK_BARREL_SHIFTER; opts->x_target_flags &= ~MASK_BARREL_SHIFTER;
break; break;
case PROCESSOR_ARCHS:
if ( !(opts_set->x_target_flags & MASK_BARREL_SHIFTER))
opts->x_target_flags |= MASK_BARREL_SHIFTER; /* Default: on. */
if ( !(opts_set->x_target_flags & MASK_CODE_DENSITY))
opts->x_target_flags |= MASK_CODE_DENSITY; /* Default: on. */
if ( !(opts_set->x_target_flags & MASK_NORM_SET))
opts->x_target_flags |= MASK_NORM_SET; /* Default: on. */
if ( !(opts_set->x_target_flags & MASK_SWAP_SET))
opts->x_target_flags |= MASK_SWAP_SET; /* Default: on. */
if ( !(opts_set->x_target_flags & MASK_DIVREM))
opts->x_target_flags |= MASK_DIVREM; /* Default: on. */
break;
case PROCESSOR_ARCEM:
if ( !(opts_set->x_target_flags & MASK_BARREL_SHIFTER))
opts->x_target_flags |= MASK_BARREL_SHIFTER; /* Default: on. */
if ( !(opts_set->x_target_flags & MASK_CODE_DENSITY))
opts->x_target_flags &= ~MASK_CODE_DENSITY; /* Default: off. */
if ( !(opts_set->x_target_flags & MASK_NORM_SET))
opts->x_target_flags &= ~MASK_NORM_SET; /* Default: off. */
if ( !(opts_set->x_target_flags & MASK_SWAP_SET))
opts->x_target_flags &= ~MASK_SWAP_SET; /* Default: off. */
if ( !(opts_set->x_target_flags & MASK_DIVREM))
opts->x_target_flags &= ~MASK_DIVREM; /* Default: off. */
break;
default: default:
gcc_unreachable (); gcc_unreachable ();
} }
break;
case OPT_mmpy_option_:
if (value < 0 || value > 9)
error_at (loc, "bad value %qs for -mmpy-option switch", arg);
break;
} }
return true; return true;
......
...@@ -23,5 +23,7 @@ enum processor_type ...@@ -23,5 +23,7 @@ enum processor_type
PROCESSOR_NONE, PROCESSOR_NONE,
PROCESSOR_ARC600, PROCESSOR_ARC600,
PROCESSOR_ARC601, PROCESSOR_ARC601,
PROCESSOR_ARC700 PROCESSOR_ARC700,
PROCESSOR_ARCEM,
PROCESSOR_ARCHS
}; };
...@@ -118,3 +118,4 @@ extern bool arc_epilogue_uses (int regno); ...@@ -118,3 +118,4 @@ extern bool arc_epilogue_uses (int regno);
extern int regno_clobbered_p (unsigned int, rtx_insn *, machine_mode, int); extern int regno_clobbered_p (unsigned int, rtx_insn *, machine_mode, int);
extern int arc_return_slot_offset (void); extern int arc_return_slot_offset (void);
extern bool arc_legitimize_reload_address (rtx *, machine_mode, int, int); extern bool arc_legitimize_reload_address (rtx *, machine_mode, int, int);
extern void arc_secondary_reload_conv (rtx, rtx, rtx, bool);
...@@ -80,6 +80,14 @@ along with GCC; see the file COPYING3. If not see ...@@ -80,6 +80,14 @@ along with GCC; see the file COPYING3. If not see
builtin_define ("__A7__"); \ builtin_define ("__A7__"); \
builtin_define ("__ARC700__"); \ builtin_define ("__ARC700__"); \
} \ } \
else if (TARGET_EM) \
{ \
builtin_define ("__EM__"); \
} \
else if (TARGET_HS) \
{ \
builtin_define ("__HS__"); \
} \
if (TARGET_NORM) \ if (TARGET_NORM) \
{ \ { \
builtin_define ("__ARC_NORM__");\ builtin_define ("__ARC_NORM__");\
...@@ -143,6 +151,8 @@ along with GCC; see the file COPYING3. If not see ...@@ -143,6 +151,8 @@ along with GCC; see the file COPYING3. If not see
%{mcpu=ARC700|!mcpu=*:%{mlock}} \ %{mcpu=ARC700|!mcpu=*:%{mlock}} \
%{mcpu=ARC700|!mcpu=*:%{mswape}} \ %{mcpu=ARC700|!mcpu=*:%{mswape}} \
%{mcpu=ARC700|!mcpu=*:%{mrtsc}} \ %{mcpu=ARC700|!mcpu=*:%{mrtsc}} \
%{mcpu=ARCHS:-mHS} \
%{mcpu=ARCEM:-mEM} \
" "
#if DEFAULT_LIBC == LIBC_UCLIBC #if DEFAULT_LIBC == LIBC_UCLIBC
...@@ -246,12 +256,13 @@ along with GCC; see the file COPYING3. If not see ...@@ -246,12 +256,13 @@ along with GCC; see the file COPYING3. If not see
/* Non-zero means the cpu supports norm instruction. This flag is set by /* Non-zero means the cpu supports norm instruction. This flag is set by
default for A7, and only for pre A7 cores when -mnorm is given. */ default for A7, and only for pre A7 cores when -mnorm is given. */
#define TARGET_NORM (TARGET_ARC700 || TARGET_NORM_SET) #define TARGET_NORM (TARGET_ARC700 || TARGET_NORM_SET || TARGET_HS)
/* Indicate if an optimized floating point emulation library is available. */ /* Indicate if an optimized floating point emulation library is available. */
#define TARGET_OPTFPE \ #define TARGET_OPTFPE \
(TARGET_ARC700 \ (TARGET_ARC700 \
/* We need a barrel shifter and NORM. */ \ /* We need a barrel shifter and NORM. */ \
|| (TARGET_ARC600 && TARGET_NORM_SET)) || (TARGET_ARC600 && TARGET_NORM_SET) \
|| TARGET_HS)
/* Non-zero means the cpu supports swap instruction. This flag is set by /* Non-zero means the cpu supports swap instruction. This flag is set by
default for A7, and only for pre A7 cores when -mswap is given. */ default for A7, and only for pre A7 cores when -mswap is given. */
...@@ -271,11 +282,15 @@ along with GCC; see the file COPYING3. If not see ...@@ -271,11 +282,15 @@ along with GCC; see the file COPYING3. If not see
/* For an anulled-true delay slot insn for a delayed branch, should we only /* For an anulled-true delay slot insn for a delayed branch, should we only
use conditional execution? */ use conditional execution? */
#define TARGET_AT_DBR_CONDEXEC (!TARGET_ARC700) #define TARGET_AT_DBR_CONDEXEC (!TARGET_ARC700 && !TARGET_V2)
#define TARGET_ARC600 (arc_cpu == PROCESSOR_ARC600) #define TARGET_ARC600 (arc_cpu == PROCESSOR_ARC600)
#define TARGET_ARC601 (arc_cpu == PROCESSOR_ARC601) #define TARGET_ARC601 (arc_cpu == PROCESSOR_ARC601)
#define TARGET_ARC700 (arc_cpu == PROCESSOR_ARC700) #define TARGET_ARC700 (arc_cpu == PROCESSOR_ARC700)
#define TARGET_EM (arc_cpu == PROCESSOR_ARCEM)
#define TARGET_HS (arc_cpu == PROCESSOR_ARCHS)
#define TARGET_V2 \
((arc_cpu == PROCESSOR_ARCHS) || (arc_cpu == PROCESSOR_ARCEM))
/* Recast the cpu class to be the cpu attribute. */ /* Recast the cpu class to be the cpu attribute. */
#define arc_cpu_attr ((enum attr_cpu)arc_cpu) #define arc_cpu_attr ((enum attr_cpu)arc_cpu)
...@@ -744,6 +759,7 @@ extern enum reg_class arc_regno_reg_class[]; ...@@ -744,6 +759,7 @@ extern enum reg_class arc_regno_reg_class[];
((unsigned) (((X) >> (SHIFT)) + 0x100) \ ((unsigned) (((X) >> (SHIFT)) + 0x100) \
< 0x200 - ((unsigned) (OFFSET) >> (SHIFT))) < 0x200 - ((unsigned) (OFFSET) >> (SHIFT)))
#define SIGNED_INT12(X) ((unsigned) ((X) + 0x800) < 0x1000) #define SIGNED_INT12(X) ((unsigned) ((X) + 0x800) < 0x1000)
#define SIGNED_INT16(X) ((unsigned) ((X) + 0x8000) < 0x10000)
#define LARGE_INT(X) \ #define LARGE_INT(X) \
(((X) < 0) \ (((X) < 0) \
? (X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \ ? (X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \
...@@ -1305,6 +1321,7 @@ do { \ ...@@ -1305,6 +1321,7 @@ do { \
#endif #endif
#define SET_ASM_OP "\t.set\t" #define SET_ASM_OP "\t.set\t"
extern char rname29[], rname30[];
extern char rname56[], rname57[], rname58[], rname59[]; extern char rname56[], rname57[], rname58[], rname59[];
/* How to refer to registers in assembler output. /* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */ This sequence is indexed by compiler's hard-register-number (see above). */
...@@ -1312,7 +1329,7 @@ extern char rname56[], rname57[], rname58[], rname59[]; ...@@ -1312,7 +1329,7 @@ extern char rname56[], rname57[], rname58[], rname59[];
{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
"r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
"r24", "r25", "gp", "fp", "sp", "ilink1", "ilink2", "blink", \ "r24", "r25", "gp", "fp", "sp", rname29, rname30, "blink", \
"r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
"d1", "d1", "d2", "d2", "r44", "r45", "r46", "r47", \ "d1", "d1", "d2", "d2", "r44", "r45", "r46", "r47", \
"r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
...@@ -1678,4 +1695,25 @@ enum ...@@ -1678,4 +1695,25 @@ enum
#define SFUNC_CHECK_PREDICABLE \ #define SFUNC_CHECK_PREDICABLE \
(GET_CODE (PATTERN (insn)) != COND_EXEC || !flag_pic || !TARGET_MEDIUM_CALLS) (GET_CODE (PATTERN (insn)) != COND_EXEC || !flag_pic || !TARGET_MEDIUM_CALLS)
/* MPYW feature macro. Only valid for ARCHS and ARCEM cores. */
#define TARGET_MPYW ((arc_mpy_option > 0) && TARGET_V2)
/* Full ARCv2 multiplication feature macro. */
#define TARGET_MULTI ((arc_mpy_option > 1) && TARGET_V2)
/* General MPY feature macro. */
#define TARGET_MPY ((TARGET_ARC700 && (!TARGET_NOMPY_SET)) || TARGET_MULTI)
/* ARC700 MPY feature macro. */
#define TARGET_ARC700_MPY (TARGET_ARC700 && (!TARGET_NOMPY_SET))
/* Any multiplication feature macro. */
#define TARGET_ANY_MPY \
(TARGET_MPY || TARGET_MUL64_SET || TARGET_MULMAC_32BY16_SET)
/* ARC600 and ARC601 feature macro. */
#define TARGET_ARC600_FAMILY (TARGET_ARC600 || TARGET_ARC601)
/* ARC600, ARC601 and ARC700 feature macro. */
#define TARGET_ARCOMPACT_FAMILY \
(TARGET_ARC600 || TARGET_ARC601 || TARGET_ARC700)
/* Loop count register can be read in very next instruction after has
been written to by an ordinary instruction. */
#define TARGET_LP_WR_INTERLOCK (!TARGET_ARC600_FAMILY)
#endif /* GCC_ARC_H */ #endif /* GCC_ARC_H */
...@@ -53,6 +53,18 @@ mARC700 ...@@ -53,6 +53,18 @@ mARC700
Target Report Target Report
Same as -mA7. Same as -mA7.
mmpy-option=
Target RejectNegative Joined UInteger Var(arc_mpy_option) Init(2)
-mmpy-option={0,1,2,3,4,5,6,7,8,9} Compile ARCv2 code with a multiplier design option. Option 2 is default on.
mdiv-rem
Target Report Mask(DIVREM)
Enable DIV-REM instructions for ARCv2
mcode-density
Target Report Mask(CODE_DENSITY)
Enable code density instructions for ARCv2
mmixed-code mmixed-code
Target Report Mask(MIXED_CODE_SET) Target Report Mask(MIXED_CODE_SET)
Tweak register allocation to help 16-bit instruction generation. Tweak register allocation to help 16-bit instruction generation.
...@@ -162,11 +174,32 @@ EnumValue ...@@ -162,11 +174,32 @@ EnumValue
Enum(processor_type) String(ARC600) Value(PROCESSOR_ARC600) Enum(processor_type) String(ARC600) Value(PROCESSOR_ARC600)
EnumValue EnumValue
Enum(processor_type) String(arc600) Value(PROCESSOR_ARC600)
EnumValue
Enum(processor_type) String(ARC601) Value(PROCESSOR_ARC601) Enum(processor_type) String(ARC601) Value(PROCESSOR_ARC601)
EnumValue EnumValue
Enum(processor_type) String(arc601) Value(PROCESSOR_ARC601)
EnumValue
Enum(processor_type) String(ARC700) Value(PROCESSOR_ARC700) Enum(processor_type) String(ARC700) Value(PROCESSOR_ARC700)
EnumValue
Enum(processor_type) String(arc700) Value(PROCESSOR_ARC700)
EnumValue
Enum(processor_type) String(ARCEM) Value(PROCESSOR_ARCEM)
EnumValue
Enum(processor_type) String(arcem) Value(PROCESSOR_ARCEM)
EnumValue
Enum(processor_type) String(ARCHS) Value(PROCESSOR_ARCHS)
EnumValue
Enum(processor_type) String(archs) Value(PROCESSOR_ARCHS)
msize-level= msize-level=
Target RejectNegative Joined UInteger Var(arc_size_opt_level) Init(-1) Target RejectNegative Joined UInteger Var(arc_size_opt_level) Init(-1)
size optimization level: 0:none 1:opportunistic 2: regalloc 3:drop align, -Os. size optimization level: 0:none 1:opportunistic 2: regalloc 3:drop align, -Os.
......
;; DFA scheduling description of the Synopsys DesignWare ARC EM cpu
;; for GNU C compiler
;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Contributor: Claudiu Zissulescu <claudiu.zissulescu@synopsys.com>
;; This file is part of GCC.
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
(define_automaton "ARCEM")
(define_cpu_unit "em_issue, ld_st, mul_em, divrem_em" "ARCEM")
(define_insn_reservation "em_data_load" 2
(and (match_test "TARGET_EM")
(eq_attr "type" "load"))
"em_issue+ld_st,nothing")
(define_insn_reservation "em_data_store" 1
(and (match_test "TARGET_EM")
(eq_attr "type" "store"))
"em_issue+ld_st")
;; Multipliers options
(define_insn_reservation "mul_em_mpyw_1" 1
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option > 0")
(match_test "arc_mpy_option <= 2")
(eq_attr "type" "mul16_em"))
"em_issue+mul_em")
(define_insn_reservation "mul_em_mpyw_2" 2
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option > 2")
(match_test "arc_mpy_option <= 5")
(eq_attr "type" "mul16_em"))
"em_issue+mul_em, nothing")
(define_insn_reservation "mul_em_mpyw_4" 4
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 6")
(eq_attr "type" "mul16_em"))
"em_issue+mul_em, mul_em*3")
(define_insn_reservation "mul_em_multi_wlh1" 1
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 2")
(eq_attr "type" "multi,umulti"))
"em_issue+mul_em")
(define_insn_reservation "mul_em_multi_wlh2" 2
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 3")
(eq_attr "type" "multi,umulti"))
"em_issue+mul_em, nothing")
(define_insn_reservation "mul_em_multi_wlh3" 3
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 4")
(eq_attr "type" "multi,umulti"))
"em_issue+mul_em, mul_em*2")
;; FIXME! Make the difference between MPY and MPYM for WLH4
(define_insn_reservation "mul_em_multi_wlh4" 4
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 5")
(eq_attr "type" "multi,umulti"))
"em_issue+mul_em, mul_em*4")
(define_insn_reservation "mul_em_multi_wlh5" 9
(and (match_test "TARGET_EM")
(match_test "arc_mpy_option == 6")
(eq_attr "type" "multi,umulti"))
"em_issue+mul_em, mul_em*8")
;; Radix-4 divider timing
(define_insn_reservation "em_divrem" 3
(and (match_test "TARGET_EM")
(match_test "TARGET_DIVREM")
(eq_attr "type" "div_rem"))
"em_issue+mul_em+divrem_em, (mul_em+divrem_em)*2")
;; DFA scheduling description of the Synopsys DesignWare ARC HS cpu
;; for GNU C compiler
;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
;; Contributor: Claudiu Zissulescu <claudiu.zissulescu@synopsys.com>
;; This file is part of GCC.
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GCC is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3. If not see
;; <http://www.gnu.org/licenses/>.
(define_automaton "ARCHS")
(define_cpu_unit "hs_issue, hs_ld_st, divrem_hs, mul_hs, x1, x2" "ARCHS")
(define_insn_reservation "hs_data_load" 4
(and (match_test "TARGET_HS")
(eq_attr "type" "load"))
"hs_issue+hs_ld_st,hs_ld_st,nothing*2")
(define_insn_reservation "hs_data_store" 1
(and (match_test "TARGET_HS")
(eq_attr "type" "store"))
"hs_issue+hs_ld_st")
(define_insn_reservation "hs_alu0" 2
(and (match_test "TARGET_HS")
(eq_attr "type" "cc_arith, two_cycle_core, shift, lr, sr"))
"hs_issue+x1,x2")
(define_insn_reservation "hs_alu1" 4
(and (match_test "TARGET_HS")
(eq_attr "type" "move, cmove, unary, binary, compare, misc"))
"hs_issue+x1, nothing*3")
(define_insn_reservation "hs_divrem" 13
(and (match_test "TARGET_HS")
(match_test "TARGET_DIVREM")
(eq_attr "type" "div_rem"))
"hs_issue+divrem_hs, (divrem_hs)*12")
(define_insn_reservation "hs_mul" 3
(and (match_test "TARGET_HS")
(eq_attr "type" "mul16_em, multi, umulti"))
"hs_issue+mul_hs, nothing*3")
;; BYPASS EALU ->
(define_bypass 1 "hs_alu0" "hs_divrem")
(define_bypass 1 "hs_alu0" "hs_mul")
;; BYPASS BALU ->
(define_bypass 1 "hs_alu1" "hs_alu1")
(define_bypass 1 "hs_alu1" "hs_data_store" "store_data_bypass_p")
;; BYPASS LD ->
(define_bypass 1 "hs_data_load" "hs_alu1")
(define_bypass 3 "hs_data_load" "hs_divrem")
(define_bypass 3 "hs_data_load" "hs_data_load")
(define_bypass 3 "hs_data_load" "hs_mul")
(define_bypass 1 "hs_data_load" "hs_data_store" "store_data_bypass_p")
;; BYPASS MPY ->
;;(define_bypass 3 "hs_mul" "hs_mul")
(define_bypass 1 "hs_mul" "hs_alu1")
(define_bypass 3 "hs_mul" "hs_divrem")
(define_bypass 1 "hs_mul" "hs_data_store" "store_data_bypass_p")
...@@ -127,6 +127,12 @@ ...@@ -127,6 +127,12 @@
(and (match_code "const_int") (and (match_code "const_int")
(match_test "UNSIGNED_INT6 (-ival)"))) (match_test "UNSIGNED_INT6 (-ival)")))
(define_constraint "C16"
"@internal
A 16-bit signed integer constant"
(and (match_code "const_int")
(match_test "SIGNED_INT16 (ival)")))
(define_constraint "M" (define_constraint "M"
"@internal "@internal
A 5-bit unsigned integer constant" A 5-bit unsigned integer constant"
...@@ -212,6 +218,12 @@ ...@@ -212,6 +218,12 @@
(and (match_code "const_int") (and (match_code "const_int")
(match_test "ival && IS_POWEROF2_P (ival + 1)"))) (match_test "ival && IS_POWEROF2_P (ival + 1)")))
(define_constraint "C3p"
"@internal
constant int used to select xbfu a,b,u6 instruction. The values accepted are 1 and 2."
(and (match_code "const_int")
(match_test "((ival == 1) || (ival == 2))")))
(define_constraint "Ccp" (define_constraint "Ccp"
"@internal "@internal
constant such that ~x (one's Complement) is a power of two" constant such that ~x (one's Complement) is a power of two"
...@@ -397,3 +409,15 @@ ...@@ -397,3 +409,15 @@
Integer constant zero" Integer constant zero"
(and (match_code "const_int") (and (match_code "const_int")
(match_test "IS_ZERO (ival)"))) (match_test "IS_ZERO (ival)")))
(define_constraint "Cm2"
"@internal
A signed 9-bit integer constant."
(and (match_code "const_int")
(match_test "(ival >= -256) && (ival <=255)")))
(define_constraint "C62"
"@internal
An unsigned 6-bit integer constant, up to 62."
(and (match_code "const_int")
(match_test "UNSIGNED_INT6 (ival - 1)")))
...@@ -664,7 +664,7 @@ ...@@ -664,7 +664,7 @@
(match_operand 0 "shiftr4_operator"))) (match_operand 0 "shiftr4_operator")))
(define_predicate "mult_operator" (define_predicate "mult_operator"
(and (match_code "mult") (match_test "TARGET_ARC700 && !TARGET_NOMPY_SET")) (and (match_code "mult") (match_test "TARGET_MPY"))
) )
(define_predicate "commutative_operator" (define_predicate "commutative_operator"
...@@ -809,3 +809,7 @@ ...@@ -809,3 +809,7 @@
(match_test "INTVAL (op) >= 0") (match_test "INTVAL (op) >= 0")
(and (match_test "const_double_operand (op, mode)") (and (match_test "const_double_operand (op, mode)")
(match_test "CONST_DOUBLE_HIGH (op) == 0")))) (match_test "CONST_DOUBLE_HIGH (op) == 0"))))
(define_predicate "short_const_int_operand"
(and (match_operand 0 "const_int_operand")
(match_test "satisfies_constraint_C16 (op)")))
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
# with GCC; see the file COPYING3. If not see # with GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>. # <http://www.gnu.org/licenses/>.
MULTILIB_OPTIONS=mcpu=ARC600/mcpu=ARC601 mmul64/mmul32x16 mnorm MULTILIB_OPTIONS=mcpu=ARC600/mcpu=ARC601/mcpu=ARC700/mcpu=ARCEM/mcpu=ARCHS mmul64/mmul32x16 mnorm
MULTILIB_DIRNAMES=arc600 arc601 mul64 mul32x16 norm MULTILIB_DIRNAMES=arc600 arc601 arc700 em hs mul64 mul32x16 norm
# #
# Aliases: # Aliases:
MULTILIB_MATCHES = mcpu?ARC600=mcpu?arc600 MULTILIB_MATCHES = mcpu?ARC600=mcpu?arc600
...@@ -26,10 +26,21 @@ MULTILIB_MATCHES += mcpu?ARC600=mARC600 ...@@ -26,10 +26,21 @@ MULTILIB_MATCHES += mcpu?ARC600=mARC600
MULTILIB_MATCHES += mcpu?ARC600=mA6 MULTILIB_MATCHES += mcpu?ARC600=mA6
MULTILIB_MATCHES += mcpu?ARC600=mno-mpy MULTILIB_MATCHES += mcpu?ARC600=mno-mpy
MULTILIB_MATCHES += mcpu?ARC601=mcpu?arc601 MULTILIB_MATCHES += mcpu?ARC601=mcpu?arc601
MULTILIB_MATCHES += mcpu?ARC700=mA7
MULTILIB_MATCHES += mcpu?ARC700=mARC700
MULTILIB_MATCHES += mcpu?ARC700=mcpu?arc700
MULTILIB_MATCHES += mcpu?ARCEM=mcpu?arcem
MULTILIB_MATCHES += mcpu?ARCHS=mcpu?archs
MULTILIB_MATCHES += EL=mlittle-endian MULTILIB_MATCHES += EL=mlittle-endian
MULTILIB_MATCHES += EB=mbig-endian MULTILIB_MATCHES += EB=mbig-endian
# #
# These don't make sense for the ARC700 default target: # These don't make sense for the ARC700 default target:
MULTILIB_EXCEPTIONS=mmul64* mmul32x16* mnorm* MULTILIB_EXCEPTIONS=mmul64* mmul32x16* norm*
# And neither of the -mmul* options make sense without -mnorm: # And neither of the -mmul* options make sense without -mnorm:
MULTILIB_EXCLUSIONS=mARC600/mmul64/!mnorm mcpu=ARC601/mmul64/!mnorm mARC600/mmul32x16/!mnorm MULTILIB_EXCLUSIONS=mARC600/mmul64/!mnorm mcpu=ARC601/mmul64/!mnorm mARC600/mmul32x16/!mnorm
# Exclusions for ARC700
MULTILIB_EXCEPTIONS += mcpu=ARC700/mnorm* mcpu=ARC700/mmul64* mcpu=ARC700/mmul32x16*
# Exclusions for ARCv2EM
MULTILIB_EXCEPTIONS += mcpu=ARCEM/mmul64* mcpu=ARCEM/mmul32x16*
# Exclusions for ARCv2HS
MULTILIB_EXCEPTIONS += mcpu=ARCHS/mmul64* mcpu=ARCHS/mmul32x16* mcpu=ARCHS/mnorm*
...@@ -549,7 +549,9 @@ Objective-C and Objective-C++ Dialects}. ...@@ -549,7 +549,9 @@ Objective-C and Objective-C++ Dialects}.
-mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
-mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
-mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
-mtune=@var{cpu} -mmultcost=@var{num} -munalign-prob-threshold=@var{probability}} -mtune=@var{cpu} -mmultcost=@var{num} @gol
-munalign-prob-threshold=@var{probability} -mmpy-option=@var{multo} @gol
-mdiv-rem -mcode-density}
@emph{ARM Options} @emph{ARM Options}
@gccoptlist{-mapcs-frame -mno-apcs-frame @gol @gccoptlist{-mapcs-frame -mno-apcs-frame @gol
...@@ -12841,7 +12843,7 @@ is being compiled: ...@@ -12841,7 +12843,7 @@ is being compiled:
@item -mbarrel-shifter @item -mbarrel-shifter
@opindex mbarrel-shifter @opindex mbarrel-shifter
Generate instructions supported by barrel shifter. This is the default Generate instructions supported by barrel shifter. This is the default
unless @option{-mcpu=ARC601} is in effect. unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
@item -mcpu=@var{cpu} @item -mcpu=@var{cpu}
@opindex mcpu @opindex mcpu
...@@ -12854,17 +12856,28 @@ values for @var{cpu} are ...@@ -12854,17 +12856,28 @@ values for @var{cpu} are
@opindex mA6 @opindex mA6
@opindex mARC600 @opindex mARC600
@item ARC600 @item ARC600
@item arc600
Compile for ARC600. Aliases: @option{-mA6}, @option{-mARC600}. Compile for ARC600. Aliases: @option{-mA6}, @option{-mARC600}.
@item ARC601 @item ARC601
@item arc601
@opindex mARC601 @opindex mARC601
Compile for ARC601. Alias: @option{-mARC601}. Compile for ARC601. Alias: @option{-mARC601}.
@item ARC700 @item ARC700
@item arc700
@opindex mA7 @opindex mA7
@opindex mARC700 @opindex mARC700
Compile for ARC700. Aliases: @option{-mA7}, @option{-mARC700}. Compile for ARC700. Aliases: @option{-mA7}, @option{-mARC700}.
This is the default when configured with @option{--with-cpu=arc700}@. This is the default when configured with @option{--with-cpu=arc700}@.
@item ARCEM
@item arcem
Compile for ARC EM.
@item ARCHS
@item archs
Compile for ARC HS.
@end table @end table
@item -mdpfp @item -mdpfp
...@@ -12935,6 +12948,62 @@ can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or ...@@ -12935,6 +12948,62 @@ can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
@opindex mswap @opindex mswap
Generate swap instructions. Generate swap instructions.
@item -mdiv-rem
@opindex mdiv-rem
Enable DIV/REM instructions for ARCv2 cores.
@item -mcode-density
@opindex mcode-density
Enable code density instructions for ARC EM, default on for ARC HS.
@item -mmpy-option=@var{multo}
@opindex mmpy-option
Compile ARCv2 code with a multiplier design option. @samp{wlh1} is
the default value. The recognized values for @var{multo} are:
@table @samp
@item 0
No multiplier available.
@item 1
@opindex w
The multiply option is set to w: 16x16 multiplier, fully pipelined.
The following instructions are enabled: MPYW, and MPYUW.
@item 2
@opindex wlh1
The multiply option is set to wlh1: 32x32 multiplier, fully
pipelined (1 stage). The following instructions are additionaly
enabled: MPY, MPYU, MPYM, MPYMU, and MPY_S.
@item 3
@opindex wlh2
The multiply option is set to wlh2: 32x32 multiplier, fully pipelined
(2 stages). The following instructions are additionaly enabled: MPY,
MPYU, MPYM, MPYMU, and MPY_S.
@item 4
@opindex wlh3
The multiply option is set to wlh3: Two 16x16 multiplier, blocking,
sequential. The following instructions are additionaly enabled: MPY,
MPYU, MPYM, MPYMU, and MPY_S.
@item 5
@opindex wlh4
The multiply option is set to wlh4: One 16x16 multiplier, blocking,
sequential. The following instructions are additionaly enabled: MPY,
MPYU, MPYM, MPYMU, and MPY_S.
@item 6
@opindex wlh5
The multiply option is set to wlh5: One 32x4 multiplier, blocking,
sequential. The following instructions are additionaly enabled: MPY,
MPYU, MPYM, MPYMU, and MPY_S.
@end table
This option is only available for ARCv2 cores@.
@end table @end table
The following options are passed through to the assembler, and also The following options are passed through to the assembler, and also
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment