commit c1ed4442a4d81db8a421b74c6a9d65c69e095779
Author: Jiong Wang <jiong.wang@arm.com>
Date: Mon May 18 16:48:33 2015 +0100
Generalize GD
@@ -61,10 +61,10 @@ enum aarch64_symbol_context
This corresponds to the small PIC model of the compiler.
- SYMBOL_SMALL_TLSGD
SYMBOL_SMALL_TLSDESC
SYMBOL_SMALL_GOTTPREL
SYMBOL_TINY_TLSIE
+ SYMBOL_TLSGD
SYMBOL_TLSLE
Each of of these represents a thread-local symbol, and corresponds to the
thread local storage relocation operator for the symbol being referred to.
@@ -96,12 +96,12 @@ enum aarch64_symbol_type
{
SYMBOL_SMALL_ABSOLUTE,
SYMBOL_SMALL_GOT,
- SYMBOL_SMALL_TLSGD,
SYMBOL_SMALL_TLSDESC,
SYMBOL_SMALL_GOTTPREL,
SYMBOL_TINY_ABSOLUTE,
SYMBOL_TINY_GOT,
SYMBOL_TINY_TLSIE,
+ SYMBOL_TLSGD,
SYMBOL_TLSLE,
SYMBOL_FORCE_TO_MEM
};
@@ -905,13 +905,14 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
return;
}
- case SYMBOL_SMALL_TLSGD:
+ case SYMBOL_TLSGD:
{
rtx_insn *insns;
rtx result = gen_rtx_REG (Pmode, R0_REGNUM);
+ rtx func = aarch64_tls_get_addr ();
start_sequence ();
- aarch64_emit_call_insn (gen_tlsgd_small (result, imm));
+ aarch64_emit_call_insn (gen_tlsgd (result, imm, func));
insns = get_insns ();
end_sequence ();
@@ -1547,7 +1548,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
emit_insn (gen_rtx_SET (dest, mem));
return;
- case SYMBOL_SMALL_TLSGD:
+ case SYMBOL_TLSGD:
case SYMBOL_SMALL_TLSDESC:
case SYMBOL_SMALL_GOTTPREL:
case SYMBOL_SMALL_GOT:
@@ -4430,7 +4431,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
asm_fprintf (asm_out_file, ":got:");
break;
- case SYMBOL_SMALL_TLSGD:
+ case SYMBOL_TLSGD:
asm_fprintf (asm_out_file, ":tlsgd:");
break;
@@ -4463,7 +4464,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
asm_fprintf (asm_out_file, ":lo12:");
break;
- case SYMBOL_SMALL_TLSGD:
+ case SYMBOL_TLSGD:
asm_fprintf (asm_out_file, ":tlsgd_lo12:");
break;
@@ -7272,7 +7273,7 @@ aarch64_classify_tls_symbol (rtx x)
{
case TLS_MODEL_GLOBAL_DYNAMIC:
case TLS_MODEL_LOCAL_DYNAMIC:
- return TARGET_TLS_DESC ? SYMBOL_SMALL_TLSDESC : SYMBOL_SMALL_TLSGD;
+ return TARGET_TLS_DESC ? SYMBOL_SMALL_TLSDESC : SYMBOL_TLSGD;
case TLS_MODEL_INITIAL_EXEC:
switch (aarch64_cmodel)
@@ -117,6 +117,7 @@
UNSPEC_ST4_LANE
UNSPEC_TLS
UNSPEC_TLSDESC
+ UNSPEC_TLSGD
UNSPEC_TLSLE
UNSPEC_USHL_2S
UNSPEC_VSTRUCTDUMMY
@@ -4255,20 +4256,10 @@
;; The TLS ABI specifically requires that the compiler does not schedule
;; instructions in the TLS stubs, in order to enable linker relaxation.
;; Therefore we treat the stubs as an atomic sequence.
-(define_expand "tlsgd_small"
- [(parallel [(set (match_operand 0 "register_operand" "")
- (call (mem:DI (match_dup 2)) (const_int 1)))
- (unspec:DI [(match_operand:DI 1 "aarch64_valid_symref" "")] UNSPEC_GOTSMALLTLS)
- (clobber (reg:DI LR_REGNUM))])]
- ""
-{
- operands[2] = aarch64_tls_get_addr ();
-})
-
-(define_insn "*tlsgd_small"
+(define_insn "tlsgd"
[(set (match_operand 0 "register_operand" "")
(call (mem:DI (match_operand:DI 2 "" "")) (const_int 1)))
- (unspec:DI [(match_operand:DI 1 "aarch64_valid_symref" "S")] UNSPEC_GOTSMALLTLS)
+ (unspec:DI [(match_operand:DI 1 "aarch64_valid_symref" "S")] UNSPEC_TLSGD)
(clobber (reg:DI LR_REGNUM))
]
""