From patchwork Mon Aug 13 10:39:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gopalasubramanian, Ganesh" X-Patchwork-Id: 176903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E7FCC2C0088 for ; Mon, 13 Aug 2012 20:39:41 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1345459182; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:References:In-Reply-To:Content-Type: Content-Transfer-Encoding:MIME-Version:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=S1p64C9Gs2OfbjetpVm9luRzwZU=; b=n2m0Q7TNMY99fnL 7MFhwpbrfjPvtheFOb1mdHSl03Nl5s0H4EPS9VvUr07Tiy01CXG+1mf2JwFlpw84 flVy0JnLz/arVjUBYGRNUch04RoqaSdq6npVnZgRaodGsLRqb9OPtz7jp2unFjq6 gurnT+VOpS2aTpcMvv5T2DkSX1mA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:X-Forefront-Antispam-Report:X-SpamScore:X-BigFish:Received:Received:Received:X-M-MSG:Received:Received:Received:From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:MIME-Version:X-OriginatorOrg:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Q0M6l68pWFX+Kpt3gHYIW54LMLyOsbPMHU5eDt+7s28aLo02lym7v9aB/8NnPr OrNdnvb6rz/Q4/aS39cK3EXQeLxppQREoiIWH1XJSQwvay4Dz0aS3jw5CQl3QbdZ +ioMKQiwupmbHuzlIq5wguxkbiOOsMZiygyUtdlB6oEfo=; Received: (qmail 25403 invoked by alias); 13 Aug 2012 10:39:37 -0000 Received: (qmail 25388 invoked by uid 22791); 13 Aug 2012 10:39:36 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RCVD_IN_HOSTKARMA_YE, TW_EB, TW_FS, TW_LZ, TW_TB, TW_ZC X-Spam-Check-By: sourceware.org Received: from ch1ehsobe003.messaging.microsoft.com (HELO ch1outboundpool.messaging.microsoft.com) (216.32.181.183) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Aug 2012 10:39:23 +0000 Received: from mail38-ch1-R.bigfish.com (10.43.68.231) by CH1EHSOBE013.bigfish.com (10.43.70.63) with Microsoft SMTP Server id 14.1.225.23; Mon, 13 Aug 2012 10:39:21 +0000 Received: from mail38-ch1 (localhost [127.0.0.1]) by mail38-ch1-R.bigfish.com (Postfix) with ESMTP id 8537A3C0433; Mon, 13 Aug 2012 10:39:21 +0000 (UTC) X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null); IPV:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI X-SpamScore: -6 X-BigFish: VPS-6(z37d5kz98dI9371I936eI542M1432Izz1202hzz8275bh8275dhz2dh668h839h944hd25hf0ah107ah) Received: from mail38-ch1 (localhost.localdomain [127.0.0.1]) by mail38-ch1 (MessageSwitch) id 1344854359743085_9849; Mon, 13 Aug 2012 10:39:19 +0000 (UTC) Received: from CH1EHSMHS018.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.249]) by mail38-ch1.bigfish.com (Postfix) with ESMTP id A98A136015B; Mon, 13 Aug 2012 10:39:19 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by CH1EHSMHS018.bigfish.com (10.43.70.18) with Microsoft SMTP Server id 14.1.225.23; Mon, 13 Aug 2012 10:39:19 +0000 X-M-MSG: Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com [163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Axway MailGate 3.8.1) with ESMTP id 2F6A7C804E; Mon, 13 Aug 2012 05:39:13 -0500 (CDT) Received: from SAUSEXDAG05.amd.com (163.181.55.6) by sausexedgep01.amd.com (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 13 Aug 2012 05:39:47 -0500 Received: from SAUSEXDAG04.amd.com ([fe80::9143:6575:e649:e862]) by sausexdag05.amd.com ([fe80::94d8:2d17:10c5:6039%20]) with mapi id 14.01.0323.003; Mon, 13 Aug 2012 05:39:16 -0500 From: "Gopalasubramanian, Ganesh" To: Jakub Jelinek CC: "gcc-patches@gcc.gnu.org" Subject: RE: [PATCH,i386] cpuid function for prefetchw Date: Mon, 13 Aug 2012 10:39:16 +0000 Message-ID: References: <20120813094536.GI1999@tucnak.redhat.com> In-Reply-To: <20120813094536.GI1999@tucnak.redhat.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Yes! Thanks Jakub. -----Original Message----- From: Jakub Jelinek [mailto:jakub@redhat.com] Sent: Monday, August 13, 2012 3:16 PM To: Gopalasubramanian, Ganesh Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH,i386] cpuid function for prefetchw On Mon, Aug 13, 2012 at 09:29:45AM +0000, Gopalasubramanian, Ganesh wrote: > To get the prefetchw cpuid flag, cpuid function 0x80000001 needs to be > called. > Previous to patch, function 0x7 is called. > > Bootstrapping and "make -k check" passes without failures. > Ok for trunk? IMHO you move it to a wrong spot, ecx bits of CPUID 0x80000001 are tested earlier. So I think you want this instead (bootstrap/regtest in progress): 2012-08-13 Ganesh Gopalasubramanian Jakub Jelinek PR driver/54210 * config/i386/driver-i386.c (host_detect_local_cpu): Test bit_PRFCHW bit of CPUID 0x80000001 %ecx instead of CPUID 7 %ecx. * config/i386/cpuid.h (bits_PRFCHW): Move definition to CPUID 0x80000001 %ecx flags. Jakub --- gcc/config/i386/driver-i386.c.jj 2012-08-10 15:49:25.000000000 +0200 +++ gcc/config/i386/driver-i386.c 2012-08-13 11:30:14.570494736 +0200 @@ -467,7 +467,6 @@ const char *host_detect_local_cpu (int a has_bmi2 = ebx & bit_BMI2; has_fsgsbase = ebx & bit_FSGSBASE; has_rdseed = ebx & bit_RDSEED; - has_prfchw = ecx & bit_PRFCHW; has_adx = ebx & bit_ADX; } @@ -488,6 +487,7 @@ const char *host_detect_local_cpu (int a has_xop = ecx & bit_XOP; has_tbm = ecx & bit_TBM; has_lzcnt = ecx & bit_LZCNT; + has_prfchw = ecx & bit_PRFCHW; has_longmode = edx & bit_LM; has_3dnowp = edx & bit_3DNOWP; --- gcc/config/i386/cpuid.h.jj 2012-08-10 15:49:25.000000000 +0200 +++ gcc/config/i386/cpuid.h 2012-08-13 11:31:30.346494092 +0200 @@ -52,6 +52,7 @@ #define bit_LAHF_LM (1 << 0) #define bit_ABM (1 << 5) #define bit_SSE4a (1 << 6) +#define bit_PRFCHW (1 << 8) #define bit_XOP (1 << 11) #define bit_LWP (1 << 15) #define bit_FMA4 (1 << 16) @@ -69,7 +70,6 @@ #define bit_HLE (1 << 4) #define bit_AVX2 (1 << 5) #define bit_BMI2 (1 << 8) -#define bit_PRFCHW (1 << 8) #define bit_RTM (1 << 11) #define bit_RDSEED (1 << 18) #define bit_ADX (1 << 19)