+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>
* tree-eh.c (lower_try_finally_dup_block): Clear location information
static rtx_insn *
xtensa_call_tls_desc (rtx sym, rtx *retp)
{
- rtx fn, arg, a10;
+ rtx fn, arg, a_io;
rtx_insn *call_insn, *insns;
start_sequence ();
fn = 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_arg (arg, sym));
- emit_move_insn (a10, arg);
- call_insn = emit_call_insn (gen_tls_call (a10, fn, sym, const1_rtx));
- use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a10);
+ emit_move_insn (a_io, arg);
+ call_insn = emit_call_insn (gen_tls_call (a_io, fn, sym, const1_rtx));
+ use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a_io);
insns = get_insns ();
end_sequence ();
- *retp = a10;
+ *retp = a_io;
return insns;
}
UNSPEC_TLS_CALL))
(match_operand 3 "" "i")))]
"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 "mode" "none")
(set_attr "length" "3")])