Commit graph

6986 commits

Author SHA1 Message Date
Wunkolo c428d79e18 [a64] Refactor thunk prolog/epilog 2024-06-23 14:00:23 -07:00
Wunkolo 9ec4b68cae [a64] Optimize Volatile/NonVolatile push/pop 2024-06-23 14:00:23 -07:00
Wunkolo 17987ca755 [a64] Use X4 for address-generation veneer 2024-06-23 14:00:23 -07:00
Wunkolo 9b70ea07ef [a64] Draft Windows-ARM64 stack unwinding data
Things still get weird at the thunks, but this allows for callstacks between-to-guest calls
2024-06-23 14:00:23 -07:00
Wunkolo a1741bf609 [a64] Pad code cache with 0x00 bytes 2024-06-23 14:00:23 -07:00
Wunkolo dfa5bdbafb [a64] Fix ResolveFunctionThunk call
Resolving the function puts it into X0 and should be called immediately after.

We were just calling ResolveFunction on ResolveFunction recursively
2024-06-23 14:00:23 -07:00
Wunkolo 65288d5796 [a64] Fix resetting of labels during Emplace
On the x64 side, this is the same as the `reset()` function resetting the label-manager
2024-06-23 14:00:23 -07:00
Wunkolo 5b8ac36aa6 [a64] Fix ResolveFunction thunk
Register was getting stomped over
2024-06-23 14:00:23 -07:00
Wunkolo 725ea3d08c [a64] Implement control sequences
Implements control sequences such as conditional branching, breaking, and trapping
2024-06-23 14:00:23 -07:00
Wunkolo 8257740d21 [a64] Implement HIR Branch labeling
Adds support for HIR labels to create actual oaknut labels
2024-06-23 14:00:23 -07:00
Wunkolo e5fd3d340c [a64] Implement OPCODE_PACK(SHORT)
Fails unit tests due to subtle rounding errors

`SHORT_4` unit-test is missing but implementation is the same as `SHORT_4`
2024-06-23 14:00:23 -07:00
Wunkolo 3b2612bfc0 [a64] Implement OPCODE_PACK(FLOAT16)
Fails the unit tests due to subtle rounding errors
2024-06-23 14:00:23 -07:00
Wunkolo e62f3f31d4 [a64] Fix native vector calls
Arguments need to be pointers stored in X0, X1, X2, ... rather than bassed directly in Q0, Q1 etc.

There are no unit tests for these functions in particular.
2024-06-23 14:00:23 -07:00
Wunkolo 35e8a809b1 [a64] Implement OPCODE_VECTOR_ADD
There is quite literally an instruction for each and every one of these cases.

Passes unit tests
2024-06-23 14:00:23 -07:00
Wunkolo 584c34cbd6 [a64] Implement OPCODE_VECTOR_MAX
Passes unit tests
2024-06-23 14:00:22 -07:00
Wunkolo ebd1f84d25 [a64] Implement OPCODE_VECTOR_MIN
Passes unit tests
2024-06-23 14:00:22 -07:00
Wunkolo 3ac51212a6 [a64] Implement OPCODE_VECTOR_ROTATE_LEFT
Uses the emulated fallback for now. Will have to come back to this later. Passes unit tests.
2024-06-23 14:00:22 -07:00
Wunkolo 7feea4c60c [a64] Implement OPCODE_VECTOR_{SHR,SHA}
Passes all unit tests
2024-06-23 14:00:22 -07:00
Wunkolo 88ed113541 [a64] Remove volatile storing of X0/Q0
We dont load it back so no need to store it
2024-06-23 14:00:22 -07:00
Wunkolo 07a4df8e2f [a64] Implement OPCODE_VECTOR_SHL
Vector registers are passed as pointers rather than directly in the `Qn` registers. So these functions should be taking pointer-type arguments rather than vector-register types directly.

Fixes `OPCODE_VECTOR_SHL` and passes unit tests.
2024-06-23 14:00:22 -07:00
Wunkolo 3d345d71a7 [a64] Fix overwriting of return-value registers
These are stomping over X0 and Q0 which is returning input argument registers as return values.
Fixes some guest-to-host calls.
2024-06-23 14:00:22 -07:00
Wunkolo 6a0e6a9ca9 [a64] Fix indirect and external calls 2024-06-23 14:00:22 -07:00
Wunkolo 8aa4b9372a [a64] Fix memory address generation 2024-06-23 14:00:22 -07:00
Wunkolo 124f684987 [a64] Fix Guest-To-Host native calls
These calls need to preserve and restore the `lr` register.

