OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [avx2-check.h] - Blame information for rev 695

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
#include <stdlib.h>
2
#include "cpuid.h"
3
#include "m256-check.h"
4
#include "avx-os-support.h"
5
 
6
static void avx2_test (void);
7
 
8
static void __attribute__ ((noinline)) do_test (void)
9
{
10
  avx2_test ();
11
}
12
 
13
int
14
main ()
15
{
16
  unsigned int eax, ebx, ecx, edx;
17
 
18
  if (!__get_cpuid (1, &eax, &ebx, &ecx, &edx))
19
    return 0;
20
 
21
  /* Run AVX2 test only if host has AVX2 support.  */
22
  if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE))
23
    {
24
      if (__get_cpuid_max (0, NULL) < 7)
25
        return 0;
26
 
27
      __cpuid_count (7, 0, eax, ebx, ecx, edx);
28
 
29
      if ((avx_os_support ()) && ((ebx & bit_AVX2) == bit_AVX2))
30
        {
31
          do_test ();
32
#ifdef DEBUG
33
          printf ("PASSED\n");
34
#endif
35
          return 0;
36
        }
37
#ifdef DEBUG
38
      printf ("SKIPPED\n");
39
#endif
40
    }
41
#ifdef DEBUG
42
  else
43
    printf ("SKIPPED\n");
44
#endif
45
 
46
  return 0;
47
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.