public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] aarch64: Allow purecap default ABI
Date: Mon, 30 May 2022 09:51:56 +0000 (GMT)	[thread overview]
Message-ID: <20220530095156.8225938133F4@sourceware.org> (raw)

https://gcc.gnu.org/g:46cd649e34f63620153d5ebe3f15e96e7bb865f5

commit 46cd649e34f63620153d5ebe3f15e96e7bb865f5
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
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
+<http://www.gnu.org/licenses/>.  */
+
+#define AARCH64_ABI_DEFAULT AARCH64_ABI_MORELLO_PURECAP
+#define TARGET_DATA_MODEL 3


                 reply	other threads:[~2022-05-30  9:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220530095156.8225938133F4@sourceware.org \
    --to=nsz@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).