From patchwork Tue Apr 17 14:35:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Zhuykov X-Patchwork-Id: 153191 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 14DD6B7058 for ; Wed, 18 Apr 2012 00:36:24 +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=1335278185; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=XeyK5GE YEaxAflupze6EJCp+jBY=; b=NDrHoDhe/mGadw15XE6sc6LrhnUYDvqNCEHCpzr 6wAQAl58HdDt9yiSUHvxPVoH61JP0dqhOaTLKV73OhwbaaCJguRSaO8wXMIsO5xZ n2Oz9/ywha4UjhAFNjRCEjpAw/debLIGMztz4kQBOTtpbKIporOahZWNT3/VF1JS 7eGo= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=v59X5HB9/WItIhI8HTvBb6IAkwtgLx4ZMT73COWpf1wznMx2MIh5qUuSAxuIRr XEU5nONlxb8pflOXkkjSO0fX71KMmF0IPtMJL6SSQ4LvPX8gmWoAJm5F9485qaiN JJBMfwDfCXBNEn2puO22N43nz5h/zAaq+QULI6Tma//SE=; Received: (qmail 10803 invoked by alias); 17 Apr 2012 14:36:16 -0000 Received: (qmail 10683 invoked by uid 22791); 17 Apr 2012 14:36:15 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.ispras.ru (HELO mail.ispras.ru) (83.149.199.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Apr 2012 14:35:43 +0000 Received: from mail-yx0-f175.google.com (mail-yx0-f175.google.com [209.85.213.175]) by mail.ispras.ru (Postfix) with ESMTP id 5E42724FEA1 for ; Tue, 17 Apr 2012 18:35:41 +0400 (MSK) Received: by yenm3 with SMTP id m3so3299421yen.20 for ; Tue, 17 Apr 2012 07:35:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.212.3 with SMTP id ng3mr9746818igc.39.1334673339111; Tue, 17 Apr 2012 07:35:39 -0700 (PDT) Received: by 10.231.244.201 with HTTP; Tue, 17 Apr 2012 07:35:39 -0700 (PDT) Date: Tue, 17 Apr 2012 18:35:39 +0400 Message-ID: Subject: CPU_NONE ix86_schedule cpu attribute for -march=nocona From: Roman Zhuykov To: hongjiu.lu@intel.com, ubizjak@gmail.com, gcc-patches@gcc.gnu.org Cc: Andrey Belevantsev , Dmitry Melnik X-IsSubscribed: yes 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 Hello, I found the following problem while investigating SMS on x86-64. When I run gcc with -march=nocona (on pentium-4 with EM64T extension), all latencies in data dependency graph become zeros. The global pointer "insn_default_latency" points to insn_default_latency_none, which returns zero for any instruction. This happens because ix86_schedule cpu attribute is set to CPU_NONE for nocona. CPU_NONE was introduced by this patch: http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00179.html I think we don't want any scheduler to work with zero latencies on such processors (with such -march). The following patch fixes the problem for my case with -march=nocona. Is it correct to fix the problem like this? What to do with 32bit architectures (i386, i486, pentium4, pentium4m, prescott) ? --- Roman Zhuykov diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index af4af7c..38d64e9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -2989,7 +2989,7 @@ ix86_option_override_internal (bool main_args_p) PTA_MMX | PTA_SSE | PTA_SSE2}, {"prescott", PROCESSOR_NOCONA, CPU_NONE, PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3}, - {"nocona", PROCESSOR_NOCONA, CPU_NONE, + {"nocona", PROCESSOR_NOCONA, CPU_GENERIC64, PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3 | PTA_CX16 | PTA_NO_SAHF}, {"core2", PROCESSOR_CORE2_64, CPU_CORE2,