And default ignore_thread_priorities to false.
Map Xenon's 0-31 priority range across all 5 host priority levels
instead of collapsing 0-17 into kNormal.
Use timer-driven quantum decay (~20ms period) matching Xenon's
60-quantum / 3-per-tick cycle to prevent starvation by gradually lowering
effective priority for non-real-time threads (< 18), piggybacking on the
existing 1ms timestamp timer.
Spinlock acquire now checks if the lock holder shares the same guest
CPU and yields more aggressively (Sleep(0)) when contending on the
same Xenon HW thread, which should better approximate real kernel's
implicit serialization.
Child threads without an explicit affinity mask now inherit the
parent's guest CPU assignment instead of round-robining, so the
spinlock check correctly identifies parent-child co-location.
Stall detection was triggering during multi-pass subframe consumption
(e.g. stereo with subframe_decode_count < total subframes), breaking
audio looping in games like Tomb Raider. Now only detects a stall when
no subframes were pending, so Consume-only iterations aren't mistaken
for no-progress cycles. Fixes Halo 4 without regressing Tomb Raider.
Detect dependent `AND` and `NOT` IR sequences and combine them into a
singular `AND_NOT` opcode. The later dead-code-elimination-pass will
get rid of the left-over `NOT` opcode if nothing else uses it.
This gets quite a good amount of hits in some of the titles I've tested.
Also updates unit tests with additional data-types and ensures that
`And(..., Not())` returns the same result as `AndNot(...)`
- DIV_I32/I64 and MUL_HI_I64: use source registers directly in
sdiv/udiv/umulh/smulh instead of copying to scratch first
- SWIZZLE: fast paths for identity (no-op), broadcast (dup), and
pair-swap (rev64) before falling back to general TBL
- LOAD_VECTOR_SHL/SHR: build base index vector with fmov+ins
instead of stp+ldr stack round-trip
Replace per-op save/restore of FPCR in EmitWithVmxFpcr with tracked
lazy switching via ChangeFpcrMode. Consecutive VMX float ops in the
same basic block now emit a single FPCR switch instead of one per op.
ChangeFpcrMode loads pre-computed values from the backend context
(fpcr_fpu/fpcr_vmx) instead of MRS + read-modify-write, eliminating
an expensive system register read per switch.
FPU mode is restored at block boundaries and calls via ForgetFpcrMode.
Scalar FP sequences guard with ChangeFpcrMode(Fpu) which is a no-op
when already in FPU mode.
The LSE paths in RESERVED_STORE_I32/I64 returned early from Emit,
leaving forward-referenced no_reserve/done labels unbound. Xbyak
encodes these as offset-zero branches (branch-to-self), causing
infinite loops when the reservation check fails on LSE hardware.
Replace early return with branch-to-done inside an if/else so
labels are always bound regardless of the LSE path taken.
Adds tests for RESERVED_STORE I64 success path and I32/I64
no-reservation failure path with timeout-based hang detection.
* Add unit tests
* Use `dc zva` to zero out entire cache-lines worth of data, when possible
* Special instruction that zaps an entire cache-line into being zero-values, typically 64-bytes at a time
* Statically read and initialize the `DCZID_EL0` register value since reading registers with `mrs` can be kinda slow and isn't worth doing redundantly at JIT-time when it never changes.
* Update store-instructions to use inline post-increments to avoid an additional `add` instruction and keep encoded instruction immediates small
Pretty much every arm processor has a cache line size of 64 bytes, so a typical `dcbz128` to clear 128-bytes of data now results in:
```
dc zva, x0
add x0, x0, 64
dc zva, x0
```
rather than a sequence of 8 `stp xzr, xzr, ...` instructions
Pack(1) causes unaligned pointer errors on ARM64 with Apple's linker.
These are static read-only tables where the ~9KB size savings from
packing is negligible. Removing the pack may also marginally improve
access speed on x86 by avoiding unaligned loads.
ffmpeg: macOS uses "_" symbol prefix (Mach-O), has no <malloc.h>,
and doesn't support .data.rel.ro sections. Add __APPLE__ guards
in ffmpeg-xenia/config.h.
sha256: macOS provides endian macros in <machine/endian.h> instead
of <endian.h>.
Replace Linux-specific fstat64/ftruncate64 with portable POSIX equivalents.
Fix mmap error check to use MAP_FAILED instead of null pointer comparison.
Remove unconditional ftruncate after mmap that could corrupt files.
Add zero-length guard.
Replace Linux-specific fseeko64/ftello64/ftruncate64 with portable
POSIX equivalents.
Fix pread/pwrite error handling that assigned -1 to unsigned size_t.
Implement SetAttributes via chmod instead of stubbing it out.
Fix potential overflow in Unix-to-Windows filetime conversion.
Clean up unused removeCallback.
Most non-Windows code paths use standard POSIX APIs (sockets, signals,
dlopen, threading) that work on any POSIX platform. Change Linux-specific
guards to !WIN32 or #else where the code is portable. Linux-specific
APIs (SIGRTMIN, Vulkan/X11, fontconfig/GTK) remain Linux-guarded.
GTK3, system SDL2 (pkg-config), Linux link libraries, linker groups,
and _GLIBCXX_DEBUG were in the generic non-MSVC branch, breaking
cmake configure on non-Linux POSIX platforms.
std::ctype<char16_t> is a non-standard extension that's not available
on all platforms. Neither this nor the original technically match the
Windows kernel's fixed Unicode table approach and can produce different
results based on system locale.
Optimize `LoadV128Const` to detect even more opportunities
to use `movi`, `mvni`, and `fmov` and such for 16-bit, 32-bit
and 64-bit splats.
Update some `mov`+`dup` idioms into `LoadV128Const` as well
to catch more opportunities to optimize these const-loads when
possible.
Remove 3.10 syntax sugar and reduce min required python version to avoid
having to do needless python upgrades on various dev systems as 3.10 is
not yet ubiquitous and building on older systems is also still a thing.
ffs() can collide with POSIX macro definitions on some platforms;
__builtin_ffs is the portable GCC/Clang intrinsic. log2_floor/log2_ceil
passed template types directly to lzcnt which has only uint32_t and
uint64_t overloads, causing implicit narrowing on smaller types.
zstd ships a hand-written huf_decompress_amd64.S that was being
disabled on all non-MSVC builds. New behavior matches zstd's own
CMakeLists which enables it on GCC/Clang x86_64 and disables it
on MSVC and non-x86 architectures.
PCLMULQDQ CRC folding is excluded for now due to a runtime hang on
Linux — needs further investigation. The library does runtime feature
detection so all other paths should be safe on CPUs without these extensions.