Add support for Windows TLS

This commit is contained in:
Dmitry Stogov 2023-03-07 13:02:44 +03:00
parent 5e13d47e38
commit 6e1848cb40

View File

@ -6993,7 +6993,17 @@ static void ir_emit_tls(ir_ctx *ctx, ir_ref def, ir_insn *insn)
return;
}
|.if X64
|.if X64WIN
| gs
| mov Ra(reg), aword [0x58]
| mov Ra(reg), aword [Ra(reg)+insn->op2]
| mov Ra(reg), aword [Ra(reg)+insn->op3]
|.elif WIN
| fs
| mov Ra(reg), aword [0x2c]
| mov Ra(reg), aword [Ra(reg)+insn->op2]
| mov Ra(reg), aword [Ra(reg)+insn->op3]
|.elif X64
| fs
|| if (!insn->op3) {
| mov Ra(reg), aword [insn->op2]