From patchwork Sun May 29 22:09:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "J. Mayer" X-Patchwork-Id: 627543 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rHv7G3V6Kz9sD9 for ; Mon, 30 May 2016 08:09:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=DFpi45z1; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=uIhQRu+xm2XlcWk2njLHj/0ky7LOtid4ha808zyjDliBy4nGTrUYk 8dNiShkiwrt/s3WQc4A5tZ89Yh2J1eiZTTSSA2ngusvDlj/daZ63/zcRU1a1CSqu XgnIl4/wg0apgjXXV3W9nDqcAl/HQG/o6HIbfXFhRpGGyiZz+QA8Bg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=HfFFOARGWRfKyl9whqXJ0RyJVqU=; b=DFpi45z1c9cl0r0r4a9wUh/ePbB1 NFBZ/MozEtqP/rnJOcy2pKeQsRhfoz23i2nlVCxbV+2nW2QoctkUEkJ7gBZ6Q4w/ 9Isf+VEOoD286+U4IZW7PIsM2G8aTwRmKXl6sHrSd2I1lY0LjXTPES7y2nITFa14 cYpraCbOwY2p6Yg= Received: (qmail 114089 invoked by alias); 29 May 2016 22:09:38 -0000 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 Received: (qmail 114075 invoked by uid 89); 29 May 2016 22:09:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.5 required=5.0 tests=AWL, BAYES_50, BODY_8BITS, GARBLED_BODY, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=8:15, 8:6., 8:02, 8:23 X-HELO: smtp26.services.sfr.fr Received: from smtp26.services.sfr.fr (HELO smtp26.services.sfr.fr) (93.17.128.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 29 May 2016 22:09:30 +0000 Received: from rapid.plaine (133.220.145.77.rev.sfr.net [77.145.220.133]) by msfrf2622.sfr.fr (SMTP Server) with ESMTP id 0543E1C000ADC; Mon, 30 May 2016 00:09:24 +0200 (CEST) Received: from rapid.plaine (133.220.145.77.rev.sfr.net [77.145.220.133]) by msfrf2622.sfr.fr (SMTP Server) with ESMTP; Mon, 30 May 2016 00:09:23 +0200 (CEST) Message-ID: <1464559768.9217.68.camel@magic.fr> Subject: Re: [PATCH][i386] Add -march=native support for VIA nano CPUs From: "J. Mayer" To: "gcc-patches@gcc.gnu.org" Cc: Uros Bizjak Date: Mon, 30 May 2016 00:09:28 +0200 In-Reply-To: References: Mime-Version: 1.0 X-sfr-mailing: LEGIT Hello, On Sun, 2016-05-29 at 21:12 +0200, Uros Bizjak wrote: > Hello! > > > > > When trying to compile using -march=native on a VIA nano CPU, gcc > > selects "-march=core2" "-mtune=i386" then is unable to compile, as > > this > > creates a conflicts between 32 bits and 64 bits compilation modes, > > as > > show by the following test: > [...] > > > > > --- gcc/config/i386/driver-i386.c.origÂÂ2015-02-02 > > 05:20:49.000000000 > > +0100 > > +++ gcc/config/i386/driver-i386.cÂÂÂÂÂÂÂ2015-08-23 > > 01:11:03.000000000 > > +0200 > > @@ -601,15 +601,20 @@ > > ÂÂÂÂÂÂÂÂÂÂswitch (family) > > ÂÂÂÂÂÂÂÂÂÂÂÂ{ > > ÂÂÂÂÂÂÂÂÂÂÂÂcase 6: > > -ÂÂÂÂÂÂÂÂÂÂÂÂÂif (model > 9) > The patch was corrupted by your mailer. But - can you please open a > bugreport, and refer reposted patch to this bugreport? This way, the > problem (and the patch) won't get forgotten. > > Uros. > Sorry for that, might be because of UTF-8 encoding. I already opened a bug many monthes ago, ID 67310: I just updated the patch against current git repository, the only difference between previous versions are diff offsets. Jocelyn ---               if (has_3dnow) @@ -664,6 +669,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)               /* We have no idea.  */               processor = PROCESSOR_GENERIC;             } +       } else { +         processor = PROCESSOR_GENERIC;         }      }    else @@ -894,7 +901,12 @@ const char *host_detect_local_cpu (int argc, const char **argv)        if (arch)         {           if (has_ssse3) -           cpu = "core2"; +           { +             if (vendor == signature_CENTAUR_ebx) +               cpu = "x86-64"; +             else +               cpu = "core2"; +           }           else if (has_sse3)             {               if (has_longmode) diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver- i386.c index b121466..662709e 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -642,15 +642,20 @@ const char *host_detect_local_cpu (int argc, const char **argv)           switch (family)             {             case 6: -             if (model > 9) -               /* Use the default detection procedure.  */ +             if (has_longmode)                 processor = PROCESSOR_GENERIC; -             else if (model == 9) -               cpu = "c3-2"; -             else if (model >= 6) -               cpu = "c3";               else -               processor = PROCESSOR_GENERIC; +               { +                 if (model > 9) +                   /* Use the default detection procedure.  */ +                   processor = PROCESSOR_GENERIC; +                 else if (model == 9) +                   cpu = "c3-2"; +                 else if (model >= 6) +                   cpu = "c3"; +                 else +                   processor = PROCESSOR_GENERIC; +               }               break;             case 5: