mirror of
https://github.com/danog/ir.git
synced 2025-01-22 05:31:32 +01:00
Fix 'mov' to/from 'sp' register
sp is shared with zero register and 'mov' for sp/xzr is encoded differently
This commit is contained in:
parent
ab50cc3f05
commit
9f81982d86
@ -1193,7 +1193,13 @@ static void ir_emit_mov(ir_ctx *ctx, ir_type type, ir_reg dst, ir_reg src)
|
||||
dasm_State **Dst = &data->dasm_state;
|
||||
|
||||
if (ir_type_size[type] == 8) {
|
||||
| mov Rx(dst), Rx(src)
|
||||
if (dst == IR_REG_STACK_POINTER) {
|
||||
| mov sp, Rx(src)
|
||||
} else if (src == IR_REG_STACK_POINTER) {
|
||||
| mov Rx(dst), sp
|
||||
} else {
|
||||
| mov Rx(dst), Rx(src)
|
||||
}
|
||||
} else {
|
||||
| mov Rw(dst), Rw(src)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user