From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 8225938133F4; Mon, 30 May 2022 09:51:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8225938133F4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] aarch64: Allow purecap default ABI X-Act-Checkin: gcc X-Git-Author: Szabolcs Nagy X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 6ed8d5136a3663cadb285b2511f7ecbf6d8dffea X-Git-Newrev: 46cd649e34f63620153d5ebe3f15e96e7bb865f5 Message-Id: <20220530095156.8225938133F4@sourceware.org> Date: Mon, 30 May 2022 09:51:56 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 09:51:56 -0000 https://gcc.gnu.org/g:46cd649e34f63620153d5ebe3f15e96e7bb865f5 commit 46cd649e34f63620153d5ebe3f15e96e7bb865f5 Author: Szabolcs Nagy Date: Wed Apr 13 13:18:41 2022 +0100 aarch64: Allow purecap default ABI This patch allows building a purecap only gcc. To make the default ABI purecap, configure gcc as --disable-multilib --with-abi=purecap --with-arch=morello+c64 or --with-multilib-list=purecap --with-arch=morello+c64 To build a gcc that defaults to lp64 ABI, but supports purecap too use --with-multilib-list=lp64,purecap Diff: --- gcc/config.gcc | 30 ++++++++++++++++++++++++------ gcc/config/aarch64/aarch64-elf.h | 3 +++ gcc/config/aarch64/biarchpurecap.h | 27 +++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 1df2354229d..8809859395f 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -597,20 +597,38 @@ aarch64*-*-*) case ${with_abi} in "") if test "x$with_multilib_list" = xilp32; then - tm_file="aarch64/biarchilp32.h ${tm_file}" + default_abi=ilp32 + elif test "x$with_multilib_list" = xpurecap; then + default_abi=purecap else - tm_file="aarch64/biarchlp64.h ${tm_file}" + default_abi=lp64 fi ;; + ilp32|lp64|purecap) + default_abi=$with_abi + ;; + *) + echo "Unknown ABI used in --with-abi=$with_abi" + exit 1 + esac + + case $default_abi in ilp32) tm_file="aarch64/biarchilp32.h ${tm_file}" ;; lp64) tm_file="aarch64/biarchlp64.h ${tm_file}" ;; - *) - echo "Unknown ABI used in --with-abi=$with_abi" - exit 1 + purecap) + case ${with_arch} in + morello+c64*) + tm_file="aarch64/biarchpurecap.h ${tm_file}" + ;; + *) + echo "purecap default abi requires --with-arch=morello+c64" + exit 1 + ;; + esac esac ;; i[34567]86-*-*) @@ -1098,7 +1116,7 @@ aarch64*-*-linux*) if test "$aarch64_multilibs" = "default"; then # TODO: turn on ILP32 multilib build after its support is mature. # aarch64_multilibs="lp64,ilp32" - aarch64_multilibs="lp64" + aarch64_multilibs=$default_abi fi aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'` for aarch64_multilib in ${aarch64_multilibs}; do diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h index 492b4fa6af2..9a22a545be1 100644 --- a/gcc/config/aarch64/aarch64-elf.h +++ b/gcc/config/aarch64/aarch64-elf.h @@ -114,6 +114,9 @@ #elif TARGET_DATA_MODEL == 2 #define ABI_SPEC "-mabi=ilp32" #define MULTILIB_DEFAULTS { "mabi=ilp32" } +#elif TARGET_DATA_MODEL == 3 +#define ABI_SPEC "-mabi=purecap %{!march:-march=morello+c64}" +#define MULTILIB_DEFAULTS { "mabi=purecap/march=morello+c64" } #else #error "Unknown or undefined TARGET_DATA_MODEL!" #endif diff --git a/gcc/config/aarch64/biarchpurecap.h b/gcc/config/aarch64/biarchpurecap.h new file mode 100644 index 00000000000..55bf72de882 --- /dev/null +++ b/gcc/config/aarch64/biarchpurecap.h @@ -0,0 +1,27 @@ +/* Make configure files to produce biarch compiler defaulting to purecap ABI. + Copyright (C) 2022 Free Software Foundation, Inc. + Contributed by ARM Ltd. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +#define AARCH64_ABI_DEFAULT AARCH64_ABI_MORELLO_PURECAP +#define TARGET_DATA_MODEL 3