From 277011575750d367b9360cf4f436c0773f78f57c Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 13 Apr 2020 19:43:31 +0100 Subject: [PATCH] emit_x64_data_processing: EmitMaskedShift: Use appropriately sized immediates --- src/backend/x64/emit_x64_data_processing.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/x64/emit_x64_data_processing.cpp b/src/backend/x64/emit_x64_data_processing.cpp index 8a640ff8..7959693a 100644 --- a/src/backend/x64/emit_x64_data_processing.cpp +++ b/src/backend/x64/emit_x64_data_processing.cpp @@ -736,9 +736,9 @@ static void EmitMaskedShift32(BlockOfCode& code, EmitContext& ctx, IR::Inst* ins if (shift_arg.IsImmediate()) { const Xbyak::Reg32 result = ctx.reg_alloc.UseScratchGpr(operand_arg).cvt32(); - const u8 shift = shift_arg.GetImmediateU8(); + const u32 shift = shift_arg.GetImmediateU32(); - shift_fn(result, shift & 0x1F); + shift_fn(result, static_cast(shift & 0x1F)); ctx.reg_alloc.DefineValue(inst, result); return; @@ -773,9 +773,9 @@ static void EmitMaskedShift64(BlockOfCode& code, EmitContext& ctx, IR::Inst* ins if (shift_arg.IsImmediate()) { const Xbyak::Reg64 result = ctx.reg_alloc.UseScratchGpr(operand_arg); - const u8 shift = shift_arg.GetImmediateU8(); + const u64 shift = shift_arg.GetImmediateU64(); - shift_fn(result, shift & 0x3F); + shift_fn(result, static_cast(shift & 0x3F)); ctx.reg_alloc.DefineValue(inst, result); return;