From d39ebe2d2a24a331b89465191dce061fd9c6b5e4 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 4 Mar 2010 02:26:37 +0000 Subject: [PATCH] Add in -msse4.1 and -msse4.2 options and continuing a rather hacky solution for translating. Expanded on comment explaining the hack a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97714 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Driver/Options.td | 5 +++++ lib/Basic/Targets.cpp | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index b462a4d48e..3eb74ca595 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -64,6 +64,7 @@ def clang_ignored_m_Group : OptionGroup<"">, // , => _COMMA // = => _EQ // C++ => CXX +// . => _ // Developer Driver Options @@ -420,6 +421,8 @@ def mno_sse2 : Flag<"-mno-sse2">, Group; def mno_sse3 : Flag<"-mno-sse3">, Group; def mno_sse4a : Flag<"-mno-sse4a">, Group; def mno_sse4 : Flag<"-mno-sse4">, Group; +def mno_sse4_1 : Flag<"-mno-sse4.1">, Group; +def mno_sse4_2 : Flag<"-mno-sse4.2">, Group; def mno_sse : Flag<"-mno-sse">, Group; def mno_ssse3 : Flag<"-mno-ssse3">, Group; @@ -434,6 +437,8 @@ def msse2 : Flag<"-msse2">, Group; def msse3 : Flag<"-msse3">, Group; def msse4a : Flag<"-msse4a">, Group; def msse4 : Flag<"-msse4">, Group; +def msse4_1 : Flag<"-msse4.1">, Group; +def msse4_2 : Flag<"-msse4.2">, Group; def msse : Flag<"-msse">, Group; def mssse3 : Flag<"-mssse3">, Group; def mthumb : Flag<"-mthumb">, Group; diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 96ae4b7fc1..608a4f0279 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -734,8 +734,10 @@ void X86TargetInfo::getDefaultFeatures(const std::string &CPU, bool X86TargetInfo::setFeatureEnabled(llvm::StringMap &Features, const std::string &Name, bool Enabled) const { - // FIXME: This *really* should not be here. - if (!Features.count(Name) && Name != "sse4") + // FIXME: This *really* should not be here. We need some way of translating + // options into llvm subtarget features. + if (!Features.count(Name) && + (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1")) return false; if (Enabled) { @@ -751,9 +753,12 @@ bool X86TargetInfo::setFeatureEnabled(llvm::StringMap &Features, else if (Name == "ssse3") Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = true; - else if (Name == "sse4") + else if (Name == "sse4" || Name == "sse4.2") Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; + else if (Name == "sse4.1") + Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = + Features["ssse3"] = Features["sse41"] = true; else if (Name == "3dnow") Features["3dnowa"] = true; else if (Name == "3dnowa") -- 2.50.1