From patchwork Fri Jun 9 12:53:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 103475 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp193430qgd; Fri, 9 Jun 2017 05:54:32 -0700 (PDT) X-Received: by 10.99.186.29 with SMTP id k29mr39577932pgf.219.1497012872179; Fri, 09 Jun 2017 05:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497012872; cv=none; d=google.com; s=arc-20160816; b=pbCiPFLjd7cA2/7moZeu56pYgpv0/2gIVV6zcx0dLYsRHDmJzjmZbYv/QErpNb1EK0 VTLT531Ia1zYNbsuRjESEcLgPvIeuzOmtl468wEdD+XR6AFaI+6CWqehcFkOfZvsZcTV mQ+ndZaVFu4JYqlERfAzZ+3bJWp3YKCT+FLZxQPHKtbj4MscawH7ECIPzguhkNppmMNg dKSAu2y+e9rJcAb5l/EsMNsdpv0E9yicKD83smywSyPxRazt1prLpJuEpbTaq8ID1sb9 o1TqAnsjHjp2T66NbHT3g7gei55MIwRUkv6mJDoeBSFXAYhhFXc6WekgauagexJG5Asn atCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:cc:to:from:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=NDiIWjNg5o7uYAX9GMsuqsgJvgPFF0s66twse8y7f3I=; b=sjFTX4eqckGp9hg2P1J/QOBZ/+GzWeJUfZ6hGN+eNM+bPmJ2ICGDUq8KApul3YVLz9 GxYZfQS5kTcqnR821RfuJzw+kNQCdYxObojh4v97lpgkjET1lliBEH1X55TUEzoKs1zb oa8jsD2yu+gslaSpqBMLnm+Wwz+MOSKgLiiYiBKF+/ny5sA9pJZhamUAGMUy7dVgD1nu dSW+0Wr4gwOmDJDWoCaThaLfrpMrKYEm6EwqvxmeGcyVaYc+iH4XasFVRwHecVHp5VUx A31SxTEvAs7E2GoEWjDBEST05uzpHAxSKuEHr9xPXW1GQPOOMOnMKxLFmEyMSMGre+hK jHRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455519-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455519-patch=linaro.org@gcc.gnu.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 197si928971pfu.81.2017.06.09.05.54.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 05:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-455519-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-455519-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-455519-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=qRJlbY0y07XEv77g9jc5lsEMmF6fpg3lEeaJJBGAcxngmnem2+ 5byThHPlIJHi9bbvNDjsrxuT5KyCvB1GhuxGtYitbs17oYDKyD0nazYCwpynxrkM GE0waABbb4HHEeGF28FP7qlu5q8FszrY1W2O1DucuBvG01nbws98EfznM= 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:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=nMLUDr7M+Lkp0ETpVlbIFiN0X9Q=; b=IR+lKYWwBp/4jHrv1nDv rhAYQfFKLnAFZZ/m/g++q1mT1bPQVj2P1dDtQqta//jzN8BaRio5fJfIzvi53YN9 McT6hex5FYyShSI6TkjRZakU2Fcm4tmuMPU0EkG9fnM/MOxJMAnvik3c4nkBQMVW u6nG0QzTGGHwtb0g07hyGn8= Received: (qmail 74206 invoked by alias); 9 Jun 2017 12:54:09 -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 69644 invoked by uid 89); 9 Jun 2017 12:54:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=phoenix, periods, exhibit, transient X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Jun 2017 12:54:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 204962B; Fri, 9 Jun 2017 05:54:08 -0700 (PDT) Received: from e105689-lin.cambridge.arm.com (e105689-lin.cambridge.arm.com [10.2.207.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F97B3F3E1; Fri, 9 Jun 2017 05:54:07 -0700 (PDT) From: Richard Earnshaw To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw Subject: [PATCH 00/30] [ARM] Reworking the -mcpu, -march and -mfpu options Date: Fri, 9 Jun 2017 13:53:29 +0100 Message-Id: MIME-Version: 1.0 During the ARM BoF at the Cauldron last year I mentioned that I wanted to rework the way GCC on ARM handles the command line options. The problem was that most users, and even many experts, can't remember which FPU/SIMD unit comes with which CPU and that consequently many users were inadvertenly generating sub-optimal code for their system. This patch series implements the proposed change and provides support for a generic way of adding optional features to architectures and CPU names. The documentation patches at the end of the series explain the new syntax, so I won't repeat all that here. Suffice to say here that the result is that the -mfpu option now defaults to 'auto', which allows the compiler to infer the floating-point and simd options from the CPU/architecture options and that these options can normally be expressed in a context-specific manner like +simd or +fp without having to know precisely which variant is implemented. Long term I'd like to deprecate -mfpu and entirely move over to the new syntax; but it's too early to start that process now. All the patches in the series should build a working basic compiler, but the multilib selection will not work correctly until the relevant patches towards the end are applied. It is not really feasible to retain that functionality without collapsing too many of the patches together into one hunk. It's also possible that some tests in the testsuite may exhibit transient misbehaviour, but there should be no regressions by the end of the sequence (some tests no-longer run in the default configurations because the default CPU does not have floating-point support). Just two patches are to the generic code, but both are fairly trivial. One permits the sbitmap code to be used in the driver programs and the other provides a way of escaping the meta-character in some multilib reuse strings. I won't apply any of this series until those two patches have been approved, and I won't commit anything before the middle of next week even then. This is a fairly complex change and it deserves some time for people to comment before committing. R. Richard Earnshaw (30): [arm] Use strings for -march, -mcpu and -mtune options [arm] Rewrite -march and -mcpu options for passing to the assembler [arm] Don't pass -mfpu=auto through to the assembler. [arm] Allow +opt on arbitrary cpu and architecture specifications [arm] Add architectural options [arm] Add default FPUs for CPUs. [build] Make sbitmap code available to the driver programs [arm] Split CPU, architecture and tuning data tables. [ARM] Move cpu and architecture option name parsing code to arm-common.c [arm] Use standard option parsing code for detecting thumb-only targets [arm] Allow CPU and architecture extensions to be defined as aliases [arm] Allow new extended syntax CPU and architecture names during configure [arm] Force a CPU default in the config args defaults list. [arm] Generate a canonical form for -march [arm] Make -mfloat-abi=softfp work when there are no FPU instructions [arm] Update basic multilib configuration [arm] Make 'auto' the default FPU selection option. [arm] Rewrite t-aprofile using new selector methodology [arm] Explicitly set .fpu in cmse_nonsecure_call.S [genmultilib] Allow explicit periods to be escaped in MULTILIB_REUSE [arm][testsuite] Use -march=armv7-a+fp when testing hard-float ABI. [arm] Rewrite t-rmprofile multilib specification [arm][rtems] Update t-rtems for new option framework [arm][linux-eabi] Ensure all multilib variables are reset [arm][phoenix] reset all multilib variables [arm] Rework multlib builds for symbianelf [arm][fuchsia] Rework multilib support [arm] Add a few missing architecture extension options. [arm][doc] Document new -march= syntax. [arm][doc] Document changes to -mcpu, -mtune and -mfpu. gcc/Makefile.in | 2 +- gcc/common/config/arm/arm-common.c | 651 +++++++- gcc/config.gcc | 17 +- gcc/config/arm/arm-builtins.c | 4 +- gcc/config/arm/arm-cpu-cdata.h | 2444 +++++++++++++++++++++++------ gcc/config/arm/arm-cpu-data.h | 1410 ++--------------- gcc/config/arm/arm-cpu.h | 38 + gcc/config/arm/arm-cpus.in | 237 ++- gcc/config/arm/arm-isa.h | 20 +- gcc/config/arm/arm-protos.h | 56 +- gcc/config/arm/arm-tables.opt | 21 +- gcc/config/arm/arm.c | 337 ++-- gcc/config/arm/arm.h | 75 +- gcc/config/arm/arm.opt | 15 +- gcc/config/arm/bpabi.h | 4 - gcc/config/arm/elf.h | 6 +- gcc/config/arm/linux-elf.h | 3 - gcc/config/arm/netbsd-elf.h | 4 - gcc/config/arm/parsecpu.awk | 295 +++- gcc/config/arm/t-aprofile | 200 +-- gcc/config/arm/t-arm-elf | 173 +- gcc/config/arm/t-fuchsia | 33 + gcc/config/arm/t-linux-eabi | 4 + gcc/config/arm/t-multilib | 126 +- gcc/config/arm/t-phoenix | 20 +- gcc/config/arm/t-rmprofile | 147 +- gcc/config/arm/t-rtems | 49 +- gcc/config/arm/t-symbian | 34 +- gcc/config/arm/vxworks.h | 2 - gcc/doc/fragments.texi | 10 +- gcc/doc/invoke.texi | 371 ++++- gcc/genmultilib | 4 +- gcc/testsuite/gcc.dg/pr59418.c | 2 +- gcc/testsuite/gcc.target/arm/multilib.exp | 685 ++++++++ gcc/testsuite/gcc.target/arm/pr51915.c | 2 +- gcc/testsuite/gcc.target/arm/pr52006.c | 2 +- gcc/testsuite/gcc.target/arm/pr53187.c | 2 +- libgcc/config/arm/cmse_nonsecure_call.S | 8 + 38 files changed, 5073 insertions(+), 2440 deletions(-) create mode 100644 gcc/config/arm/t-fuchsia create mode 100644 gcc/testsuite/gcc.target/arm/multilib.exp ----------------2.7.4--