- LLVM can't handle the select pattern we use to avoid poison values for large shifts
- So let's just use the intrinsic to avoid poison values altogether for now
- https://github.com/llvm/llvm-project/issues/200698
Fully implements cellSysmodule and sets it to HLE by default.
There is an undocumented function that decrypts the OpenPSID. There
doesn't seem to be any information about this on the PS3 dev wiki or
anywhere else, so I thought I mention this separately.
Refactored `SHUFB` by moving the byteswap optimization prior to the target specific path. Also separated the shuffle and special index constants calculation into separate steps in order to reduce code duplication.
Added a number of TODOs as this refactor revealed some of optimizations opportunities. None of which has been added as this refactor intends to minimize new behavior.
The "Fill more block info" re-decode indexed result.data[(ia - lsa) / 41] instead of / 4 (its companion decode uses / 4), so it read the wrong word and corrupted the per-block reg_const / reg_val32 constant propagation.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Giga cleanup clears m_block_info for removed blocks but left their in-range edges in m_targets, so the register-state walk dereferenced a stale target and aborted ("Range check failed") - e.g. a brsl whose return is a stop-trap, hit in Skylanders Giants. Prune those edges at the m_targets cleanup; export out_target_list after the prune so callers see the cleaned map; keep the initiate_patterns and cond_next-walk guards as defense in depth.
Adds made-up-data regression tests (the exported-map test fails without the prune) and the rpcs3_test.vcxproj entry.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The `FREST` instruction uses a scalar lookup-table loop to calculate the
mantissa. Given that it's only 32 elements, we can load it into two
512-bit vectors and treat them as the sources to the `vperm2d` shuffle
instruction. This allows it to be calculated in parallel, improving its
performance.
The `FRSQEST` instruction uses a lookup-table to calculate both the
exponent and mantissa. The exponent follows a simple linear pattern and
thus can be calculated using integer arithmetic: `(exponent==0)? 0xFF :
190 - (exponent + 1) / 2`. This patch replaces the LUT with this method,
vectorizing its calculating and saving on 1kB.
The mantissa still relies on a LUT, which bottlenecks this instruction's
emulation despite the improvement.
- Added a LLVM SPU recompiler implementation as LLVM can't take advantage of the rounding mode.
- Further optimized the method by replacing MSB check with saturation subtraction. Negative values are saturated to zero due to the float's sign bit.
Removed the SSE4.1 instruction to make it compatible with the baseline instruction set. Increased dependency chain by one instruction and caused constant generation to be slightly more expensive.