[cfe-commits] r130750 - /cfe/trunk/lib/Basic/Targets.cpp
Daniel Dunbar
daniel at zuster.org
Tue May 3 08:36:12 PDT 2011
This patch doesn't pass tests, I will be reverting shortly.
As for the content of the patch, shouldn't it have some kind of test itself?
- Daniel
On Mon, May 2, 2011 at 9:35 PM, Michael J. Spencer
<bigcheesegs at gmail.com> wrote:
> Author: mspencer
> Date: Mon May 2 23:35:54 2011
> New Revision: 130750
>
> URL: http://llvm.org/viewvc/llvm-project?rev=130750&view=rev
> Log:
> Make the mno flags match GCC. Patch by Alexander Best!
>
> Modified:
> cfe/trunk/lib/Basic/Targets.cpp
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=130750&r1=130749&r2=130750&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Mon May 2 23:35:54 2011
> @@ -1164,23 +1164,31 @@
> ;
> else if (CPU == "pentium-mmx" || CPU == "pentium2")
> setFeatureEnabled(Features, "mmx", true);
> - else if (CPU == "pentium3")
> + else if (CPU == "pentium3" || CPU == "pentium3m") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse", true);
> - else if (CPU == "pentium-m" || CPU == "pentium4" || CPU == "x86-64")
> + } else if (CPU == "pentium-m" || CPU == "pentium4" || CPU == "pentium4m" ||
> + CPU == "x86-64") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse2", true);
> - else if (CPU == "yonah" || CPU == "prescott" || CPU == "nocona")
> + } else if (CPU == "yonah" || CPU == "prescott" || CPU == "nocona") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse3", true);
> - else if (CPU == "core2")
> + } else if (CPU == "core2") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "ssse3", true);
> - else if (CPU == "penryn") {
> - setFeatureEnabled(Features, "sse4", true);
> - Features["sse42"] = false;
> - } else if (CPU == "atom")
> + } else if (CPU == "penryn") {
> + setFeatureEnabled(Features, "mmx", true);
> + setFeatureEnabled(Features, "sse4.1", true);
> + } else if (CPU == "atom") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse3", true);
> - else if (CPU == "corei7") {
> + } else if (CPU == "corei7") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse4", true);
> setFeatureEnabled(Features, "aes", true);
> } else if (CPU == "sandybridge") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse4", true);
> setFeatureEnabled(Features, "aes", true);
> // setFeatureEnabled(Features, "avx", true);
> @@ -1191,16 +1199,20 @@
> setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "3dnow", true);
> } else if (CPU == "athlon-4" || CPU == "athlon-xp" || CPU == "athlon-mp") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse", true);
> setFeatureEnabled(Features, "3dnowa", true);
> } else if (CPU == "k8" || CPU == "opteron" || CPU == "athlon64" ||
> CPU == "athlon-fx") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse2", true);
> setFeatureEnabled(Features, "3dnowa", true);
> } else if (CPU == "k8-sse3") {
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse3", true);
> setFeatureEnabled(Features, "3dnowa", true);
> } else if (CPU == "c3-2")
> + setFeatureEnabled(Features, "mmx", true);
> setFeatureEnabled(Features, "sse", true);
> }
>
> @@ -1217,49 +1229,53 @@
> if (Name == "mmx")
> Features["mmx"] = true;
> else if (Name == "sse")
> - Features["mmx"] = Features["sse"] = true;
> + Features["sse"] = true;
> else if (Name == "sse2")
> - Features["mmx"] = Features["sse"] = Features["sse2"] = true;
> + Features["sse"] = Features["sse2"] = true;
> else if (Name == "sse3")
> - Features["mmx"] = Features["sse"] = Features["sse2"] =
> - Features["sse3"] = true;
> + Features["sse"] = Features["sse2"] = Features["sse3"] = true;
> else if (Name == "ssse3")
> - Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
> + Features["sse"] = Features["sse2"] = Features["sse3"] =
> Features["ssse3"] = true;
> else if (Name == "sse4" || Name == "sse4.2")
> - Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
> + 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["sse"] = Features["sse2"] = Features["sse3"] =
> Features["ssse3"] = Features["sse41"] = true;
> else if (Name == "3dnow")
> - Features["3dnowa"] = true;
> + Features["mmx"] = Features["3dnow"] = true;
> else if (Name == "3dnowa")
> - Features["3dnow"] = Features["3dnowa"] = true;
> + Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = true;
> + // FIXME: AES requires SSE2's xmm registers
> else if (Name == "aes")
> - Features["aes"] = true;
> + Features["sse"] = Features["sse2"] = Features["aes"] = true;
> else if (Name == "avx")
> - Features["avx"] = true;
> + // FIXME: AVX requires a or some SSE4.2 feature(s)
> + Features["sse"] = Features["sse2"] = Features["sse3"] =
> + Features["ssse3"] = Features["sse41"] = Features["sse42"] =
> + Features["avx"] = true;
> } else {
> if (Name == "mmx")
> - Features["mmx"] = Features["3dnow"] = Features["3dnowa"] =
> - Features["sse"] = Features["sse2"] = Features["sse3"] =
> - Features["ssse3"] = Features["sse41"] = Features["sse42"] = false;
> + Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
> else if (Name == "sse")
> Features["sse"] = Features["sse2"] = Features["sse3"] =
> - Features["ssse3"] = Features["sse41"] = Features["sse42"] = false;
> + Features["ssse3"] = Features["sse41"] = Features["sse42"] =
> + Features["aes"] = Features["avx"] = false;
> else if (Name == "sse2")
> Features["sse2"] = Features["sse3"] = Features["ssse3"] =
> - Features["sse41"] = Features["sse42"] = false;
> + Features["sse41"] = Features["sse42"] = Features["aes"] =
> + Features["avx"] = false;
> else if (Name == "sse3")
> Features["sse3"] = Features["ssse3"] = Features["sse41"] =
> - Features["sse42"] = false;
> + Features["sse42"] = Features["avx"] = false;
> else if (Name == "ssse3")
> - Features["ssse3"] = Features["sse41"] = Features["sse42"] = false;
> + Features["ssse3"] = Features["sse41"] = Features["sse42"] =
> + Features["avx"] = false;
> else if (Name == "sse4" || Name == "sse4.1")
> - Features["sse41"] = Features["sse42"] = false;
> + Features["sse41"] = Features["sse42"] = Features["avx"] = false;
> else if (Name == "sse4.2")
> - Features["sse42"] = false;
> + Features["sse42"] = Features["avx"] = false;
> else if (Name == "3dnow")
> Features["3dnow"] = Features["3dnowa"] = false;
> else if (Name == "3dnowa")
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list