Author: disservin Date: 2026-07-10T11:08:02+08:00 New Revision: 089c9c1c3ede224bdc79510d09e779922d46388c
URL: https://github.com/llvm/llvm-project/commit/089c9c1c3ede224bdc79510d09e779922d46388c DIFF: https://github.com/llvm/llvm-project/commit/089c9c1c3ede224bdc79510d09e779922d46388c.diff LOG: [clang] Add -mavx512bmm flag (#208520) https://github.com/llvm/llvm-project/pull/182556 missed the addition of the -mavx512bmm flag Added: Modified: clang/include/clang/Options/Options.td clang/test/CodeGen/builtin-cpu-supports-all.c clang/test/CodeGen/target-builtin-noerror.c clang/test/Driver/x86-target-features.c clang/test/Preprocessor/x86_target_features.c Removed: ################################################################################ diff --git a/clang/include/clang/Options/Options.td b/clang/include/clang/Options/Options.td index 677aaf00b5083..f86323ad2d6bd 100644 --- a/clang/include/clang/Options/Options.td +++ b/clang/include/clang/Options/Options.td @@ -7217,6 +7217,8 @@ def mavx512bf16 : Flag<["-"], "mavx512bf16">, Group<m_x86_Features_Group>; def mno_avx512bf16 : Flag<["-"], "mno-avx512bf16">, Group<m_x86_Features_Group>; def mavx512bitalg : Flag<["-"], "mavx512bitalg">, Group<m_x86_Features_Group>; def mno_avx512bitalg : Flag<["-"], "mno-avx512bitalg">, Group<m_x86_Features_Group>; +def mavx512bmm : Flag<["-"], "mavx512bmm">, Group<m_x86_Features_Group>; +def mno_avx512bmm : Flag<["-"], "mno-avx512bmm">, Group<m_x86_Features_Group>; def mavx512bw : Flag<["-"], "mavx512bw">, Group<m_x86_Features_Group>; def mno_avx512bw : Flag<["-"], "mno-avx512bw">, Group<m_x86_Features_Group>; def mavx512cd : Flag<["-"], "mavx512cd">, Group<m_x86_Features_Group>; diff --git a/clang/test/CodeGen/builtin-cpu-supports-all.c b/clang/test/CodeGen/builtin-cpu-supports-all.c index c1274ccda827e..73ccf88dffd87 100644 --- a/clang/test/CodeGen/builtin-cpu-supports-all.c +++ b/clang/test/CodeGen/builtin-cpu-supports-all.c @@ -536,3 +536,8 @@ TEST_CPU_SUPPORTS(movrs, "movrs") // CHECK: [[LOAD:%[^ ]+]] = load i32, ptr getelementptr inbounds nuw (i8, ptr @__cpu_features2, i64 8) // CHECK: = and i32 [[LOAD]], 67108864 TEST_CPU_SUPPORTS(amx_movrs, "amx-movrs") + +// CHECK-LABEL: define{{.*}} void @test_avx512bmm( +// CHECK: [[LOAD:%[^ ]+]] = load i32, ptr getelementptr inbounds nuw (i8, ptr @__cpu_features2, i64 8) +// CHECK: = and i32 [[LOAD]], 134217728 +TEST_CPU_SUPPORTS(avx512bmm, "avx512bmm") diff --git a/clang/test/CodeGen/target-builtin-noerror.c b/clang/test/CodeGen/target-builtin-noerror.c index 1070f232a492a..86e74154cef4c 100644 --- a/clang/test/CodeGen/target-builtin-noerror.c +++ b/clang/test/CodeGen/target-builtin-noerror.c @@ -78,6 +78,7 @@ void verifyfeaturestrings(void) { (void)__builtin_cpu_supports("vpclmulqdq"); (void)__builtin_cpu_supports("avx512vnni"); (void)__builtin_cpu_supports("avx512bitalg"); + (void)__builtin_cpu_supports("avx512bmm"); (void)__builtin_cpu_supports("avx512bf16"); (void)__builtin_cpu_supports("avx512vp2intersect"); (void)__builtin_cpu_supports("f16c"); diff --git a/clang/test/Driver/x86-target-features.c b/clang/test/Driver/x86-target-features.c index f18e820d15444..e11753b91de98 100644 --- a/clang/test/Driver/x86-target-features.c +++ b/clang/test/Driver/x86-target-features.c @@ -121,6 +121,11 @@ // BITALG: "-target-feature" "+avx512bitalg" // NO-BITALG: "-target-feature" "-avx512bitalg" +// RUN: %clang --target=i386 -march=i386 -mavx512bmm %s -### 2>&1 | FileCheck -check-prefix=BMM %s +// RUN: %clang --target=i386 -march=i386 -mno-avx512bmm %s -### 2>&1 | FileCheck -check-prefix=NO-BMM %s +// BMM: "-target-feature" "+avx512bmm" +// NO-BMM: "-target-feature" "-avx512bmm" + // RUN: %clang --target=i386 -march=i386 -mavx512vnni %s -### 2>&1 | FileCheck -check-prefix=VNNI %s // RUN: %clang --target=i386 -march=i386 -mno-avx512vnni %s -### 2>&1 | FileCheck -check-prefix=NO-VNNI %s // VNNI: "-target-feature" "+avx512vnni" diff --git a/clang/test/Preprocessor/x86_target_features.c b/clang/test/Preprocessor/x86_target_features.c index ac8ad64a46950..c7d006171fddb 100644 --- a/clang/test/Preprocessor/x86_target_features.c +++ b/clang/test/Preprocessor/x86_target_features.c @@ -180,6 +180,10 @@ // AVX512BITALG: #define __SSE__ 1 // AVX512BITALG: #define __SSSE3__ 1 +// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512bmm -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVX512BMM %s + +// AVX512BMM: #define __AVX512BMM__ 1 +// AVX512BMM: #define __AVX512BW__ 1 // RUN: %clang -target i386-unknown-unknown -march=atom -mavx512vbmi -mno-avx512bw -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVX512VBMINOAVX512BW %s @@ -212,6 +216,11 @@ // AVX512BITALGNOAVX512BW-NOT: #define __AVX512BITALG__ 1 // AVX512BITALGNOAVX512BW-NOT: #define __AVX512BW__ 1 +// RUN: %clang -target i386-unknown-unknown -march=atom -mavx512bmm -mno-avx512bw -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=AVX512BMM_NOAVX512BW %s + +// AVX512BMM_NOAVX512BW-NOT: #define __AVX512BMM__ 1 +// AVX512BMM_NOAVX512BW-NOT: #define __AVX512BW__ 1 + // RUN: %clang -target i386-unknown-unknown -march=atom -msse4.2 -x c -E -dM -o - %s | FileCheck -match-full-lines --check-prefix=SSE42POPCNT %s // SSE42POPCNT: #define __POPCNT__ 1 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
