mirror of
https://github.com/libretro/parallel-ps2.git
synced 2026-11-10 17:26:34 -10:00
R5900: use the portable FP control register API
libretro-build-linux-aarch64 and libretro-build-osx-arm64 both die here, and it is the only error in either job - 154 objects compile before it: pcsx2/R5900.cpp:18:10: fatal error: xmmintrin.h: No such file or directory The include is unconditional, and the only thing it was needed for is the MXCSR save/restore around the audit path's Execute(). common/FPControl.h already abstracts exactly that - "MXCSR on x86, and FPCR on AArch64" - and has a full AArch64 branch, so use GetCurrent()/SetCurrent() instead. Passing the FPControlRegister rather than its .bitmask keeps this off the member, which is u32 on x86 and u64 on AArch64. Config.h already includes common/FPControl.h, so no new include is needed. No x86 behaviour change: GetCurrent()/SetCurrent() are _mm_getcsr()/_mm_setcsr() there.
This commit is contained in:
1 parent
dbf1ea965f
commit
8c81f41141
1 file changed
+3
-4
+3
-4
@@ -15,7 +15,6 @@
|
||||
|
||||
|
||||
#include <retro_atomic.h>
|
||||
#include <xmmintrin.h>
|
||||
#include <cstring> /* memset */
|
||||
#include <compat/strl.h>
|
||||
|
||||
@@ -737,8 +736,8 @@ void ps2_audit_ee_exec(int use_interp, unsigned char* regs_io, unsigned ninstr)
|
||||
}
|
||||
else
|
||||
{
|
||||
const u32 host_csr = _mm_getcsr();
|
||||
_mm_setcsr(EmuConfig.Cpu.FPUFPCR.bitmask);
|
||||
const FPControlRegister host_fpcr = FPControlRegister::GetCurrent();
|
||||
FPControlRegister::SetCurrent(EmuConfig.Cpu.FPUFPCR);
|
||||
/* The exit fires at the first block-boundary event test at or
|
||||
* beyond nextEventCycle; multi-block programs (branches jump
|
||||
* between blocks with event tests in between) need a cycle
|
||||
@@ -746,7 +745,7 @@ void ps2_audit_ee_exec(int use_interp, unsigned char* regs_io, unsigned ninstr)
|
||||
Cpu->ExitExecution();
|
||||
cpuRegs.nextEventCycle = cpuRegs.cycle + ninstr * 2 + 64;
|
||||
Cpu->Execute();
|
||||
_mm_setcsr(host_csr);
|
||||
FPControlRegister::SetCurrent(host_fpcr);
|
||||
}
|
||||
cpuRegs.pc = old_pc;
|
||||
cpuRegs.nextEventCycle = old_cycle_target;
|
||||
|
||||
Reference in new issue
Block a user