From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2092) id 126613858C60; Fri, 10 Mar 2023 16:20:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 126613858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678465258; bh=PZFvZpf9Y3tSaCai7kALdGVJONtR4hcohBKLmYKzR0Q=; h=From:To:Subject:Date:From; b=SgPar76HBl8J4/snToGeYkppRfIAzpCewyuWh7D+dMv7Vc05Ww3yev9H8G8eg3btC pCeGCt0E/NiT6aRFQB0/9S4p7f/YAJjKzwCgDeebOiqQJ9jmRiuZ10i/5uAX4BUjhc pJng+FqJzOTDfsUKH76x7nJk3Evk86OOftbLo6yM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andrea Corallo 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 X-Act-Checkin: gcc X-Git-Author: Andrea Corallo X-Git-Refname: refs/vendors/ARM/heads/arm-12-m-pacbti X-Git-Oldrev: f9ed6deaecbf8a1beb366d867ea5ece7beef20f0 X-Git-Newrev: b3069e3ae43d59fcf19981e0f08a62c6b5b883a2 Message-Id: <20230310162058.126613858C60@sourceware.org> Date: Fri, 10 Mar 2023 16:20:58 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b3069e3ae43d59fcf19981e0f08a62c6b5b883a2 commit b3069e3ae43d59fcf19981e0f08a62c6b5b883a2 Author: Andrea Corallo 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 . 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 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 c858bd93b8e..6e0207a193f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5126,6 +5126,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 { } {