Files
FEX-Emu--FEX/unittests/ASM/DAZTest.asm
T
Ryan Houdek 7937b7e52d unittests: Fixes mixture of code and data in the same page
Test behaviour themselves not changed at all, just data moved or
aligned.

For tests that aren't explicitly testing out SMC behaviour, we were
accidentally relying on some aggressive SMC tracking by mixing data and
code in the same page. To fix this just align the test's data to the
next page boundary which means FEX's SMC tracking won't get triggered
since it is no longer living in the same page.

This has been a thorn for a while, so just get rid of it. We obviously
still have ASM tests that still exist that /do/ rely on SMC, and those
are still expected to work.
2025-10-20 16:46:36 -07:00

38 lines
696 B
NASM

%ifdef CONFIG
{
"HostFeatures": ["AFP", "AVX"],
"RegData": {
"XMM0": ["0x0108000040e00000", "0xd1d2d3d4d5d6d7d8", "0", "0"],
"XMM1": ["0x00cfffff40e00000", "0xd1d2d3d4d5d6d7d8", "0", "0"]
}
}
%endif
vmovaps ymm1, [rel .data_three]
vmovaps ymm2, [rel .data_four]
; Do an add without DAZ
vaddps xmm0, xmm1, xmm2
; Set DAZ
stmxcsr [rel .data_mxcsr]
or dword [rel .data_mxcsr], (1 << 6)
ldmxcsr [rel .data_mxcsr]
; Do an add with DAZ
vaddps xmm1, xmm1, xmm2
hlt
align 4096
.data_three:
dd 3.0, 0x00cfffff
dq 0xa1a2a3a4a5a6a7a8, 0xb1b2b3b4b5b6b7b8, 0xc1c2c3c4c5c6c7c8
.data_four:
dd 4.0, 0x00400000
dq 0xd1d2d3d4d5d6d7d8, 0xe1e2e3e4e5e6e7e8, 0xf1f2f3f4f5f6f7f8
.data_mxcsr:
dd 0