Re: [Patch 4/8, Arm. GCC] Add testsuite library support for PACBTI target. [Was RE: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target.]
On 28/10/2021 12:42, Tejas Belagod via Gcc-patches wrote: -Original Message- From: Richard Earnshaw Sent: Monday, October 11, 2021 2:38 PM To: Tejas Belagod ; gcc-patches@gcc.gnu.org Subject: Re: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target. On 11/10/2021 14:36, Richard Earnshaw via Gcc-patches wrote: On 08/10/2021 13:17, Tejas Belagod via Gcc-patches wrote: Hi, Add targeting-checking entities for PACBTI in testsuite framework. Tested on arm-none-eabi. OK for trunk? 2021-10-04 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp (check_effective_target_arm_pacbti_hw): New. OK. R. Oh, wait! Not OK. Needs documentation in sourcebuild.texi. Thanks for the reviews. Add targeting-checking entities for PACBTI in testsuite framework. 2021-10-25 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp: (check_effective_target_arm_pacbti_hw): New. * doc/sourcebuild.texi: Document arm_pacbti_hw. The testsuite has its own changelog file. Tested the following configurations, OK for trunk? -mthumb/-march=armv8.1-m.main+pacbti/-mfloat-abi=soft -marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp mcmodel=small and tiny aarch64-none-linux-gnu native test and bootstrap Thanks, Tejas. Otherwise, OK. R.
[Patch 4/8, Arm. GCC] Add testsuite library support for PACBTI target. [Was RE: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target.]
> -Original Message- > From: Richard Earnshaw > Sent: Monday, October 11, 2021 2:38 PM > To: Tejas Belagod ; gcc-patches@gcc.gnu.org > Subject: Re: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI > target. > > On 11/10/2021 14:36, Richard Earnshaw via Gcc-patches wrote: > > On 08/10/2021 13:17, Tejas Belagod via Gcc-patches wrote: > >> Hi, > >> > >> Add targeting-checking entities for PACBTI in testsuite framework. > >> > >> Tested on arm-none-eabi. OK for trunk? > >> > >> 2021-10-04 Tejas Belagod > >> > >> gcc/ChangeLog: > >> > >> * testsuite/lib/target-supports.exp > >> (check_effective_target_arm_pacbti_hw): New. > >> > > > > OK. > > > > R. > > Oh, wait! Not OK. Needs documentation in sourcebuild.texi. > Thanks for the reviews. Add targeting-checking entities for PACBTI in testsuite framework. 2021-10-25 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp: (check_effective_target_arm_pacbti_hw): New. * doc/sourcebuild.texi: Document arm_pacbti_hw. Tested the following configurations, OK for trunk? -mthumb/-march=armv8.1-m.main+pacbti/-mfloat-abi=soft -marm/-march=armv7-a/-mfpu=vfpv3-d16/-mfloat-abi=softfp mcmodel=small and tiny aarch64-none-linux-gnu native test and bootstrap Thanks, Tejas. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 6a16576763006a13e946147ab1ea5b16b5bc219b..3dd1dd8d7f031720e55cf389376f1572991d8071 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2141,6 +2141,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. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1c8b1ebb86e8769e40fe88af3a4c651990dbb2a1..843397adf437700ca622ce140359b6aaa0172e42 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5064,6 +5064,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"); + } +} ""] +} + # Return 1 if this compilation turns on string_ops_prefer_neon on. proc check_effective_target_arm_tune_string_ops_prefer_neon { } {
Re: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target.
On 11/10/2021 14:36, Richard Earnshaw via Gcc-patches wrote: On 08/10/2021 13:17, Tejas Belagod via Gcc-patches wrote: Hi, Add targeting-checking entities for PACBTI in testsuite framework. Tested on arm-none-eabi. OK for trunk? 2021-10-04 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp (check_effective_target_arm_pacbti_hw): New. OK. R. Oh, wait! Not OK. Needs documentation in sourcebuild.texi. R.
Re: [Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target.
On 08/10/2021 13:17, Tejas Belagod via Gcc-patches wrote: Hi, Add targeting-checking entities for PACBTI in testsuite framework. Tested on arm-none-eabi. OK for trunk? 2021-10-04 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp (check_effective_target_arm_pacbti_hw): New. OK. R.
[Patch 3/7, Arm, GCC] Add testsuite library support for PACBTI target.
Hi, Add targeting-checking entities for PACBTI in testsuite framework. Tested on arm-none-eabi. OK for trunk? 2021-10-04 Tejas Belagod gcc/ChangeLog: * testsuite/lib/target-supports.exp (check_effective_target_arm_pacbti_hw): New. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 9ebca7ac007363d2a35158bb80092118f629b97b..323541c2da527e3da5dce4d85cadcb2068d9bb5c 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5064,6 +5064,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"); + } +} ""] +} + # Return 1 if this compilation turns on string_ops_prefer_neon on. proc check_effective_target_arm_tune_string_ops_prefer_neon { } {