Commit e1b8828b by Max Filippov Committed by Max Filippov

xtensa: fix TLS calls for call0 ABI

2015-09-15  Max Filippov  <jcmvbkbc@gmail.com>
gcc/
	* config/xtensa/xtensa.c (xtensa_call_tls_desc): Use a10 or a2
	to pass TLS call argument, according to current ABI.
	* config/xtensa/xtensa.md (tls_call pattern): Use callx8 or
	callx0 for TLS call, according to current ABI.

From-SVN: r227808
parent cc6fbd80
2015-09-15 Max Filippov <jcmvbkbc@gmail.com>
* config/xtensa/xtensa.c (xtensa_call_tls_desc): Use a10 or a2
to pass TLS call argument, according to current ABI.
* config/xtensa/xtensa.md (tls_call pattern): Use callx8 or
callx0 for TLS call, according to current ABI.
2015-09-15 Eric Botcazou <ebotcazou@adacore.com> 2015-09-15 Eric Botcazou <ebotcazou@adacore.com>
* tree-eh.c (lower_try_finally_dup_block): Clear location information * tree-eh.c (lower_try_finally_dup_block): Clear location information
......
...@@ -1874,23 +1874,23 @@ xtensa_tls_module_base (void) ...@@ -1874,23 +1874,23 @@ xtensa_tls_module_base (void)
static rtx_insn * static rtx_insn *
xtensa_call_tls_desc (rtx sym, rtx *retp) xtensa_call_tls_desc (rtx sym, rtx *retp)
{ {
rtx fn, arg, a10; rtx fn, arg, a_io;
rtx_insn *call_insn, *insns; rtx_insn *call_insn, *insns;
start_sequence (); start_sequence ();
fn = gen_reg_rtx (Pmode); fn = gen_reg_rtx (Pmode);
arg = gen_reg_rtx (Pmode); arg = gen_reg_rtx (Pmode);
a10 = gen_rtx_REG (Pmode, 10); a_io = gen_rtx_REG (Pmode, WINDOW_SIZE + 2);
emit_insn (gen_tls_func (fn, sym)); emit_insn (gen_tls_func (fn, sym));
emit_insn (gen_tls_arg (arg, sym)); emit_insn (gen_tls_arg (arg, sym));
emit_move_insn (a10, arg); emit_move_insn (a_io, arg);
call_insn = emit_call_insn (gen_tls_call (a10, fn, sym, const1_rtx)); call_insn = emit_call_insn (gen_tls_call (a_io, fn, sym, const1_rtx));
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a10); use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a_io);
insns = get_insns (); insns = get_insns ();
end_sequence (); end_sequence ();
*retp = a10; *retp = a_io;
return insns; return insns;
} }
......
...@@ -1883,7 +1883,12 @@ ...@@ -1883,7 +1883,12 @@
UNSPEC_TLS_CALL)) UNSPEC_TLS_CALL))
(match_operand 3 "" "i")))] (match_operand 3 "" "i")))]
"TARGET_THREADPTR && HAVE_AS_TLS" "TARGET_THREADPTR && HAVE_AS_TLS"
"callx8.tls %1, %2@TLSCALL" {
if (TARGET_WINDOWED_ABI)
return "callx8.tls %1, %2@TLSCALL";
else
return "callx0.tls %1, %2@TLSCALL";
}
[(set_attr "type" "call") [(set_attr "type" "call")
(set_attr "mode" "none") (set_attr "mode" "none")
(set_attr "length" "3")]) (set_attr "length" "3")])
......
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