pkgsrc-ng/lang/gcc45/patches/patch-gcc_testsuite_gcc.target_i386_avx-os-support.h
Lionel Sambuc 612ad0a18c lang/gcc45
2016-01-22 00:09:29 +01:00

16 lines
375 B
C

$NetBSD$
--- gcc/testsuite/gcc.target/i386/avx-os-support.h.orig Wed May 21 19:48:58 2014
+++ gcc/testsuite/gcc.target/i386/avx-os-support.h
@@ -0,0 +1,10 @@
+/* Check if the OS supports executing AVX instructions. */
+
+static int
+avx_os_support (void)
+{
+ unsigned int eax, edx;
+
+ __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
+ return (eax & 6) == 6;
+}