#include "precomp.h"
#include <windows.h>
Go to the source code of this file.
|
#define | REG_COUNT_SSE 16 |
|
#define | REG_COUNT_AVX 16 |
|
#define | REG_COUNT_AVX512 32 |
|
#define | ok_eq_m128i(a, b) ok_eq_m128i_(a, b, #a, __LINE__) |
|
#define | ok_eq_m256i(a, b) ok_eq_m256i_(a, b, #a, __LINE__) |
|
#define | ok_eq_m512i(a, b) ok_eq_m512i_(a, b, #a, __LINE__) |
|
|
static VOID | AdjustAffinity (VOID) |
|
struct _DECLSPEC_INTRIN_TYPE | _CRT_ALIGN (16) |
|
struct _DECLSPEC_INTRIN_TYPE | _CRT_ALIGN (32) |
|
struct _DECLSPEC_INTRIN_TYPE | _CRT_ALIGN (64) |
|
void __fastcall | set_SSE_state (const M128U64 data[REG_COUNT_SSE]) |
|
void __fastcall | get_SSE_state (M128U64 data[REG_COUNT_SSE]) |
|
void __fastcall | set_AVX_state (const M256U64 data[REG_COUNT_AVX]) |
|
void __fastcall | get_AVX_state (M256U64 data[REG_COUNT_AVX]) |
|
void __fastcall | set_AVX512_state (const M512U64 data[REG_COUNT_AVX512]) |
|
void __fastcall | get_AVX512_state (M512U64 data[REG_COUNT_AVX512]) |
|
BOOL | ok_eq_m128i_ (M128U64 a, M128U64 b, const char *variable, unsigned int line) |
|
BOOL | ok_eq_m256i_ (M256U64 a, M256U64 b, const char *variable, unsigned int line) |
|
BOOL | ok_eq_m512i_ (M512U64 a, M512U64 b, const char *variable, unsigned int line) |
|
ULONG64 | GenRandom64 (VOID) |
|
VOID | RandomFill128 (M128U64 *Data128, ULONG Count) |
|
VOID | RandomFill256 (M256U64 *Data256, ULONG Count) |
|
VOID | RandomFill512 (M512U64 *Data512, ULONG Count) |
|
static DWORD WINAPI | Thread_SSE (LPVOID Parameter) |
|
void | Test_SSE (void) |
|
static DWORD WINAPI | Thread_AVX (LPVOID Parameter) |
|
void | Test_AVX (void) |
|
static DWORD WINAPI | Thread_AVX512 (LPVOID Parameter) |
|
void | Test_AVX512 (void) |
|
| START_TEST (XStateSave) |
|
◆ ok_eq_m128i
◆ ok_eq_m256i
◆ ok_eq_m512i
◆ REG_COUNT_AVX
◆ REG_COUNT_AVX512
◆ REG_COUNT_SSE
◆ _CRT_ALIGN() [1/3]
◆ _CRT_ALIGN() [2/3]
◆ _CRT_ALIGN() [3/3]
◆ AdjustAffinity()
Definition at line 15 of file XStateSave.c.
16{
18
19
22 ok(OldAffinity != 0,
"SetThreadAffinityMask(0x%Ix) failed\n", NewAffinity);
23}
static ULONG s_ProcessorNumber
DWORD_PTR WINAPI SetThreadAffinityMask(IN HANDLE hThread, IN DWORD_PTR dwThreadAffinityMask)
HANDLE WINAPI GetCurrentThread(void)
Referenced by START_TEST(), Thread_AVX(), Thread_AVX512(), and Thread_SSE().
◆ GenRandom64()
◆ get_AVX512_state()
◆ get_AVX_state()
◆ get_SSE_state()
◆ ok_eq_m128i_()
Definition at line 59 of file XStateSave.c.
60{
62 ok_(__FILE__,
line)(
equal,
"Variable %s Expected %I64x %I64x, got %I64x %I64x\n",
65}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
◆ ok_eq_m256i_()
Definition at line 68 of file XStateSave.c.
69{
71 ok_(__FILE__,
line)(
equal,
"Variable %s Expected %I64x %I64x %I64x %I64x, got %I64x %I64x %I64x %I64x\n",
73 a.u64[3],
a.u64[2],
a.u64[1],
a.u64[0]);
75}
◆ ok_eq_m512i_()
Definition at line 78 of file XStateSave.c.
79{
81 ok_(__FILE__,
line)(
equal,
"Variable %s Expected %I64x %I64x %I64x %I64x %I64x %I64x %I64x %I64x, got %I64x %I64x %I64x %I64x %I64x %I64x %I64x %I64x\n",
83 b.u64[7],
b.u64[6],
b.u64[5],
b.u64[4],
84 b.u64[3],
b.u64[2],
b.u64[1],
b.u64[0],
85 a.u64[7],
a.u64[6],
a.u64[5],
a.u64[4],
86 a.u64[3],
a.u64[2],
a.u64[1],
a.u64[0]);
88}
◆ RandomFill128()
Definition at line 100 of file XStateSave.c.
101{
103 {
106 }
107}
ULONG64 GenRandom64(VOID)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by Test_SSE(), and Thread_SSE().
◆ RandomFill256()
◆ RandomFill512()
◆ set_AVX512_state()
◆ set_AVX_state()
◆ set_SSE_state()
◆ START_TEST()
START_TEST |
( |
XStateSave |
| ) |
|
Definition at line 339 of file XStateSave.c.
340{
342
344
348 {
350
354 }
355}
static VOID AdjustAffinity(VOID)
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
DWORD dwNumberOfProcessors
◆ Test_AVX()
Definition at line 224 of file XStateSave.c.
225{
227 {
228 skip(
"AVX not supported\n");
229 return;
230 }
231
232
235
237 {
238
240 }
242 {
243 ok(
FALSE,
"Failed to set AVX state\n");
244 return;
245 }
247
248
252 {
253 skip(
"CreateThread failed\n");
254 return;
255 }
256
259
260
263
264
266 {
268 }
269}
static DWORD WINAPI Thread_AVX(LPVOID Parameter)
#define ok_eq_m256i(a, b)
void __fastcall get_AVX_state(M256U64 data[REG_COUNT_AVX])
VOID RandomFill256(M256U64 *Data256, ULONG Count)
void __fastcall set_AVX_state(const M256U64 data[REG_COUNT_AVX])
BOOL WINAPI IsProcessorFeaturePresent(IN DWORD ProcessorFeature)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
#define EXCEPTION_EXECUTE_HANDLER
#define _SEH2_EXCEPT(...)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define PF_AVX_INSTRUCTIONS_AVAILABLE
Referenced by START_TEST().
◆ Test_AVX512()
Definition at line 292 of file XStateSave.c.
293{
295 {
296 skip(
"AVX512 not supported\n");
297 return;
298 }
299
300
303
305 {
306
308 }
310 {
311 ok(
FALSE,
"Failed to set AVX512 state\n");
312 return;
313 }
315
316
320 {
321 skip(
"CreateThread failed\n");
322 return;
323 }
324
327
328
331
332
334 {
336 }
337}
VOID RandomFill512(M512U64 *Data512, ULONG Count)
void __fastcall set_AVX512_state(const M512U64 data[REG_COUNT_AVX512])
void __fastcall get_AVX512_state(M512U64 data[REG_COUNT_AVX512])
#define ok_eq_m512i(a, b)
static DWORD WINAPI Thread_AVX512(LPVOID Parameter)
#define PF_AVX512F_INSTRUCTIONS_AVAILABLE
Referenced by START_TEST().
◆ Test_SSE()
Definition at line 156 of file XStateSave.c.
157{
159 {
160 skip(
"SSE not supported\n");
161 return;
162 }
163
164
167
169 {
170
172 }
174 {
175 ok(
FALSE,
"Failed to set SSE state\n");
176 return;
177 }
179
180
184 {
185 skip(
"CreateThread failed\n");
186 return;
187 }
188
191
192
195
196
198 {
200 }
201}
#define ok_eq_m128i(a, b)
VOID RandomFill128(M128U64 *Data128, ULONG Count)
void __fastcall set_SSE_state(const M128U64 data[REG_COUNT_SSE])
static DWORD WINAPI Thread_SSE(LPVOID Parameter)
void __fastcall get_SSE_state(M128U64 data[REG_COUNT_SSE])
#define PF_XMMI_INSTRUCTIONS_AVAILABLE
Referenced by START_TEST().
◆ Thread_AVX()
Definition at line 203 of file XStateSave.c.
204{
206
207
210
211
212 static const M256U64 Zero256 = { 0 };
214 {
216 }
217
218
221 return 0;
222}
Referenced by Test_AVX().
◆ Thread_AVX512()
Definition at line 271 of file XStateSave.c.
272{
274
275
278
279
280 static const M512U64 Zero512 = { 0 };
282 {
284 }
285
286
289 return 0;
290}
Referenced by Test_AVX512().
◆ Thread_SSE()
Definition at line 135 of file XStateSave.c.
136{
138
139
142
143
144 static const M128U64 Zero128 = { 0 };
146 {
148 }
149
150
153 return 0;
154}
Referenced by Test_SSE().
◆ g_randomSeed
ULONG g_randomSeed = 0x12345678 |
◆ M128U64
◆ M256U64
◆ M512U64
◆ s_ProcessorNumber