[AArch64][TLSLE][1/N] Rename SYMBOL_SMALL_TPREL to SYMBOL_TLSLE
Jiong Wang
jiong.wang@arm.com
Wed May 20 11:21:00 GMT 2015
For AArch64, TLS local-exec mode for all memory model (tiny/small/large)
is actually the same.
TLS LE Instruction generation depends on how big tls section is instead
of the memory model used.
The four instruction sequences we can implement based on relocations
provided:
sequence 1
==========
add t0, tp, #:tprel_lo12:x1 R_AARCH64_TLSLE_ADD_TPREL_LO12 x1
sequence 2
==========
add t0, tp, #:tprel_hi12:x1, lsl #12 R_AARCH64_TLSLE_ADD_TPREL_HI12 x2
add t0, #:tprel_lo12_nc:x1 R_AARCH64_TLSLE_ADD_TPREL_LO12_NC x2
sequence 2
==========
movz t0, #:tprel_g1:x3 R_AARCH64_TLSLE_MOVW_TPREL_G1 x3
movk t0, #:tprel_g0_nc:x3 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC x3
add t0, tp, t0
sequence 4
==========
movz t0, #:tprel_g2:x4 R_AARCH64_TLSLE_MOVW_TPREL_G2 x4
movk t0, #:tprel_g1_nc:x4 R_AARCH64_TLSLE_MOVW_TPREL_G1_NC x4
movk t0, #:tprel_g0_nc:x4 R_AARCH64_TLSLE_MOVW_TPREL_G0_NC x4
add t0, t0, tp
Under tiny model, we still can't use the simplest sequence 1, because
the allowed loadable segment size is 1M, while 12bit offset (4K) still
can't access.
While even under large model, if the tls-size is small than 4K, we still can use
the simplest sequence 1 for local-exec.
This is the first patch to cleanup TLSLE support which generalize
TLSE variable/marco name for all memory models.
OK for trunk?
2015-05-19 Marcus Shawcroft <marcus.shawcroft@arm.com>
Jiong Wang <jiong.wang@arm.com>
gcc/
* config/aarch64/aarch64-protos.h (arch64_symbol_type): Rename
SYMBOL_SMALL_TPREL to SYMBOL_TLSLE.
(aarch64_symbol_context): Ditto.
* config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Ditto.
(aarch64_expand_mov_immediate): Ditto.
(aarch64_print_operand): Ditto.
(aarch64_classify_tls_symbol): Ditto.
--
Regards,
Jiong
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename.patch
Type: text/x-diff
Size: 2408 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150520/3fbeb269/attachment.bin>
More information about the Gcc-patches
mailing list