public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5292] [PATCH 4/15] arm: Add testsuite library support for PACBTI target
@ 2023-01-23 10:46 Andrea Corallo
  0 siblings, 0 replies; only message in thread
From: Andrea Corallo @ 2023-01-23 10:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8ce721cd96ac2ec0c9194df35daa5aeae8541b7a

commit r13-5292-g8ce721cd96ac2ec0c9194df35daa5aeae8541b7a
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
    
            * lib/target-supports.exp:
            (check_effective_target_arm_pacbti_hw): New.
    
    gcc/ChangeLog:
            * 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 e605707a61c..be4318221cc 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -2195,6 +2195,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.
@@ -2284,6 +2288,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 38b95145117..a9ee288dab5 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5218,6 +5218,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 { } {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-23 10:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 10:46 [gcc r13-5292] [PATCH 4/15] arm: Add testsuite library support for PACBTI target Andrea Corallo

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).