Add simde
Add simde and include it in ppc_context.h, this means that recomp will need to link against simde.
According to @squidbus's testing, results in working x86_64 and ARM64 builds.
ah shoot i should have looked here before doing it myself
i'll give building a shot for you though
submodules giving me trouble
i literally cant check this out
Tried this locally for ARM, few notes:
UnleashedRecompLibover in the other repo does not link againstXenonUtils, so the includes are missing there forppc_context.h.- In
ppc_context.h:- Need to add
#include <x86/avx.h>. - Need to add
SIMDEprefix to rounding constants:static constexpr size_t GuestToHost[] = { SIMDE_MM_ROUND_NEAREST, SIMDE_MM_ROUND_TOWARD_ZERO, SIMDE_MM_ROUND_UP, SIMDE_MM_ROUND_DOWN }; - Missing
_MM_DENORMALS_ZERO_MASK, couldn't find an equivalent for this in simde code.
- Need to add
- In generated source:
_MM_FROUND_NO_EXCneeds to beSIMDE_MM_FROUND_NO_EXC, and same changes also for rounding constants mentioned previously.- Missing
__rdtsc.
I have a feeling the constants shouldn't need that renaming but for some reason it's not compiling otherwise for me.
Hmm i thought SIMDE_ENABLE_NATIVE_ALIASES would've taken care of those constants but no biggie. I might need your help for sorting out the linker issues.
Hmm i thought
SIMDE_ENABLE_NATIVE_ALIASESwould've taken care of those constants but no biggie. I might need your help for sorting out the linker issues.
In my current local code I'm able to compile an ARM64 build that works the same as my x86_64 build, with the above changes I mentioned.
For the UnleashedRecompLib thing specifically I am not sure if it's okay to just link it but that's what I did locally.
Excellent. Btw I sent you a message on Discord on shadPS4 server.
On SIMDE_ENABLE_NATIVE_ALIASES, from the readme in its repository:
Unfortunately, this is somewhat error-prone due to portability issues in the APIs, so it's recommended to only do this for testing.
It might be worth dropping that and sticking prefixes where appropriate, to avoid weird issues?
It might be worth dropping that and sticking prefixes where appropriate, to avoid weird issues?
It seems to be working for the intrinsics themselves, but yeah long term it shouldn't be a big deal to prefix the functions
Good news: Plugging this into UnleashedRecomp with a little tweakage seems to be working.
Bad news: Something in shader compilation territory seems to have blown up. I'm getting messages telling me to make an issue under DirectXShaderCompiler, but I don't have a clue how to write a proper report for that, if it's an issue there to begin with.
For ARM this seems to work for a __rdtsc substitute:
inline uint64_t __rdtsc()
{
uint64_t ret;
asm volatile("mrs %0, cntvct_el0\n\t"
: "=r"(ret)::"memory");
return ret;
}
Yep that does the job
Note there is another issue that simde doesn't handle _MM_DENORMALS_ZERO_MASK, and that denormal behavior is needed for the game to work properly in some places. Possibly can be worked around with platform-specific code.
Yeah some funky stuff happening with enemies falling out of bounds and audio cutting out might be a symptom of that
Submitted https://github.com/IsaacMarovitz/XenonRecomp/pull/1 to this branch to handle __rdtsc and denormal flushing.