diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2023-03-26 04:23:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-25 21:23:46 +0100 |
| commit | 73264b2e80c8aeeb32d5121b0dc11284b4560cae (patch) | |
| tree | 36fce078d6ab43705ae79b2ea480d8b17521d1f8 /src | |
| parent | 567d48f813d383fd8a7c69878c9da4b7276aa1fd (diff) | |
| download | box64-73264b2e80c8aeeb32d5121b0dc11284b4560cae.tar.gz box64-73264b2e80c8aeeb32d5121b0dc11284b4560cae.zip | |
[RV64_DYNAREC] Fixes and some optims (#638)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_66.c | 2 | ||||
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_emit_tests.c | 6 | ||||
| -rw-r--r-- | src/dynarec/rv64/dynarec_rv64_helper.h | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c index 1caf2a74..c59325e2 100644 --- a/src/dynarec/rv64/dynarec_rv64_66.c +++ b/src/dynarec/rv64/dynarec_rv64_66.c @@ -326,7 +326,7 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni GETEW(x1, (opcode==0x81)?2:1); if(opcode==0x81) i16 = F16S; else i16 = F8S; if(i16) { - MOV64xw(x2, i16); + MOV64x(x2, i16); emit_cmp16(dyn, ninst, x1, x2, x3, x4, x5, x6); } else emit_cmp16_0(dyn, ninst, x1, x3, x4); diff --git a/src/dynarec/rv64/dynarec_rv64_emit_tests.c b/src/dynarec/rv64/dynarec_rv64_emit_tests.c index 16a580da..e60ff103 100644 --- a/src/dynarec/rv64/dynarec_rv64_emit_tests.c +++ b/src/dynarec/rv64/dynarec_rv64_emit_tests.c @@ -107,8 +107,10 @@ void emit_cmp16(dynarec_rv64_t* dyn, int ninst, int s1, int s2, int s3, int s4, // It's a cmp, we can't store the result back to s1. SUB(s6, s1, s2); - SLLI(s6, s6, 48); - SRLI(s6, s6, 48); + IFX(X_ALL) { + SLLI(s6, s6, 48); + SRLI(s6, s6, 48); + } IFX_PENDOR0 { SH(s6, xEmu, offsetof(x64emu_t, res)); } diff --git a/src/dynarec/rv64/dynarec_rv64_helper.h b/src/dynarec/rv64/dynarec_rv64_helper.h index 223fc5a3..4d6a1044 100644 --- a/src/dynarec/rv64/dynarec_rv64_helper.h +++ b/src/dynarec/rv64/dynarec_rv64_helper.h @@ -451,7 +451,11 @@ /* cf = bc & (1<<(width-1)) */ \ if ((width) == 8) { \ ANDI(scratch1, scratch2, 0x80); \ + } else if ((width) == 16) { \ + SLLI(scratch2, scratch2, 48); \ + SRLI(scratch1, scratch2, 63); \ } else { \ + if ((width) == 32) { ZEROUP(scratch2); } \ SRLI(scratch1, scratch2, (width)-1); \ if(width!=64) ANDI(scratch1, scratch1, 1); \ } \ |