diff --git a/src/dynarec/rv64/dynarec_rv64_emit_shift.c b/src/dynarec/rv64/dynarec_rv64_emit_shift.c index 62fc485b7c..ff2020395b 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_shift.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_shift.c @@ -988,12 +988,13 @@ void emit_rol32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s } IFX(X_OF) { // the OF flag is set to the exclusive OR of the CF bit (after the rotate) and the most-significant bit of the result. - ADDI(s3, xZR, 1); - BNE_NEXT(s2, s3); + ADDI(s3, s2, -1); + BNEZ_MARK(s3); SRLIxw(s3, s1, rex.w?63:31); XOR(s3, s3, s4); // s3: MSB, s4: CF bit SLLI(s3, s3, F_OF2); OR(xFlags, xFlags, s3); + MARK; } } @@ -1044,14 +1045,15 @@ void emit_ror32(dynarec_rv64_t* dyn, int ninst, rex_t rex, int s1, int s2, int s } IFX(X_OF) { // the OF flag is set to the exclusive OR of the two most-significant bits of the result - ADDI(s3, xZR, 1); - BNE_NEXT(s2, s3); + ADDI(s3, s2, -1); + BNEZ_MARK(s3); SRLIxw(s3, s1, rex.w?63:31); SRLIxw(s4, s1, rex.w?62:30); XOR(s3, s3, s4); ANDI(s3, s3, 1); SLLI(s3, s3, F_OF2); OR(xFlags, xFlags, s3); + MARK; } }