feat(asm): the TLS access pair in the toolchain's one-instruction form

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-09-21 21:35:15 +02:00
parent 8cfd40aac8
commit 7246b0e002
11 changed files with 180 additions and 21 deletions
+13
View File
@@ -192,6 +192,19 @@ func (e *enc) encodeMov(ops []Operand, size int) error {
}
return e.emit(i)
case TLSMem:
if !dstIsReg {
return fmt.Errorf("MOV: two memory operands")
}
// MOV r, off(TLS): the segment-prefixed absolute load, reg=dst,
// rm=src(tlsMem) through the SIB escape; the disp32 is the TLS slot
// offset with its R_TLSLE patch site.
i := newInstr(size, []byte{movRR(size)})
if err := setRM(i, dstReg, src, size); err != nil {
return err
}
return e.emit(i)
case Imm:
if dstIsReg {
v := int64(src)