a64_emit_x64: bug: x64 sign-extends 32-bit immediates
This commit is contained in:
parent
9232be5553
commit
ac1f4d3d5d
@ -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…
x
Reference in New Issue
Block a user