From 984ce2243124f5286ec9b693a2c49baa2e72f3bd Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 4 Dec 2017 23:20:40 +0000 Subject: [PATCH] emit_x64: Arguments to MostSignificantBit and IsZero are 32-bit --- src/backend_x64/emit_x64.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend_x64/emit_x64.cpp b/src/backend_x64/emit_x64.cpp index a070d6a3..703836a4 100644 --- a/src/backend_x64/emit_x64.cpp +++ b/src/backend_x64/emit_x64.cpp @@ -578,7 +578,7 @@ void EmitX64::EmitLeastSignificantByte(RegAlloc& reg_alloc, IR::Block&, IR::Inst void EmitX64::EmitMostSignificantBit(RegAlloc& reg_alloc, IR::Block&, IR::Inst* inst) { auto args = reg_alloc.GetArgumentInfo(inst); - Xbyak::Reg64 result = reg_alloc.UseScratchGpr(args[0]); + Xbyak::Reg32 result = reg_alloc.UseScratchGpr(args[0]).cvt32(); // TODO: Flag optimization code->shr(result, 31); reg_alloc.DefineValue(inst, result); @@ -586,7 +586,7 @@ void EmitX64::EmitMostSignificantBit(RegAlloc& reg_alloc, IR::Block&, IR::Inst* void EmitX64::EmitIsZero(RegAlloc& reg_alloc, IR::Block&, IR::Inst* inst) { auto args = reg_alloc.GetArgumentInfo(inst); - Xbyak::Reg64 result = reg_alloc.UseScratchGpr(args[0]); + Xbyak::Reg32 result = reg_alloc.UseScratchGpr(args[0]).cvt32(); // TODO: Flag optimization code->test(result, result); code->sete(result.cvt8());