mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-13 03:02:47 +00:00
![Ryan Houdek](/assets/img/avatar_default.png)
Implements CI for tracking instruction counts for generate blocks of code when transforming from x86 to ARM64 assembly. This will end up encompassing every instruction in our instruction tables similarly to how our assembly tests try to test everything in our instruction tables. Incidentally, the data for this CI is generated using our assembly tests. By enabling disassembly and instruction stats when executing a suite of instructions, this gives the stats that can be added to a json file. The current implementation only implements the SecondGroup table of instructions because it is a relatively small table and has known inefficiencies in the instruction implementations. As this gets merged I will be adding more tables of instructions to additional json files for testing. These JSON files will support adjusting CPU features regardless of the host features so it can test implementations depending on different CPU features. This will let us test things like one instruction having different "optimal" implementations depending on if it supports SVE128, SVE256, SVEI8MM, etc. This initial instruction auditing is what found the bug in our vector shift instructions by size of zero. If inspecting the result of the CI run, you can tell that these instructions still aren't "optimal" because they are doing loads and stores that can be eliminated. The "Optimal" in the JSON is purely for human readable and grepping ability to see what is optimal versus not. Same with the "Comment" section. According to my auditing spreadsheet, the total number of instructions that will end up in these json files will be about 1000, but we will likely end up with more since there will be edge cases that can be more optimal depending on arguments.
FEX Unit tests
FEX has its own test suite for x86-64 emulation, and we also use gcc's target tests, posixtest, and gvisor's tests. We use a combination of CMake/CTest and python runner scripts.
We also regularly run and pass qemu's and valgrind's tests for validation, but those aren't in CI right now.
x86/64 testing
- A lot of handwritten assembly unit tests in 32Bit_ASM and ASM folders, run via our TestHarnessHelper
- A few handwritten IR tests in IR, run via our IRLoader
- gcc-target-tests-32 and gcc-target-tests-64, run via FEXLoader. The tests binaries are in External/fex-gcc-target-tests-bins
Syscall testing
- 64-bit posixtest from http://posixtest.sourceforge.net/, run via FEXLoader. The tests binaries are in External/fex-posixtest-bins
- 64-bit gvisor tests from https://github.com/google/gvisor, run via FEXLoader. The tests binaries are in External/fex-gvisor-tests-bins