From c7d6395aa65bece255ac8cfa19e04736baa85085 Mon Sep 17 00:00:00 2001 From: xctan Date: Fri, 9 Aug 2024 19:29:37 +0800 Subject: [RV64_DYNAREC] Fixed misused BNE_NEXT in emit_ro{l,r}32 (#1723) --- src/dynarec/rv64/dynarec_rv64_emit_shift.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dynarec/rv64/dynarec_rv64_emit_shift.c b/src/dynarec/rv64/dynarec_rv64_emit_shift.c index 62fc485b..ff202039 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; } } -- cgit 1.4.1