This changes Dynarmic::A32/A64::Config to store fastmem_pointer in
a std::optional<uintptr_t>, allowing the user to pass a zero base
address for the guest memory, which can be used to effectively
implement a shared address space between the host and the guest.
Previously we just retrieved the last stored FPSR and used that when the guest asks for the current FPSR.
This is incorrect behaviour. We failed to take into account the current state of the host FPSR.
Here we take this into account. This bug was discovered via #795.
This situation occurs when RequestCacheInvalidation is called from
multiple threads. This results in unusual issues around memory
allocation which arise from concurrent access to invalid_cache_ranges.
There are several reasons for this:
1. No locking around the invalidation queue.
2. is_executing is not multithread safe.
So here we reduce any cache clear or any invalidation to raise a
CacheInvalidation halt, which we execute immediately before or
immediately after Run() instead.
This is a redo of https://github.com/merryhime/dynarmic/pull/690 with a
much smaller foot-print to introduce a new pattern while avoiding the
initial bugs
(5d9b720189)
**B**roadcasts a value as an **Xmm**-sized **Const**ant. Intended to
eventually encourage more hits within the constant-pool between vector
and non-vector code.
Dynarmic uses semantic versioning, restricting backwards-incompatible
changes to major releases. This backwards compatibility, though, refers
to API changes, and disregards ABI stability. Since having to maintain a
compatible ABI between major releases is somewhat of a pain, and it
arguably doesn't matter that much for dynarmic, setting the SOVERSION to
major.minor allows for breaking ABI changes to be made between feature
releases, and not only major ones.
To be clear, this patch doesn't try to enforce a new policy, but just
reflects how the project has handled ABI changes in the past. That is,
these kind of changes have been made already.
This patch comes as a fix for Debian bug <https://bugs.debian.org/1041270>.
Caught by UBSan. I don't think this has a meaningful performance impact
(especially since the thread state doesn't include floating-point/vector
registers), but I haven't tested it.