From f7c672d3bd5c307d702fee08cb73d58a9726ba9a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Sat, 12 Jul 2014 00:29:05 +0000 Subject: [PATCH] clang-cl: Make all x86 CPU feature flags available, such as -msse3 Ideally, we would use the /arch cl.exe flag for this stuff. Unfortunately, MSVC supports only 5 /arch flag values, which isn't nearly enough to cover all the CPU features that LLVM cares about. At the very least, we need to know about SSE3 and SSE4.1 in addition to SSE, SSE2, AVX, and AVX2. In the future we should add the relevant /arch mappings in addition to these gcc-style -m flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212869 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 2 +- test/Driver/cl-options.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 2a115ed4ce..6af0f686b2 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -73,7 +73,7 @@ def g_flags_Group : OptionGroup<"">; def i_Group : OptionGroup<"">, Group; def clang_i_Group : OptionGroup<"">, Group; def m_Group : OptionGroup<"">, Group; -def m_x86_Features_Group : OptionGroup<"">, Group; +def m_x86_Features_Group : OptionGroup<"">, Group, Flags<[CoreOption]>; def m_hexagon_Features_Group : OptionGroup<"">, Group; def m_arm_Features_Group : OptionGroup<"">, Group; def m_aarch64_Features_Group : OptionGroup<"">, Group; diff --git a/test/Driver/cl-options.c b/test/Driver/cl-options.c index 90b63259fe..bd77bddbf1 100644 --- a/test/Driver/cl-options.c +++ b/test/Driver/cl-options.c @@ -285,8 +285,10 @@ // Xclang: "-cc1" // Xclang: "hellocc1" -// We support -m32 and -m64. -// RUN: %clang_cl /Zs /WX -m32 -m64 -### -- 2>&1 %s | FileCheck -check-prefix=MFLAGS %s +// We support -m32 and -m64. We support all x86 CPU feature flags in gcc's -m +// flag space. +// RUN: %clang_cl /Zs /WX -m32 -m64 -msse3 -msse4.1 -mavx -mno-avx \ +// RUN: -### -- 2>&1 %s | FileCheck -check-prefix=MFLAGS %s // MFLAGS-NOT: argument unused during compilation // RTTI is on by default. /GR- controls -fno-rtti-data. -- 2.40.0