From 0d38d3a0005c60f721899475902026a91ef65fad Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Wed, 9 May 2012 17:47:03 +0000 Subject: [PATCH] Use the cpuid 64 bit flag to pick the default CPU name for an unknown model. For the Family 6 switch in sys::getHostCPUName, an unrecognized model was reported as "i686". That's a really bad default since it means that new CPUs will be treated as if they can only use 32-bit code. This just looks at the cpuid extended feature flag for 64 bit support, and if that is set, it uses a default x86-64 cpu. Similar logic is already used for the Family 15 code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156486 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/Host.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index 6d42780cc28..1ad7852dd93 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -239,7 +239,7 @@ std::string sys::getHostCPUName() { case 39: // 32 nm Atom Medfield return "atom"; - default: return "i686"; + default: return (Em64T) ? "x86-64" : "i686"; } case 15: { switch (Model) { -- 2.34.1