Commit f5d56cf9 by Claudiu Zissulescu Committed by Claudiu Zissulescu

[ARC] Enable code density frame option for elf targets.

xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/arc/arc.opt (mcode-density-frame): Get the inital value
	from TARGET_CODE_DENSITY_FRAME_DEFAULT.
	* config/arc/elf.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
	* config/arc/linux.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
	* config/arc/arc.md (pop_multi_fp_blink): Adjust constraints to
	match what the ops is doing.
	(push_multi_fp_blink): Likewise.
	* config/arc/arc.c (arc_override_options): Enable enter/leave when
	compiling for size and elf target.
	(arc_save_callee_enter): Adjust note to match what enter/leave
	operation does.

From-SVN: r269758
parent a0947960
2019-03-18 Claudiu Zissulescu <claziss@synopsys.com> 2019-03-18 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.opt (mcode-density-frame): Get the inital value
from TARGET_CODE_DENSITY_FRAME_DEFAULT.
* config/arc/elf.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
* config/arc/linux.h (TARGET_CODE_DENSITY_FRAME_DEFAULT): Define.
* config/arc/arc.md (pop_multi_fp_blink): Adjust constraints to
match what the ops is doing.
(push_multi_fp_blink): Likewise.
* config/arc/arc.c (arc_override_options): Enable enter/leave when
compiling for size and elf target.
(arc_save_callee_enter): Adjust note to match what enter/leave
operation does.
2019-03-18 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.md (tst_movb): Fix constraint. * config/arc/arc.md (tst_movb): Fix constraint.
2019-03-18 Claudiu Zissulescu <claziss@synopsys.com> 2019-03-18 Claudiu Zissulescu <claziss@synopsys.com>
......
...@@ -1294,6 +1294,9 @@ arc_override_options (void) ...@@ -1294,6 +1294,9 @@ arc_override_options (void)
if (arc_size_opt_level == 3) if (arc_size_opt_level == 3)
optimize_size = 1; optimize_size = 1;
if (TARGET_V2 && optimize_size && (ATTRIBUTE_PCS == 2))
TARGET_CODE_DENSITY_FRAME = 1;
if (flag_pic) if (flag_pic)
target_flags |= MASK_NO_SDATA_SET; target_flags |= MASK_NO_SDATA_SET;
...@@ -3140,7 +3143,7 @@ arc_save_callee_enter (unsigned int gmask, ...@@ -3140,7 +3143,7 @@ arc_save_callee_enter (unsigned int gmask,
reg = gen_rtx_SET (stack_pointer_rtx, reg = gen_rtx_SET (stack_pointer_rtx,
plus_constant (Pmode, plus_constant (Pmode,
stack_pointer_rtx, stack_pointer_rtx,
nregs * UNITS_PER_WORD)); -nregs * UNITS_PER_WORD));
RTX_FRAME_RELATED_P (reg) = 1; RTX_FRAME_RELATED_P (reg) = 1;
XVECEXP (insn, 0, indx++) = reg; XVECEXP (insn, 0, indx++) = reg;
off = nregs * UNITS_PER_WORD; off = nregs * UNITS_PER_WORD;
......
...@@ -6458,7 +6458,8 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -6458,7 +6458,8 @@ core_3, archs4x, archs4xd, archs4xd_slow"
(plus:SI (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand 1 "immediate_operand" ""))) (match_operand 1 "immediate_operand" "")))
(set (mem:SI (plus:SI (reg:SI SP_REG) (set (mem:SI (plus:SI (reg:SI SP_REG)
(match_dup 1))) (match_operand 2 "immediate_operand"
"")))
(reg:SI 13))])] (reg:SI 13))])]
"TARGET_CODE_DENSITY" "TARGET_CODE_DENSITY"
{ {
...@@ -6466,14 +6467,14 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -6466,14 +6467,14 @@ core_3, archs4x, archs4xd, archs4xd_slow"
rtx tmp = XVECEXP (operands[0], 0, len - 1); rtx tmp = XVECEXP (operands[0], 0, len - 1);
if (MEM_P (XEXP (tmp, 0))) if (MEM_P (XEXP (tmp, 0)))
{ {
operands[2] = XEXP (tmp, 1); operands[3] = XEXP (tmp, 1);
return "enter_s\\t{r13-%2} ; sp=sp-%1"; return "enter_s\\t{r13-%3} ; sp=sp+(%1)";
} }
else else
{ {
tmp = XVECEXP (operands[0], 0, len - 3); tmp = XVECEXP (operands[0], 0, len - 3);
operands[2] = XEXP (tmp, 1); operands[3] = XEXP (tmp, 1);
return "enter_s\\t{r13-%2, fp} ; sp=sp-%1"; return "enter_s\\t{r13-%3, fp} ; sp=sp+(%1)";
} }
} }
[(set_attr "type" "call_no_delay_slot") [(set_attr "type" "call_no_delay_slot")
...@@ -6485,7 +6486,8 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -6485,7 +6486,8 @@ core_3, archs4x, archs4xd, archs4xd_slow"
(plus:SI (reg:SI SP_REG) (plus:SI (reg:SI SP_REG)
(match_operand 1 "immediate_operand" ""))) (match_operand 1 "immediate_operand" "")))
(set (mem:SI (plus:SI (reg:SI SP_REG) (set (mem:SI (plus:SI (reg:SI SP_REG)
(match_dup 1))) (match_operand 2 "immediate_operand"
"")))
(reg:SI RETURN_ADDR_REGNUM))])] (reg:SI RETURN_ADDR_REGNUM))])]
"TARGET_CODE_DENSITY" "TARGET_CODE_DENSITY"
{ {
...@@ -6493,14 +6495,14 @@ core_3, archs4x, archs4xd, archs4xd_slow" ...@@ -6493,14 +6495,14 @@ core_3, archs4x, archs4xd, archs4xd_slow"
rtx tmp = XVECEXP (operands[0], 0, len - 1); rtx tmp = XVECEXP (operands[0], 0, len - 1);
if (MEM_P (XEXP (tmp, 0))) if (MEM_P (XEXP (tmp, 0)))
{ {
operands[2] = XEXP (tmp, 1); operands[3] = XEXP (tmp, 1);
return "enter_s\\t{r13-%2, blink} ; sp=sp-%1"; return "enter_s\\t{r13-%3, blink} ; sp=sp+(%1)";
} }
else else
{ {
tmp = XVECEXP (operands[0], 0, len - 3); tmp = XVECEXP (operands[0], 0, len - 3);
operands[2] = XEXP (tmp, 1); operands[3] = XEXP (tmp, 1);
return "enter_s\\t{r13-%2, fp, blink} ; sp=sp-%1"; return "enter_s\\t{r13-%3, fp, blink} ; sp=sp+(%1)";
} }
} }
[(set_attr "type" "call_no_delay_slot") [(set_attr "type" "call_no_delay_slot")
......
...@@ -537,5 +537,5 @@ Target Report Var(TARGET_BRANCH_INDEX) Init(DEFAULT_BRANCH_INDEX) ...@@ -537,5 +537,5 @@ Target Report Var(TARGET_BRANCH_INDEX) Init(DEFAULT_BRANCH_INDEX)
Enable use of BI/BIH instructions when available. Enable use of BI/BIH instructions when available.
mcode-density-frame mcode-density-frame
Target Report Var(TARGET_CODE_DENSITY_FRAME) Target Report Var(TARGET_CODE_DENSITY_FRAME) Init(TARGET_CODE_DENSITY_FRAME_DEFAULT)
Enable ENTER_S and LEAVE_S opcodes for ARCv2. Enable ENTER_S and LEAVE_S opcodes for ARCv2.
...@@ -87,3 +87,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -87,3 +87,7 @@ along with GCC; see the file COPYING3. If not see
fun = gen_rtx_SYMBOL_REF (Pmode, "__mcount"); \ fun = gen_rtx_SYMBOL_REF (Pmode, "__mcount"); \
emit_library_call (fun, LCT_NORMAL, VOIDmode); \ emit_library_call (fun, LCT_NORMAL, VOIDmode); \
} }
/* Enter/Leave default value. */
#undef TARGET_CODE_DENSITY_FRAME_DEFAULT
#define TARGET_CODE_DENSITY_FRAME_DEFAULT 0
...@@ -133,3 +133,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -133,3 +133,7 @@ along with GCC; see the file COPYING3. If not see
fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \ fun = gen_rtx_SYMBOL_REF (Pmode, "_mcount"); \
emit_library_call (fun, LCT_NORMAL, VOIDmode, rt, Pmode); \ emit_library_call (fun, LCT_NORMAL, VOIDmode, rt, Pmode); \
} }
/* Enter/Leave ops are default off for linux targets. */
#undef TARGET_CODE_DENSITY_FRAME_DEFAULT
#define TARGET_CODE_DENSITY_FRAME_DEFAULT 0
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