Unit tests all run now!
2024-06-23 14:00:22 -07:00
Wunkolo defb68eae2 [a64] Fix StackLayout
Wrong register index and vector-register size
2024-06-23 14:00:22 -07:00
Wunkolo 10cba8e166 [a64] Implement OPCODE_{SHR,SHA} 2024-06-23 14:00:22 -07:00
Wunkolo 67706824c6 [a64] Implement OPCODE_VECTOR_SHA 2024-06-23 14:00:22 -07:00
Wunkolo 72380bf833 [a64] Implement OPCODE_PACK(D3DCOLOR) 2024-06-23 14:00:22 -07:00
Wunkolo 1b574be0e6 [a64] Implement OPCODE_LOAD_VECTOR_SHR 2024-06-23 14:00:22 -07:00
Wunkolo 61feb6af74 [a64] Implement OPCODE_LOAD_VECTOR_SHL 2024-06-23 14:00:22 -07:00
Wunkolo 10310d7e2f [a64] Implement OPCODE_INSERT 2024-06-23 14:00:22 -07:00
Wunkolo 652b7a1370 [a64] Implement OPCODE_SPLAT 2024-06-23 14:00:22 -07:00
Wunkolo b9571cfda0 [a64] Implement OPCODE_EXTRACT 2024-06-23 14:00:22 -07:00
Wunkolo 39429aada7 [a64] Fix BYTE_SWAP_V128
This just reverses the bytes of 32-bit values, not reverse the whole vector.
2024-06-23 14:00:22 -07:00
Wunkolo 9960ef9deb [CPU] Implement ARM64 CPU backend
First pass framework that gets emitted ARM code executing.

Based on the x64 backend, implements an ARM64 JIT backend.
2024-06-23 14:00:22 -07:00
Wunkolo 2284ed417a [Base] Add ARM64 utility functions
Mostly element-accessors
2024-06-23 14:00:22 -07:00
Wunkolo 59bc265941 [a64] Integrate oaknut submodule
Header-only library for emitting arm64v8 instructions.

Enables C++20 only for the a64 backend for now
2024-06-23 14:00:22 -07:00
Wunkolo ffc966c9ea [CPU] Add ARM64 backend build target
Adds the new `xenia-cpu-backend-a64` build-target with linkage following the x64 backend.
2024-06-23 14:00:21 -07:00
Wunkolo a0f6cd7a49 [Build] Link SDL2 to xenia-app
Addresses a build issue that seems to occur now that xenia-app is not
getting SDL2 through one of its submodues
2024-06-23 13:48:17 -07:00
Wunkolo aa4a3e09e4 [UI] Fix divide-by-zero hazard
This value is currently returning `0` on ARM machines and throws an exception.
2024-04-28 19:09:28 -07:00
Wunkolo f2b05ead9d [CPU] Stub ARM64 to Null CPU backend
Adding the `a64` backend will be a different PR. For now it's stubbed to
the null backend to allow the main executable to open without failing
initalization.
2024-04-28 18:55:28 -07:00
Wunkolo 045441a305 [Base] Add Windows-ARM64 bit_count implementation
Uses intrinsics from https://learn.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics?view=msvc-170
2024-04-27 17:49:40 -07:00
Wunkolo fe9c98efac [CPU] Disable x64 backend on ARM64 2024-04-27 17:43:10 -07:00
Wunkolo f25484854c [Base] Disable AVX check on ARM64 2024-04-27 17:29:06 -07:00
Wunkolo b48ec84b3c [ImGui] Stub ARM64 host debug text
Marked as TODO for now
2024-04-27 17:26:42 -07:00
Wunkolo 1874f0c72f [CPU] Add Windows ARM64 stack-walker 2024-04-27 17:15:53 -07:00
Wunkolo a6d9113b21 [Base] Add Windows-ARM64 exception handling 2024-04-27 17:10:31 -07:00
Wunkolo 17461771ae [Build] Add Windows ARM64 support
Separates the `Windows` platform into `Windows-x86_64` and
`Windows-ARM64`. Adds `--arch` argument to `build`.
Removes x64 backend on non-x64 targets.
2024-04-27 16:45:46 -07:00
Gliniak f6b5424a9f [VFS] Fixed invalid month decoding in decode_fat_timestamp 2023-09-14 12:32:51 +03:00
Gliniak 0f331b5313 [Testing] Added test project for vfs
- Added test case for: decode_fat_timestamp
- Changed location of: decode_fat_timestamp
2023-09-14 12:32:51 +03:00