From 6759942b562f22aa2c0d7a020165cab7e2b76ada Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 27 Apr 2021 18:51:23 +0100 Subject: [PATCH] emit_x64_data_processing: Correct bug in ArithmeticShiftRight64 This branch of this implementation is unused, and thus has not been tested. --- src/backend/x64/emit_x64_data_processing.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/x64/emit_x64_data_processing.cpp b/src/backend/x64/emit_x64_data_processing.cpp index 58f97faa..80924a5a 100644 --- a/src/backend/x64/emit_x64_data_processing.cpp +++ b/src/backend/x64/emit_x64_data_processing.cpp @@ -681,7 +681,7 @@ void EmitX64::EmitArithmeticShiftRight64(EmitContext& ctx, IR::Inst* inst) { // We note that all shift values above 63 have the same behaviour as 63 does, so we saturate `shift` to 63. code.mov(const63, 63); code.cmp(code.cl, u32(63)); - code.cmovg(code.ecx, const63); + code.cmovnb(code.ecx, const63); code.sar(result, code.cl); ctx.reg_alloc.DefineValue(inst, result);