From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23606 invoked by alias); 16 May 2011 05:03:55 -0000 Received: (qmail 23598 invoked by uid 22791); 16 May 2011 05:03:54 -0000 X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=AWL,BAYES_40,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 16 May 2011 05:03:38 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QLpxx-0006WC-1f for gcc-patches@gcc.gnu.org; Mon, 16 May 2011 07:03:37 +0200 Received: from rain.gmane.org ([80.91.229.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 May 2011 07:03:37 +0200 Received: from zuxy.meng by rain.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 16 May 2011 07:03:37 +0200 To: gcc-patches@gcc.gnu.org From: "Zuxy Meng" Subject: [PATCH, i386] PR 48743 Correctly detect AMD K6-2+ and K6-3+ Date: Mon, 16 May 2011 10:37:00 -0000 Message-ID: Reply-To: "Zuxy Meng" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00C9_01CC13C9.9FB671B0" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg01097.txt.bz2 ÕâÊÇÒ»·â MIME ¸ñʽµÄ¶à·½Óʼþ¡£ ------=_NextPart_000_00C9_01CC13C9.9FB671B0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit Content-length: 484 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 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 ------=_NextPart_000_00C9_01CC13C9.9FB671B0 Content-Type: application/octet-stream; name="k6-3+.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="k6-3+.diff" Content-length: 1345 --- 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; ------=_NextPart_000_00C9_01CC13C9.9FB671B0--