LoongArch: Add tls transition support.
Transitions between DESC->IE/LE and IE->LE are supported now. 1. For DESC -> LE: pcalau12i $a0,%desc_pc_hi20(var) => lu12i.w $a0,%le_hi20(var) addi.d $a0,$a0,%desc_pc_lo12(var) => ori $a0,$a0,%le_lo12(var) ld.d $a1,$a0,%desc_ld(var) => NOP jirl $ra,$a1,%desc_call(var) => NOP add.d $a0,$a0,$tp 2. For DESC -> IE: pcalau12i $a0,%desc_pc_hi20(var) => pcalau12i $a0,%ie_pc_hi20(var) addi.d $a0,$a0,%desc_pc_lo12(var) => ld.d $a0,$a0,%ie_pc_lo12(var) ld.d $a1,$a0,%desc_ld(var) => NOP jirl $ra,$a1,%desc_call(var) => NOP add.d $a0,$a0,$tp 3. For IE -> LE: pcalau12i $a0,%ie_pc_hi20(var) => lu12i.w $a0,%le_hi20(var) ld.d $a0,$a0,%ie_pc_lo12(var) => ori $a0,$a0,%le_lo12(var) add.d $a0,$a0,$tp 4. When a tls variable is accessed using both DESC and IE, DESC transitions to IE and uses the same GOT entry as IE.
This commit is contained in:
@@ -42,6 +42,12 @@ extern "C"
|
||||
((value) < (-(1 << ((bits) - 1) << align)) \
|
||||
|| (value) > ((((1 << ((bits) - 1)) - 1) << align)))
|
||||
|
||||
#define LARCH_LU12I_W 0x14000000
|
||||
#define LARCH_ORI 0x03800000
|
||||
#define LARCH_LD_D 0x28c00000
|
||||
#define LARCH_RD_A0 0x04
|
||||
#define LARCH_RD_RJ_A0 0x084
|
||||
|
||||
typedef uint32_t insn_t;
|
||||
|
||||
struct loongarch_opcode
|
||||
|
||||
Reference in New Issue
Block a user