diff options
| author | xctan <xctan@cirno.icu> | 2024-08-09 19:29:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-09 13:29:37 +0200 |
| commit | c7d6395aa65bece255ac8cfa19e04736baa85085 (patch) | |
| tree | ceb55030425553bc665fd0cbfca857808651daca /src | |
| parent | 649a65b8ee52a659d15420c034d1ce3130bbedb1 (diff) | |
| download | box64-c7d6395aa65bece255ac8cfa19e04736baa85085.tar.gz box64-c7d6395aa65bece255ac8cfa19e04736baa85085.zip | |
[RV64_DYNAREC] Fixed misused BNE_NEXT in emit_ro{l,r}32 (#1723)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_emit_shift.c | 10 |
1 files 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; } } |