+2014-11-27 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/cpuid.h (bit_MPX, bit_BNDREGS, bit_BNDCSR):
+ Define.
+ * config/i386/i386.c (get_builtin_code_for_version): Add avx512f.
+ (fold_builtin_cpu): Ditto.
+ * doc/extend.texi: Documment it.
+
2014-11-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64067
#define bit_AVX2 (1 << 5)
#define bit_BMI2 (1 << 8)
#define bit_RTM (1 << 11)
+#define bit_MPX (1 << 14)
#define bit_AVX512F (1 << 16)
#define bit_AVX512DQ (1 << 17)
#define bit_RDSEED (1 << 18)
#define bit_PREFETCHWT1 (1 << 0)
#define bit_AVX512VBMI (1 << 1)
+/* XFEATURE_ENABLED_MASK register bits (%eax == 13, %ecx == 0) */
+#define bit_BNDREGS (1 << 3)
+#define bit_BNDCSR (1 << 4)
+
/* Extended State Enumeration Sub-leaf (%eax == 13, %ecx == 1) */
#define bit_XSAVEOPT (1 << 0)
#define bit_XSAVEC (1 << 1)
P_FMA,
P_PROC_FMA,
P_AVX2,
- P_PROC_AVX2
+ P_PROC_AVX2,
+ P_AVX512F
};
enum feature_priority priority = P_ZERO;
{"fma4", P_FMA4},
{"xop", P_XOP},
{"fma", P_FMA},
- {"avx2", P_AVX2}
+ {"avx2", P_AVX2},
+ {"avx512f", P_AVX512F}
};
F_FMA4,
F_XOP,
F_FMA,
+ F_AVX512F,
F_MAX
};
{"fma4", F_FMA4},
{"xop", F_XOP},
{"fma", F_FMA},
- {"avx2", F_AVX2}
+ {"avx2", F_AVX2},
+ {"avx512f",F_AVX512F}
};
tree __processor_model_type = build_processor_model_struct ();
AVX instructions.
@item avx2
AVX2 instructions.
+@item avx512f
+AVX512F instructions.
@end table
Here is an example:
+2014-11-27 Ilya Tocar <ilya.tocar@intel.com>
+
+ * g++.dg/ext/mv2.C: Add test for target ("avx512f").
+ * gcc.target/i386/builtin_target.c: Ditto.
+
2014-11-27 Kai Tietz <ktietz@redhat.com>
PR c++/63904
int foo () __attribute__ ((target ("popcnt")));
int foo () __attribute__ ((target ("avx")));
int foo () __attribute__ ((target ("avx2")));
+int foo () __attribute__ ((target ("avx512f")));
int main ()
{
int val = foo ();
- if (__builtin_cpu_supports ("avx2"))
- assert (val == 1);
+ if (__builtin_cpu_supports ("avx512f"))
+ assert (val == 11);
+ else if (__builtin_cpu_supports ("avx2"))
+ assert (val == 10);
else if (__builtin_cpu_supports ("avx"))
- assert (val == 2);
+ assert (val == 9);
else if (__builtin_cpu_supports ("popcnt"))
- assert (val == 3);
+ assert (val == 8);
else if (__builtin_cpu_supports ("sse4.2"))
- assert (val == 4);
+ assert (val == 7);
else if (__builtin_cpu_supports ("sse4.1"))
- assert (val == 5);
- else if (__builtin_cpu_supports ("ssse3"))
assert (val == 6);
+ else if (__builtin_cpu_supports ("ssse3"))
+ assert (val == 5);
else if (__builtin_cpu_supports ("sse3"))
- assert (val == 7);
+ assert (val == 4);
else if (__builtin_cpu_supports ("sse2"))
- assert (val == 8);
+ assert (val == 3);
else if (__builtin_cpu_supports ("sse"))
- assert (val == 9);
+ assert (val == 2);
else if (__builtin_cpu_supports ("mmx"))
- assert (val == 10);
+ assert (val == 1);
else
assert (val == 0);
int __attribute__ ((target("mmx")))
foo ()
{
- return 10;
+ return 1;
}
int __attribute__ ((target("sse")))
foo ()
{
- return 9;
+ return 2;
}
int __attribute__ ((target("sse2")))
foo ()
{
- return 8;
+ return 3;
}
int __attribute__ ((target("sse3")))
foo ()
{
- return 7;
+ return 4;
}
int __attribute__ ((target("ssse3")))
foo ()
{
- return 6;
+ return 5;
}
int __attribute__ ((target("sse4.1")))
foo ()
{
- return 5;
+ return 6;
}
int __attribute__ ((target("sse4.2")))
foo ()
{
- return 4;
+ return 7;
}
int __attribute__ ((target("popcnt")))
foo ()
{
- return 3;
+ return 8;
}
int __attribute__ ((target("avx")))
foo ()
{
- return 2;
+ return 9;
}
int __attribute__ ((target("avx2")))
foo ()
{
- return 1;
+ return 10;
+}
+
+int __attribute__ ((target("avx512f")))
+foo ()
+{
+ return 11;
}
__cpuid_count (7, 0, eax, ebx, ecx, edx);
if (ebx & bit_AVX2)
assert (__builtin_cpu_supports ("avx2"));
+ if (ebx & bit_AVX512F)
+ assert (__builtin_cpu_supports ("avx512f"));
}
}
assert (__builtin_cpu_supports ("avx2") >= 0);
+ assert (__builtin_cpu_supports ("avx512f") >= 0);
+
/* Check CPU type. */
assert (__builtin_cpu_is ("amd") >= 0);
+2014-11-27 Ilya Tocar <ilya.tocar@intel.com>
+
+ * config/i386/cpuinfo.c (processor_features): Add FEATURE_AVX512F.
+ * config/i386/cpuinfo.c (get_available_features): Detect it.
+
2014-11-27 Tony Wang <tony.wang@arm.com>
* config/arm/lib1funcs.S (FUNC_START): Add conditional section
FEATURE_SSE4_A,
FEATURE_FMA4,
FEATURE_XOP,
- FEATURE_FMA
+ FEATURE_FMA,
+ FEATURE_AVX512F
};
struct __processor_model
__cpuid_count (7, 0, eax, ebx, ecx, edx);
if (ebx & bit_AVX2)
features |= (1 << FEATURE_AVX2);
+ if (ebx & bit_AVX512F)
+ features |= (1 << FEATURE_AVX512F);
}
unsigned int ext_level;