a64_emit_x64: bug: x64 sign-extends 32-bit immediates
This commit is contained in:
parent
6fc228f7fd
commit
54de64f5bf
1 changed files with 4 additions and 4 deletions
|
@ -261,8 +261,8 @@ void A64EmitX64::EmitA64SetQ(A64EmitContext& ctx, IR::Inst* inst) {
|
|||
void A64EmitX64::EmitA64SetSP(A64EmitContext& ctx, IR::Inst* inst) {
|
||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||
auto addr = qword[r15 + offsetof(A64JitState, sp)];
|
||||
if (args[0].FitsInImmediateU32()) {
|
||||
code->mov(addr, args[0].GetImmediateU32());
|
||||
if (args[0].FitsInImmediateS32()) {
|
||||
code->mov(addr, args[0].GetImmediateS32());
|
||||
} else if (args[0].IsInXmm()) {
|
||||
Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(args[0]);
|
||||
code->movq(addr, to_store);
|
||||
|
@ -275,8 +275,8 @@ void A64EmitX64::EmitA64SetSP(A64EmitContext& ctx, IR::Inst* inst) {
|
|||
void A64EmitX64::EmitA64SetPC(A64EmitContext& ctx, IR::Inst* inst) {
|
||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||
auto addr = qword[r15 + offsetof(A64JitState, pc)];
|
||||
if (args[0].FitsInImmediateU32()) {
|
||||
code->mov(addr, args[0].GetImmediateU32());
|
||||
if (args[0].FitsInImmediateS32()) {
|
||||
code->mov(addr, args[0].GetImmediateS32());
|
||||
} else if (args[0].IsInXmm()) {
|
||||
Xbyak::Xmm to_store = ctx.reg_alloc.UseXmm(args[0]);
|
||||
code->movq(addr, to_store);
|
||||
|
|
Loading…
Reference in a new issue