Commit 3c6a5c3f by Uros Bizjak

avx-os-support.h (XCR_XFEATURE_ENABLED_MASK): New.

	* gcc.target/i386/avx-os-support.h (XCR_XFEATURE_ENABLED_MASK): New.
	(XSTATE_FP): Ditto.
	(XSTATE_SSE): Ditto.
	(XSTATE_YMM): Ditto.
	(avx_os_support): Use new defines.

From-SVN: r188275
parent ce79b857
2012-06-06 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/avx-os-support.h (XCR_XFEATURE_ENABLED_MASK): New.
(XSTATE_FP): Ditto.
(XSTATE_SSE): Ditto.
(XSTATE_YMM): Ditto.
(avx_os_support): Use new defines.
2012-06-06 Richard Guenther <rguenther@suse.de>
PR testsuite/32380
......@@ -181,7 +189,7 @@
arm32 to targets.
* gcc.dg/vect/slp-perm-8.c (main): Prevent vectorization
of the initialization loop.
(dg-final): Adjust the expected number of vectorized loops depending
(dg-final): Adjust the expected number of vectorized loops depending
on vect_char_mult target selector.
2012-05-31 Hans-Peter Nilsson <hp@axis.com>
......@@ -1113,7 +1121,7 @@
* gcc.target/cris/peep2-andu2.c: Tweak expected assembly
code to match current output and cover new peephole2 pattern.
2012-04-27 Ollie Wild <aaw@google.com>
2012-04-27 Ollie Wild <aaw@google.com>
* g++.dg/cpp0x/Wliteral-suffix.c: New test.
......
/* Check if the OS supports executing AVX instructions. */
#define XCR_XFEATURE_ENABLED_MASK 0x0
#define XSTATE_FP 0x1
#define XSTATE_SSE 0x2
#define XSTATE_YMM 0x4
static int
avx_os_support (void)
{
unsigned int eax, edx;
unsigned int ecx = XCR_XFEATURE_ENABLED_MASK;
__asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (ecx));
__asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
return (eax & 6) == 6;
return (eax & (XSTATE_SSE | XSTATE_YMM)) == (XSTATE_SSE | XSTATE_YMM);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment