Skip to content

Commit 806ed62

Browse files
committed
[X86][AVX10] Disable m[no-]avx10.1 and switch m[no-]avx10.2 to alias of 512
Per the feedback we got, we’d like to switch m[no-]avx10.2 to alias of 512 bit options and disable m[no-]avx10.1 due to they were alias of 256 bit options. We also change -mno-avx10.[1,2]-512 to alias of 256 bit options to disable both 256 and 512 instructions.
1 parent b9efbed commit 806ed62

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,10 @@ X86 Support
11171117
- Support ISA of ``MOVRS``.
11181118

11191119
- Supported ``-march/tune=diamondrapids``
1120+
- Disable ``-m[no-]avx10.1`` and switch ``-m[no-]avx10.2`` to alias of 512 bit
1121+
options.
1122+
- Change ``-mno-avx10.1-512`` to alias of ``-mno-avx10.1-256`` to disable both
1123+
256 and 512 bit instructions.
11201124

11211125
Arm and AArch64 Support
11221126
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Driver/Options.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6424,14 +6424,14 @@ def mno_avx : Flag<["-"], "mno-avx">, Group<m_x86_Features_Group>;
64246424
def mavx10_1_256 : Flag<["-"], "mavx10.1-256">, Group<m_x86_AVX10_Features_Group>;
64256425
def mno_avx10_1_256 : Flag<["-"], "mno-avx10.1-256">, Group<m_x86_AVX10_Features_Group>;
64266426
def mavx10_1_512 : Flag<["-"], "mavx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6427-
def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Group<m_x86_AVX10_Features_Group>;
6428-
def mavx10_1 : Flag<["-"], "mavx10.1">, Alias<mavx10_1_256>;
6429-
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Alias<mno_avx10_1_256>;
6427+
def mno_avx10_1_512 : Flag<["-"], "mno-avx10.1-512">, Alias<mno_avx10_1_256>;
6428+
def mavx10_1 : Flag<["-"], "mavx10.1">, Flags<[Unsupported]>;
6429+
def mno_avx10_1 : Flag<["-"], "mno-avx10.1">, Flags<[Unsupported]>;
64306430
def mavx10_2_256 : Flag<["-"], "mavx10.2-256">, Group<m_x86_AVX10_Features_Group>;
64316431
def mno_avx10_2_256 : Flag<["-"], "mno-avx10.2-256">, Group<m_x86_AVX10_Features_Group>;
64326432
def mavx10_2_512 : Flag<["-"], "mavx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6433-
def mno_avx10_2_512 : Flag<["-"], "mno-avx10.2-512">, Group<m_x86_AVX10_Features_Group>;
6434-
def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_256>;
6433+
def mno_avx10_2_512 : Flag<["-"], "mno-avx10.2-512">, Alias<mno_avx10_2_256>;
6434+
def mavx10_2 : Flag<["-"], "mavx10.2">, Alias<mavx10_2_512>;
64356435
def mno_avx10_2 : Flag<["-"], "mno-avx10.2">, Alias<mno_avx10_2_256>;
64366436
def mavx2 : Flag<["-"], "mavx2">, Group<m_x86_Features_Group>;
64376437
def mno_avx2 : Flag<["-"], "mno-avx2">, Group<m_x86_Features_Group>;

clang/test/Driver/x86-target-features.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,23 +395,25 @@
395395
// EVEX512: "-target-feature" "+evex512"
396396
// NO-EVEX512: "-target-feature" "-evex512"
397397

398-
// RUN: %clang --target=i386 -mavx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
398+
// RUN: not %clang --target=i386 -march=i386 -mavx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=UNSUPPORT-AVX10 %s
399+
// RUN: not %clang --target=i386 -march=i386 -mno-avx10.1 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=UNSUPPORT-AVX10 %s
399400
// RUN: %clang --target=i386 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
400401
// RUN: %clang --target=i386 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_512 %s
401402
// RUN: %clang --target=i386 -mavx10.1-256 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_512 %s
402403
// RUN: %clang --target=i386 -mavx10.1-512 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_1_256 %s
403404
// RUN: not %clang --target=i386 -march=i386 -mavx10.1-128 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
404405
// RUN: not %clang --target=i386 -march=i386 -mavx10.a-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
405406
// RUN: not %clang --target=i386 -march=i386 -mavx10.1024-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=BAD-AVX10 %s
406-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mavx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
407-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mno-avx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
408-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mevex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
409-
// RUN: %clang --target=i386 -march=i386 -mavx10.1 -mno-evex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
410-
// RUN: %clang --target=i386 -mavx10.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_256 %s
407+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mavx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
408+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mno-avx512f %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-AVX512 %s
409+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mevex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
410+
// RUN: %clang --target=i386 -march=i386 -mavx10.1-256 -mno-evex512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10-EVEX512 %s
411+
// RUN: %clang --target=i386 -mavx10.2 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_512 %s
411412
// RUN: %clang --target=i386 -mavx10.2-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_256 %s
412413
// RUN: %clang --target=i386 -mavx10.2-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=AVX10_2_512 %s
413414
// RUN: %clang --target=i386 -mavx10.2-256 -mavx10.1-512 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_256,AVX10_1_512 %s
414415
// RUN: %clang --target=i386 -mavx10.2-512 -mavx10.1-256 %s -### -o %t.o 2>&1 | FileCheck -check-prefixes=AVX10_2_512,AVX10_1_256 %s
416+
// UNSUPPORT-AVX10: error: unsupported option '-m{{.*}}avx10.1' for target 'i386'
415417
// AVX10_2_256: "-target-feature" "+avx10.2-256"
416418
// AVX10_2_512: "-target-feature" "+avx10.2-512"
417419
// AVX10_1_256: "-target-feature" "+avx10.1-256"

clang/test/Preprocessor/x86_target_features.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,8 @@
742742
// AVXVNNIINT16NOAVX2-NOT: #define __AVX2__ 1
743743
// AVXVNNIINT16NOAVX2-NOT: #define __AVXVNNIINT16__ 1
744744

745-
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
746745
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-256 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
747746
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-256 -mno-avx512f -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_256 %s
748-
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_256,AVX10_2_256 %s
749747
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2-256 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_256,AVX10_2_256 %s
750748
// AVX10_1_256-NOT: __AVX10_1_512__
751749
// AVX10_1_256: #define __AVX10_1__ 1
@@ -758,6 +756,7 @@
758756
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
759757
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -mno-avx512f -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
760758
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.1-512 -mno-evex512 -x c -E -dM -o - %s | FileCheck -check-prefix=AVX10_1_512 %s
759+
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_512,AVX10_2_512 %s
761760
// RUN: %clang -target i686-unknown-linux-gnu -march=atom -mavx10.2-512 -x c -E -dM -o - %s | FileCheck -check-prefixes=AVX10_1_512,AVX10_2_512 %s
762761
// AVX10_1_512: #define __AVX10_1_512__ 1
763762
// AVX10_1_512: #define __AVX10_1__ 1

0 commit comments

Comments
 (0)