blob: 7d4326d8da979a6876054b68bb0525f560127b21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include <stdlib.h>
#include "cpuid.h"
#include "m512-check.h"
#include "avx10-os-support.h"
#ifndef DO_TEST
#define DO_TEST do_test
#if defined(AVX10_512BIT) || defined(AVX10_SCALAR)
static void test_512 (void);
#else
static void test_256 (void);
static void test_128 (void);
#endif
__attribute__ ((noinline))
static void
do_test (void)
{
#if defined(AVX10_512BIT) || defined(AVX10_SCALAR)
test_512 ();
#else
test_256 ();
test_128 ();
#endif
}
#endif
static int
check_osxsave (void)
{
unsigned int eax, ebx, ecx, edx;
__cpuid (1, eax, ebx, ecx, edx);
return (ecx & bit_OSXSAVE) != 0;
}
int
main ()
{
/* Run AVX10 test only if host has ISA support. */
if (__builtin_cpu_supports ("avx10.1")
#ifdef AVX10_2
&& __builtin_cpu_supports ("avx10.2")
#endif
&& avx10_os_support ())
{
DO_TEST ();
#ifdef DEBUG
printf ("PASSED\n");
#endif
return 0;
}
#ifdef DEBUG
printf ("SKIPPED\n");
#endif
return 0;
}
|