Skip to content

Commit 97555e1

Browse files
authored
Add support for AArch64 FreeBSD dynamic TLS (#87)
This change is necessary to support php/php-src#11236 for IR JIT.
1 parent e87914b commit 97555e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ir_aarch64.dasc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5239,8 +5239,18 @@ static void ir_emit_tls(ir_ctx *ctx, ir_ref def, ir_insn *insn)
52395239
||#else
52405240
|| code = 0xd53bd040 | reg; // TODO: hard-coded: mrs reg, tpidr_el0
52415241
| .long code
5242+
||# ifdef __FreeBSD__
5243+
|| if (insn->op3 == IR_NULL) {
5244+
| ldr Rx(reg), [Rx(reg), #insn->op2]
5245+
|| } else {
5246+
| ldr Rx(reg), [Rx(reg), #0]
5247+
| ldr Rx(reg), [Rx(reg), #insn->op2]
5248+
| ldr Rx(reg), [Rx(reg), #insn->op3]
5249+
|| }
5250+
||# else
52425251
||//??? IR_ASSERT(insn->op2 <= LDR_STR_PIMM64);
52435252
| ldr Rx(reg), [Rx(reg), #insn->op2]
5253+
||# endif
52445254
||#endif
52455255
if (IR_REG_SPILLED(ctx->regs[def][0])) {
52465256
ir_emit_store(ctx, IR_ADDR, def, reg);

0 commit comments

Comments
 (0)