2020-01-03 Jakub Jelinek <jakub@redhat.com>
+ PR target/93089
+ * config/i386/i386-options.c (ix86_simd_clone_adjust): If
+ TARGET_PREFER_AVX128, use prefer-vector-width=256 for 'c' and 'd'
+ simd clones. If TARGET_PREFER_AVX256, use prefer-vector-width=512
+ for 'e' simd clones.
+
PR target/93089
* config/i386/i386.opt (x_prefer_vector_width_type): Remove TargetSave
entry.
str = "sse2";
break;
case 'c':
- if (!TARGET_AVX)
+ if (TARGET_PREFER_AVX128)
+ {
+ if (!TARGET_AVX)
+ str = "avx,prefer-vector-width=256";
+ else
+ str = "prefer-vector-width=256";
+ }
+ else if (!TARGET_AVX)
str = "avx";
break;
case 'd':
- if (!TARGET_AVX2)
+ if (TARGET_PREFER_AVX128)
+ {
+ if (!TARGET_AVX2)
+ str = "avx2,prefer-vector-width=256";
+ else
+ str = "prefer-vector-width=256";
+ }
+ else if (!TARGET_AVX2)
str = "avx2";
break;
case 'e':
- if (!TARGET_AVX512F)
+ if (TARGET_PREFER_AVX256)
+ {
+ if (!TARGET_AVX512F)
+ str = "avx512f,prefer-vector-width=512";
+ else
+ str = "prefer-vector-width=512";
+ }
+ else if (!TARGET_AVX512F)
str = "avx512f";
break;
default:
2020-01-03 Jakub Jelinek <jakub@redhat.com>
+ PR target/93089
+ * gcc.target/i386/pr93089-2.c: New test.
+ * gcc.target/i386/pr93089-3.c: New test.
+
PR target/93089
* gcc.target/i386/pr93089-1.c: New test.
--- /dev/null
+/* PR target/93089 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp-simd -mtune=znver1" } */
+/* { dg-final { scan-assembler "vmulps\[^\n\r]*zmm" } } */
+/* { dg-final { scan-assembler "vmulps\[^\n\r]*ymm" } } */
+
+#pragma omp declare simd notinbranch
+float
+foo (float x, float y)
+{
+ return x * y;
+}
--- /dev/null
+/* PR target/93089 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp-simd -mtune=skylake-avx512" } */
+/* { dg-final { scan-assembler "vmulps\[^\n\r]*zmm" } } */
+/* { dg-final { scan-assembler "vmulps\[^\n\r]*ymm" } } */
+
+#pragma omp declare simd notinbranch
+float
+foo (float x, float y)
+{
+ return x * y;
+}