diff options
| author | robot00f <robot00f@users.noreply.github.com> | 2026-11-26 01:08:55 -0300 |
|---|---|---|
| committer | robot00f <robot00f@users.noreply.github.com> | 2026-11-27 18:49:10 -0300 |
| commit | b6e51b737674beebef48d4945a474aa38c862eed (patch) | |
| tree | 5a4e9656d6fb4f17fcc3c79c23ba16267e5ae9bf /tests/test_run_gpu_tests_python_assembler.py | |
| parent | 4ba23637e32f320427a4eef540eef14165aba19e (diff) | |
runtime(cpu): emulate F16C, FMA3 and AVX2 via XSTATE_AVX on AVX1 hosts
Add runtime/src/avx2_emulation.h and wire it into gta6rt so pre-Haswell AVX1 +
SSE4.2 CPUs (Intel Sandy Bridge and Ivy Bridge) can execute the game's vector
Haswell instruction delta using the host's native 256-bit YMM0..YMM15 state:
- Read and write 256-bit YMM registers through CONTEXT::FltSave.XmmRegisters
(bits [127:0]) and LocateXStateFeature(XSTATE_AVX) (bits [255:128]), zeroing
YMM[dst][255:128] on every 128-bit VEX register write and zero-initializing
untouched upper lanes when transitioning XSTATE_MASK_AVX from clean (0).
- Emulate F16C (vcvtph2ps, vcvtps2ph with RN/RD/RU/RZ and MXCSR rounding), all
60 FMA3 forms (132/213/231 packed 128/256, scalar ss/sd preserving [127:32] /
[127:64], and alternating fmaddsub/fmsubadd) via single-rounding std::fmaf /
std::fma, and AVX2 (256-bit integer SIMD promotions, register/memory
vbroadcastss/sd/i128 and vpbroadcastb/w/d/q, vinserti128, vextracti128,
vperm2i128, vpermq, vpermpd, vpermd, vpermps, vpblendd/w/vb, vpsllv*/vpsrlv*/
vpsravd, vpmovsx*/vpmovzx*, vpmovmskb, and per-lane fault-accurate
vpmaskmovd/vpmaskmovq).
- Add runtime/test/avx2_emulation_test.cpp covering IEEE-754 F16C conversions,
VEX decoding, XSTATE_AVX + VPMASKMOVD page-boundary semantics, and live
256-bit YMM execution on hardware.
Depends on: #2190
Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7181466437
AI-assisted: yes (Antigravity, Gemini 4 Carbon)
Diffstat (limited to 'tests/test_run_gpu_tests_python_assembler.py')
0 files changed, 0 insertions, 0 deletions