Date: Sun, 30 Oct 2011 23:23:26 +0100 From: Dimitry Andric <dim@FreeBSD.org> To: David Marec <david.marec@davenulle.org> Cc: freebsd-current@freebsd.org Subject: Re: [9.0-RC1 FreeBSD] [amd64] buildworld fails on building lib/libss with CLANG Message-ID: <4EADCE5E.8080703@FreeBSD.org> In-Reply-To: <4EAD8189.40607@davenulle.org> References: <4EAC033E.6010201@davenulle.org> <20111030072842.GA23153@freebsd.org> <20111030075224.GA25155@freebsd.org> <4EAD8189.40607@davenulle.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------010501090604020301060102 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable On 2011-10-30 17:55, David Marec wrote: > Le 30.10.2011 08:52, Roman Divacky a =E9crit : > > >> On Sun, Oct 30, 2011 at 08:28:42AM +0100, Roman Divacky wrote: >>> This is a bug in clang, llvm supports "amdfam10" but the clang counte= rpart >>> wasnt updated. Thank you for the report! >> >> fwiw, I fixed it in clang r143305, so in the next import this will wor= k just >> fine :) > > Thank you for getting involved. I pulled Roman's fixes into head in r226951. This will be merged to stable/9 later, but if you want to try it out in the meantime, please use the attached diff. --------------010501090604020301060102 Content-Type: text/x-diff; name="clang-amdfam10-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="clang-amdfam10-1.diff" Index: contrib/llvm/tools/clang/lib/Basic/Targets.cpp =================================================================== --- contrib/llvm/tools/clang/lib/Basic/Targets.cpp (revision 226948) +++ contrib/llvm/tools/clang/lib/Basic/Targets.cpp (working copy) @@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo { CK_K8SSE3, CK_Opteron, CK_OpteronSSE3, + CK_AMDFAM10, /// This specification is deprecated and will be removed in the future. /// Users should prefer \see CK_K8. @@ -1381,6 +1382,7 @@ class X86TargetInfo : public TargetInfo { .Case("k8-sse3", CK_K8SSE3) .Case("opteron", CK_Opteron) .Case("opteron-sse3", CK_OpteronSSE3) + .Case("amdfam10", CK_AMDFAM10) .Case("x86-64", CK_x86_64) .Case("geode", CK_Geode) .Default(CK_Generic); @@ -1441,6 +1443,7 @@ class X86TargetInfo : public TargetInfo { case CK_K8SSE3: case CK_Opteron: case CK_OpteronSSE3: + case CK_AMDFAM10: case CK_x86_64: return true; } @@ -1459,12 +1462,10 @@ void X86TargetInfo::getDefaultFeatures(llvm::Strin Features["ssse3"] = false; Features["sse41"] = false; Features["sse42"] = false; + Features["sse4a"] = false; Features["aes"] = false; Features["avx"] = false; - // LLVM does not currently recognize this. - // Features["sse4a"] = false; - // FIXME: This *really* should not be here. // X86_64 always has SSE2. @@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(llvm::Strin setFeatureEnabled(Features, "sse3", true); setFeatureEnabled(Features, "3dnowa", true); break; + case CK_AMDFAM10: + setFeatureEnabled(Features, "sse3", true); + setFeatureEnabled(Features, "sse4a", true); + setFeatureEnabled(Features, "3dnowa", true); + break; case CK_C3_2: setFeatureEnabled(Features, "mmx", true); setFeatureEnabled(Features, "sse", true); @@ -1604,6 +1610,8 @@ bool X86TargetInfo::setFeatureEnabled(llvm::String else if (Name == "avx") Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] = Features["ssse3"] = Features["sse41"] = Features["sse42"] = true; + else if (Name == "sse4a") + Features["sse4a"] = true; } else { if (Name == "mmx") Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false; @@ -1630,6 +1638,8 @@ bool X86TargetInfo::setFeatureEnabled(llvm::String Features["aes"] = false; else if (Name == "avx") Features["avx"] = false; + else if (Name == "sse4a") + Features["sse4a"] = false; } return true; @@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(const LangOpt Builder.defineMacro("__k8__"); Builder.defineMacro("__tune_k8__"); break; + case CK_AMDFAM10: + Builder.defineMacro("__amdfam10"); + Builder.defineMacro("__amdfam10__"); + Builder.defineMacro("__tune_amdfam10__"); + break; case CK_Geode: Builder.defineMacro("__geode"); Builder.defineMacro("__geode__"); --------------010501090604020301060102--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EADCE5E.8080703>