From patchwork Wed Feb 21 07:35:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 875984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473650-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Sas5mdbm"; dkim-atps=neutral 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 3zmTmb0MyZz9ry1 for ; Wed, 21 Feb 2018 18:35:42 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=OBvfETUKZe13C3W01 /q6SRfF7VG4Rj5GTl+h8sitm+WvhI5grbLZeBhgguldbW73Cs6Th1FB7OlYQ/mVT 0pgtL/88sikSK/Cq4ErZcSzQY6Z2pn7ap59l0KGdO1hbFPG7tFrVKFOpf7rWGcF7 PJTBvenqThUfoYG7G+ATzBxLYU= 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 :subject:from:to:cc:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=MDaEQcngNYzjGEeGpVmR3ID N1i4=; b=Sas5mdbmvC7IzzfUVYwN22xdTKLK/+havz1r1q961IqETt4BHMy/o6F A6mreOBtwdOPsP84qTJZZMd+ckdnQ6EnvgIGZAscCuDktmm11MQlXcfUcjDrXPyQ WeQvfECht/cVBTLtVV1kSjvhM/M7taoV4J4KOX8KFtNPNyN2uNv0= Received: (qmail 71489 invoked by alias); 21 Feb 2018 07:35:35 -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 71477 invoked by uid 89); 21 Feb 2018 07:35:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Feb 2018 07:35:34 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D846CAD1C; Wed, 21 Feb 2018 07:35:31 +0000 (UTC) Subject: [PATCH] Add "native" as a valid option value for -march= on aarch64 (PR driver/83193). From: =?utf-8?q?Martin_Li=C5=A1ka?= To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Jan Hubicka , James Greenhalgh , Ramana Radhakrishnan , Kyrill Tkachov References: Message-ID: <9c871dac-001a-cc0c-4da1-cfc1770008dc@suse.cz> Date: Wed, 21 Feb 2018 08:35:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes Hi. This is equivalent patch for aarch64 target. I've tested that both as cross compiler and native one. Ready for trunk? Thanks, Martin From 4fbe17099f8618ddd6a4de2d269ecb6f99625927 Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 20 Feb 2018 14:14:25 +0100 Subject: [PATCH 2/3] Add "native" as a valid option value for -march= on aarch64 (PR driver/83193). gcc/ChangeLog: 2018-02-20 Martin Liska PR driver/83193 * config/aarch64/aarch64.c (aarch64_print_hint_for_core_or_arch): Add "native" as a possible value. * config/aarch64/aarch64.h (HAVE_LOCAL_CPU_DETECT): Define the macro when native cpu detection is available. --- gcc/config/aarch64/aarch64.c | 7 +++++++ gcc/config/aarch64/aarch64.h | 1 + 2 files changed, 8 insertions(+) diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index e1fb87f047f..33c90ef02dc 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10628,6 +10628,13 @@ aarch64_print_hint_for_core_or_arch (const char *str, bool arch) const struct processor *entry = arch ? all_architectures : all_cores; for (; entry->name != NULL; entry++) candidates.safe_push (entry->name); + +#ifdef HAVE_LOCAL_CPU_DETECT + /* Add also "native" as possible value. */ + if (arch) + candidates.safe_push ("native"); +#endif + char *s; const char *hint = candidates_list_and_hint (str, s, candidates); if (hint) diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index e3c52f63683..976f9afae54 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -1002,6 +1002,7 @@ extern const char *aarch64_rewrite_mcpu (int argc, const char **argv); #if defined(__aarch64__) extern const char *host_detect_local_cpu (int argc, const char **argv); +#define HAVE_LOCAL_CPU_DETECT # define EXTRA_SPEC_FUNCTIONS \ { "local_cpu_detect", host_detect_local_cpu }, \ MCPU_TO_MARCH_SPEC_FUNCTIONS -- 2.16.1