public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrea Corallo <akrl@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/arm-12-m-pacbti)] [PATCH 4/15] arm: Add testsuite library support for PACBTI target
Date: Fri, 12 Aug 2022 16:30:28 +0000 (GMT)	[thread overview]
Message-ID: <20220812163028.865003858412@sourceware.org> (raw)

https://gcc.gnu.org/g:8039cb94e9a496163efa75e39990d02adf71f187

commit 8039cb94e9a496163efa75e39990d02adf71f187
Author: Andrea Corallo <andrea.corallo@arm.com>
Date:   Mon Dec 6 11:39:35 2021 +0100

    [PATCH 4/15] arm: Add testsuite library support for PACBTI target
    
    Add targeting-checking entities for PACBTI in testsuite
    framework.
    
    Pre-approved with the requested changes here
    <https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586331.html>.
    
    gcc/testsuite/ChangeLog:
    
            * testsuite/lib/target-supports.exp:
            (check_effective_target_arm_pacbti_hw): New.
            * doc/sourcebuild.texi: Document arm_pacbti_hw.
    
    Co-Authored-By: Tejas Belagod  <tbelagod@arm.com>

Diff:
---
 gcc/doc/sourcebuild.texi              | 10 ++++++++++
 gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 71c04841df2..52162c061bd 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2167,6 +2167,10 @@ ARM target supports options to generate instructions from ARMv8.1-M with
 the Custom Datapath Extension (CDE) and M-Profile Vector Extension (MVE).
 Some multilibs may be incompatible with these options.
 
+@item arm_pacbti_hw
+Test system supports executing Pointer Authentication and Branch Target
+Identification instructions.
+
 @item arm_prefer_ldrd_strd
 ARM target prefers @code{LDRD} and @code{STRD} instructions over
 @code{LDM} and @code{STM} instructions.
@@ -2256,6 +2260,12 @@ ARM target generates Thumb-2 code for @code{-mthumb} but does not
 support executing the Armv8.1-M Mainline Low Overhead Loop
 instructions @code{DLS} and @code{LE}.
 
+@item mbranch_protection_ok
+ARM target supporting @code{-mbranch-protection=standard}.
+
+@item arm_pacbti_hw
+Test system supports for executing non nop pacbti instructions.
+
 @end table
 
 @subsubsection AArch64-specific attributes
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 244fe2306f4..32fe525f8a5 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5123,6 +5123,22 @@ proc check_effective_target_arm_cmse_clear_ok {} {
     } "-mcmse"];
 }
 
+# Return 1 if the target supports executing PACBTI instructions, 0
+# otherwise.
+
+proc check_effective_target_arm_pacbti_hw {} {
+    return [check_runtime arm_pacbti_hw_available {
+	__attribute__ ((naked)) int
+	main (void)
+	{
+	  asm ("pac r12, lr, sp");
+	  asm ("mov r0, #0");
+	  asm ("autg r12, lr, sp");
+	  asm ("bx lr");
+	}
+    } "-march=armv8.1-m.main+pacbti+fp -mbranch-protection=standard -mthumb -mfloat-abi=hard"]
+}
+
 # Return 1 if this compilation turns on string_ops_prefer_neon on.
 
 proc check_effective_target_arm_tune_string_ops_prefer_neon { } {


             reply	other threads:[~2022-08-12 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 16:30 Andrea Corallo [this message]
2023-03-10 16:20 Andrea Corallo

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=20220812163028.865003858412@sourceware.org \
    --to=akrl@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).