mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Save and restore used non-volatile XMM registers in prologue and epilogue.
We currently save only "single double" part of the registers using "movsd" instruction. In general, we should save and restore the whole XMM registers.
This commit is contained in:
parent
6b19fdb94f
commit
e2810c070e
10
ir_x86.dasc
10
ir_x86.dasc
@ -2061,7 +2061,10 @@ static void ir_emit_prologue(ir_ctx *ctx)
|
||||
offset -= sizeof(void*);
|
||||
| mov aword [Ra(fp)+offset], Ra(i)
|
||||
} else {
|
||||
IR_ASSERT(0 && "NIY FP register saing");
|
||||
ir_reg fp = (ctx->flags & IR_USE_FRAME_POINTER) ? IR_REG_FRAME_POINTER : IR_REG_STACK_POINTER;
|
||||
|
||||
offset -= sizeof(void*);
|
||||
| movsd qword [Ra(fp)+offset], xmm(i-IR_REG_FP_FIRST)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2090,7 +2093,10 @@ static void ir_emit_epilogue(ir_ctx *ctx)
|
||||
offset -= sizeof(void*);
|
||||
| mov Ra(i), aword [Ra(fp)+offset]
|
||||
} else {
|
||||
IR_ASSERT(0 && "NIY FP register saing");
|
||||
ir_reg fp = (ctx->flags & IR_USE_FRAME_POINTER) ? IR_REG_FRAME_POINTER : IR_REG_STACK_POINTER;
|
||||
|
||||
offset -= sizeof(void*);
|
||||
| movsd xmm(i-IR_REG_FP_FIRST), qword [Ra(fp)+offset]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user