The XSAVE feature set supports the saving and restoring of xstate components. XSAVE feature has been used for process context switching. Xstate components include x87 state for FP execution environment, SSE state, AVX state and so on.
In order to ensure that XSAVE works correctly, add XSAVE most basic test for XSAVE architecture functionality.
From page 21 of ABI(Application Binary Interface) specification: https://refspecs.linuxbase.org/elf/x86_64-abi-0.99.pdf Xstate like XMM is not preserved across function calls, so fork() function which provided from libc could not be used in the xsave test, and the libc function is replaced with an inline function of the assembly code only.
To prevent GCC from generating any FP/SSE(XMM)/AVX/PKRU code by mistake, add "-mno-sse -mno-mmx -mno-sse2 -mno-avx -mno-pku" compiler arguments. stdlib.h can not be used because of the "-mno-sse" option.
make ./xstate_64 It tests "FP, SSE(XMM), AVX2(YMM), AVX512_OPMASK/AVX512_ZMM_Hi256/ AVX512_Hi16_ZMM and PKRU parts" xstates with the following cases:
All test results should show pass, no fail.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。