Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -2500,6 +2500,10 @@ def mno_pclmul : Flag<["-"], "mno-pclmul">, Group; def mpopcnt : Flag<["-"], "mpopcnt">, Group; def mno_popcnt : Flag<["-"], "mno-popcnt">, Group; +def mprefer_avx128 : Flag<["-"], "mprefer-avx128">, Group; +def mno_prefer_avx128 : Flag<["-"], "mno-prefer-avx128">, Group; +def mprefer_avx256 : Flag<["-"], "mprefer-avx256">, Group; +def mno_prefer_avx256 : Flag<["-"], "mno-prefer-avx256">, Group; def mprefetchwt1 : Flag<["-"], "mprefetchwt1">, Group; def mno_prefetchwt1 : Flag<["-"], "mno-prefetchwt1">, Group; def mprfchw : Flag<["-"], "mprfchw">, Group; Index: test/Driver/x86-target-features.c =================================================================== --- test/Driver/x86-target-features.c +++ test/Driver/x86-target-features.c @@ -84,3 +84,13 @@ // RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-clzero %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CLZERO %s // CLZERO: "-target-feature" "+clzero" // NO-CLZERO: "-target-feature" "-clzero" + +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mprefer-avx128 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=PREFERAVX128 %s +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-prefer-avx128 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-PREFERAVX128 %s +// PREFERAVX128: "-target-feature" "+prefer-avx128" +// NO-PREFERAVX128: "-target-feature" "-prefer-avx128" + +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mprefer-avx256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=PREFERAVX256 %s +// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-prefer-avx256 %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-PREFERAVX256 %s +// PREFERAVX256: "-target-feature" "+prefer-avx256" +// NO-PREFERAVX256: "-target-feature" "-prefer-avx256"