aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2009-05-12 13:42:53 +0200
committerUros Bizjak <uros@gcc.gnu.org>2009-05-12 13:42:53 +0200
commitfbdf817d6bfa399f6e6c87b4e097f2081233121d (patch)
tree91b6815babd9775346da1a7aeb87980dc5be28e3 /gcc/config
parent5e8d18263db963468b8ac2c15e352c91b7c9a3e6 (diff)
downloadgcc-fbdf817d6bfa399f6e6c87b4e097f2081233121d.zip
gcc-fbdf817d6bfa399f6e6c87b4e097f2081233121d.tar.gz
gcc-fbdf817d6bfa399f6e6c87b4e097f2081233121d.tar.bz2
re PR target/37197 (-msse4 ICE on __builtin_parityl)
PR target/37197 * config/i386/driver-i386.c (processor_signatures): New enum. (SIG_GEODE): Move from vendor_signatures to processor_signatures. (host_detect_local_cpu): For SIG_AMD vendor, check for SIG_GEODE processor signature to detect geode processor. From-SVN: r147429
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/driver-i386.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c
index 69c6c0c..cb66937 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -336,7 +336,11 @@ detect_caches_intel (bool xeon_mp, unsigned max_level, unsigned max_ext_level)
enum vendor_signatures
{
SIG_INTEL = 0x756e6547 /* Genu */,
- SIG_AMD = 0x68747541 /* Auth */,
+ SIG_AMD = 0x68747541 /* Auth */
+};
+
+enum processor_signatures
+{
SIG_GEODE = 0x646f6547 /* Geod */
};
@@ -433,19 +437,27 @@ const char *host_detect_local_cpu (int argc, const char **argv)
if (vendor == SIG_AMD)
{
- processor = PROCESSOR_PENTIUM;
+ unsigned int name;
- if (has_mmx)
- processor = PROCESSOR_K6;
- if (has_3dnowp)
- processor = PROCESSOR_ATHLON;
- if (has_sse2 || has_longmode)
- processor = PROCESSOR_K8;
- if (has_sse4a)
+ /* Detect geode processor by its processor signature. */
+ if (ext_level > 0x80000001)
+ __cpuid (0x80000002, name, ebx, ecx, edx);
+ else
+ name = 0;
+
+ if (name == SIG_GEODE)
+ processor = PROCESSOR_GEODE;
+ else if (has_sse4a)
processor = PROCESSOR_AMDFAM10;
+ else if (has_sse2 || has_longmode)
+ processor = PROCESSOR_K8;
+ else if (has_3dnowp)
+ processor = PROCESSOR_ATHLON;
+ else if (has_mmx)
+ processor = PROCESSOR_K6;
+ else
+ processor = PROCESSOR_PENTIUM;
}
- else if (vendor == SIG_GEODE)
- processor = PROCESSOR_GEODE;
else
{
switch (family)