[PATCH] x86: Compile some BF16 tests with -mno-avx512bf16 -mno-avxneconvert

"H.J. Lu" <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <CAMe9rOrJ+Oio29=SPVXDjnTs5M2Wp7cko_RjZ_qQwFRWZLygCg@mail.gmail.com>
Compile some BF16 tests with -mno-avx512bf16 -mno-avxneconvert to avoid

FAIL: gcc.target/i386/sse2-bfloat16-scalar-typecheck.c (test for excess errors)
FAIL: gcc.target/i386/vect-bfloat16-typecheck_1.c (test for excess errors)
FAIL: gcc.target/i386/vect-bfloat16-typecheck_2.c (test for excess errors)

with errors like

sse2-bfloat16-scalar-typecheck.c:16:1: warning: ‘__bfloat16’ is
redefined from typedef ‘short’ to real ‘__bf16’ since GCC 13.1, be
careful of implicit conversion between ‘__bf16’ and ‘short’; an
explicit bitcast may be needed here

when AVXNECONVERT or AVX512BF16 are enabled by default.

PR testsuite/126923
* gcc.target/i386/sse2-bfloat16-scalar-typecheck.c (dg-options):
Add -mno-avx512bf16 -mno-avxneconvert.
* gcc.target/i386/vect-bfloat16-typecheck_1.c (dg-options):
Likewise.
* gcc.target/i386/vect-bfloat16-typecheck_2.c (dg-options):
Likewise.

-- 
H.J.
0001-x86-Compile-some-BF16-tests-with-mno-avx512bf16-mno-.patch (text/x-patch, 3 KB)
From e8fdd609571355923d7c2a877c38e579d9e40b41 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <[email protected]>
Date: Thu, 20 Aug 2026 10:42:08 +0800
Subject: [PATCH] x86: Compile some BF16 tests with -mno-avx512bf16
 -mno-avxneconvert
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Compile some BF16 tests with -mno-avx512bf16 -mno-avxneconvert to avoid

FAIL: gcc.target/i386/sse2-bfloat16-scalar-typecheck.c (test for excess errors)
FAIL: gcc.target/i386/vect-bfloat16-typecheck_1.c (test for excess errors)
FAIL: gcc.target/i386/vect-bfloat16-typecheck_2.c (test for excess errors)

with errors like

sse2-bfloat16-scalar-typecheck.c:16:1: warning: ‘__bfloat16’ is redefined from typedef ‘short’ to real ‘__bf16’ since GCC 13.1, be careful of implicit conversion between ‘__bf16’ and ‘short’; an explicit bitcast may be needed here

when AVXNECONVERT or AVX512BF16 are enabled by default.

	PR testsuite/126923
	* gcc.target/i386/sse2-bfloat16-scalar-typecheck.c (dg-options):
	Add -mno-avx512bf16 -mno-avxneconvert.
	* gcc.target/i386/vect-bfloat16-typecheck_1.c (dg-options):
	Likewise.
	* gcc.target/i386/vect-bfloat16-typecheck_2.c (dg-options):
	Likewise.

Signed-off-by: H.J. Lu <[email protected]>

Signed-off-by: H.J. Lu <[email protected]>
---
 gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c | 2 +-
 gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c      | 2 +-
 gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c      | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c b/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c
index 599b02632fd..a8f371788be 100644
--- a/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c
+++ b/gcc/testsuite/gcc.target/i386/sse2-bfloat16-scalar-typecheck.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-msse2 -O2" } */
+/* { dg-options "-msse2 -mno-avx512bf16 -mno-avxneconvert -O2" } */
 
 
 __bf16 glob_bfloat;
diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c
index fdcead3ff42..afc6ee67613 100644
--- a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c
+++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mavx512fp16 -O2" } */
+/* { dg-options "-mavx512fp16 -mno-avx512bf16 -mno-avxneconvert -O2" } */
 
 #include <immintrin.h>
 
diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c
index 17ca3aad652..362f66ba480 100644
--- a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c
+++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-mavx512fp16 -O2" } */
+/* { dg-options "-mavx512fp16 -mno-avx512bf16 -mno-avxneconvert -O2" } */
 
 #include <immintrin.h>
 
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.