public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, i386] PR 48743 Correctly detect AMD K6-2+ and K6-3+
@ 2011-05-16 10:37 Zuxy Meng
  2011-05-16 13:27 ` H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Zuxy Meng @ 2011-05-16 10:37 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

Misdetected as Athlon by GCC, K6-2+ and K6-3+ are processors that support 
extended 3DNow! but don't support extended MMX or CMOV.

I don't own a K6-2 or Athlon machine. Can anybody have the patch tested?

2011-05-16 Zuxy Meng <zuxy.meng@gmail.com>
PR i386/48743
* config/i386/cpuid.h (bit_MMXEXT): New
* config/i386/cpuid.h (bit_3DNOWP): Deleted
* config/i386/driver-i386.c (host_detect_local_cpu): Detect Athlon by the 
presence of extended MMX instead of extended 3DNow!

--
Zuxy 

[-- Attachment #2: k6-3+.diff --]
[-- Type: application/octet-stream, Size: 1345 bytes --]

--- cpuid.h.orig	2011-05-12 16:15:00 +0800
+++ cpuid.h	2011-05-12 16:17:22 +0800
@@ -57,8 +57,8 @@
 #define bit_TBM         (1 << 21)
 
 /* %edx */
+#define bit_MMXEXT	(1 << 22)
 #define bit_LM		(1 << 29)
-#define bit_3DNOWP	(1 << 30)
 #define bit_3DNOW	(1 << 31)
 
 /* Extended Features (%eax == 7) */
--- driver-i386.c.orig	2011-05-12 16:13:47 +0800
+++ driver-i386.c	2011-05-12 16:21:39 +0800
@@ -391,7 +391,7 @@
 
   /* Extended features */
   unsigned int has_lahf_lm = 0, has_sse4a = 0;
-  unsigned int has_longmode = 0, has_3dnowp = 0, has_3dnow = 0;
+  unsigned int has_mmxext = 0, has_longmode = 0, has_3dnow = 0;
   unsigned int has_movbe = 0, has_sse4_1 = 0, has_sse4_2 = 0;
   unsigned int has_popcnt = 0, has_aes = 0, has_avx = 0;
   unsigned int has_pclmul = 0, has_abm = 0, has_lwp = 0;
@@ -465,8 +465,8 @@
       has_xop = ecx & bit_XOP;
       has_tbm = ecx & bit_TBM;
 
+      has_mmxext = edx & bit_MMXEXT;
       has_longmode = edx & bit_LM;
-      has_3dnowp = edx & bit_3DNOWP;
       has_3dnow = edx & bit_3DNOW;
 
       __cpuid (0x7, eax, ebx, ecx, edx);
@@ -506,7 +506,7 @@
 	processor = PROCESSOR_AMDFAM10;
       else if (has_sse2 || has_longmode)
 	processor = PROCESSOR_K8;
-      else if (has_3dnowp)
+      else if (has_mmxext)
 	processor = PROCESSOR_ATHLON;
       else if (has_mmx)
 	processor = PROCESSOR_K6;

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH, i386] PR 48743 Correctly detect AMD K6-2+ and K6-3+
@ 2011-05-18 12:34 Uros Bizjak
  2011-05-20 10:10 ` Zuxy Meng
  0 siblings, 1 reply; 8+ messages in thread
From: Uros Bizjak @ 2011-05-18 12:34 UTC (permalink / raw)
  To: gcc-patches; +Cc: Zuxy Meng, H.J. Lu, Jagasia, Harsha

Hello!

> 2011-05-16 Zuxy Meng <zuxy.meng@gmail.com>

> PR i386/48743
> * config/i386/cpuid.h (bit_MMXEXT): New
> * config/i386/driver-i386.c (host_detect_local_cpu): Detect Athlon by
> the presence of extended MMX instead of extended 3DNow!

PR target/48743

The patch is OK, but please also get a confirmation from someone from
AMD (CC'd).

Thanks,
Uros.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-20 14:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 10:37 [PATCH, i386] PR 48743 Correctly detect AMD K6-2+ and K6-3+ Zuxy Meng
2011-05-16 13:27 ` H.J. Lu
2011-05-17  7:15   ` Zuxy Meng
2011-05-17  7:15     ` H.J. Lu
2011-05-17  7:16       ` Zuxy Meng
2011-05-18 12:34 Uros Bizjak
2011-05-20 10:10 ` Zuxy Meng
2011-05-20 15:53   ` Jagasia, Harsha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).