diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-04-22 17:14:13 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-04-22 17:14:13 +0200 |
| commit | 8c19c3a72c7f163e29f7da858c610b79e238dfc9 (patch) | |
| tree | f1ef93c4083e8f4aa9fb345fc3c06cbbbd9cc0ae /src | |
| parent | c017d3e8941192080472385e337a4bee074d4b1f (diff) | |
| download | box64-8c19c3a72c7f163e29f7da858c610b79e238dfc9.tar.gz box64-8c19c3a72c7f163e29f7da858c610b79e238dfc9.zip | |
[INTERPRETER] Improved SSE4.2 String opcodes, and improved test27
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/x64compstrings.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/emu/x64compstrings.c b/src/emu/x64compstrings.c index 41216a26..007c711e 100644 --- a/src/emu/x64compstrings.c +++ b/src/emu/x64compstrings.c @@ -81,8 +81,14 @@ uint32_t sse42_compare_string_explicit_len(x64emu_t* emu, sse_regs_t* mem, int l intres1 = (1<<n_packed)-1; for(int j=0; j<n_packed; ++j) for(int i=0; i<n_packed-j; ++i) { - int k = i+j; - intres1 &= (((1<<n_packed)-1)^(1<<j)) | overrideIfDataInvalid(mem, lmem, reg, lreg, k, i, imm8)<<j; + #if 1 + if(!overrideIfDataInvalid(mem, lmem, reg, lreg, i+j, i, imm8)) { + intres1 &= ~(1<<j); + break; + } + #else + intres1 &= (((1<<n_packed)-1)^(1<<j)) | (overrideIfDataInvalid(mem, lmem, reg, lreg, i+j, i, imm8)<<j); + #endif } break; } @@ -98,7 +104,7 @@ uint32_t sse42_compare_string_explicit_len(x64emu_t* emu, sse_regs_t* mem, int l CONDITIONAL_SET_FLAG(lmem<n_packed, F_ZF); CONDITIONAL_SET_FLAG(lreg<n_packed, F_SF); CONDITIONAL_SET_FLAG(intres2&1, F_OF); - CLEAR_FLAG(F_AF); + CONDITIONAL_SET_FLAG(((!intres2) && (lmem==n_packed)), F_AF); CLEAR_FLAG(F_PF); return intres2; |