Skip to content

Commit

Permalink
Add support for AArch64 FreeBSD dynamic TLS (#87)
Browse files Browse the repository at this point in the history
This change is necessary to support
php/php-src#11236 for IR JIT.
  • Loading branch information
nielsdos committed Jun 3, 2024
1 parent e87914b commit 97555e1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ir_aarch64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -5239,8 +5239,18 @@ static void ir_emit_tls(ir_ctx *ctx, ir_ref def, ir_insn *insn)
||#else
|| code = 0xd53bd040 | reg; // TODO: hard-coded: mrs reg, tpidr_el0
| .long code
||# ifdef __FreeBSD__
|| if (insn->op3 == IR_NULL) {
| ldr Rx(reg), [Rx(reg), #insn->op2]
|| } else {
| ldr Rx(reg), [Rx(reg), #0]
| ldr Rx(reg), [Rx(reg), #insn->op2]
| ldr Rx(reg), [Rx(reg), #insn->op3]
|| }
||# else
||//??? IR_ASSERT(insn->op2 <= LDR_STR_PIMM64);
| ldr Rx(reg), [Rx(reg), #insn->op2]
||# endif
||#endif
if (IR_REG_SPILLED(ctx->regs[def][0])) {
ir_emit_store(ctx, IR_ADDR, def, reg);
Expand Down

0 comments on commit 97555e1

Please sign in to comment.