+2014-09-16 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Detect lack of
+ zmm/k regs support.
+
2014-09-16 Alexander Ivchenko <alexander.ivchenko@intel.com>
Maxim Kuznetsov <maxim.kuznetsov@intel.com>
Anna Tikhonova <anna.tikhonova@intel.com>
#define XSTATE_FP 0x1
#define XSTATE_SSE 0x2
#define XSTATE_YMM 0x4
+#define XSTATE_OPMASK 0x20
+#define XSTATE_ZMM 0x40
+#define XSTATE_HI_ZMM 0x80
if (has_osxsave)
asm (".byte 0x0f; .byte 0x01; .byte 0xd0"
: "=a" (eax), "=d" (edx)
has_xsavec = 0;
}
+ if (!has_osxsave
+ || (eax &
+ (XSTATE_SSE | XSTATE_YMM | XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM))
+ != (XSTATE_SSE | XSTATE_YMM | XSTATE_OPMASK | XSTATE_ZMM | XSTATE_HI_ZMM))
+ {
+ has_avx512f = 0;
+ has_avx512er = 0;
+ has_avx512pf = 0;
+ has_avx512cd = 0;
+ has_avx512dq = 0;
+ has_avx512bw = 0;
+ has_avx512vl = 0;
+ }
+
if (!arch)
{
if (vendor == signature_AMD_ebx
+2014-09-16 Ilya Tocar <ilya.tocar@intel.com>
+
+ * gcc.target/i386/avx512f-os-support.h: Remove magic number.
+
2014-09-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/56408
/* Check if the OS supports executing AVX512F instructions. */
+#define XCR_XFEATURE_ENABLED_MASK 0x0
+
+#define XSTATE_FP 0x1
+#define XSTATE_SSE 0x2
+#define XSTATE_YMM 0x4
+#define XSTATE_OPMASK 0x20
+#define XSTATE_ZMM 0x40
+#define XSTATE_HI_ZMM 0x80
+
static int
avx512f_os_support (void)
{
unsigned int eax, edx;
+ unsigned int ecx = XCR_XFEATURE_ENABLED_MASK;
+ unsigned int mask = XSTATE_SSE | XSTATE_YMM | XSTATE_OPMASK
+ | XSTATE_ZMM | XSTATE_HI_ZMM;
+
+ __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (ecx));
- __asm__ ("xgetbv" : "=a" (eax), "=d" (edx) : "c" (0));
- return (eax & 230) == 230;
+ return ((eax & mask) == mask);
}