]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
[GCC][PATCH] arm: Add pacbti related multilib support for armv8.1-m.main.
authorSrinath Parvathaneni <srinath.parvathaneni@arm.com>
Fri, 12 Aug 2022 19:47:42 +0000 (20:47 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Fri, 19 Aug 2022 13:22:58 +0000 (15:22 +0200)
Hi,

This patch supports following -march/-mbranch-protection combination by linking them
to existing pacbti multilibs.

$ -march=armv8.1-m.main+pacbti+fp.dp+mve.fp -mbranch-protection=standard -mfloat-abi=hard -mthumb
$ -march=armv8.1-m.main+pacbti+fp.dp+mve -mbranch-protection=standard -mfloat-abi=hard -mthumb
$ -march=armv8.1-m.main+dsp+pacbti+fp.dp -mbranch-protection=standard -mfloat-abi=hard -mthumb

Regression tested on arm-none-eabi and bootstrapped on arm-none-linux-gnueabihf.

Ok for master?

Regards,
Srinath.

gcc/ChangeLog:

2022-08-12  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

        * config/arm/t-rmprofile: Add pacbti multililb variants.

gcc/testsuite/ChangeLog:

2022-08-12  Srinath Parvathaneni  <srinath.parvathaneni@arm.com>

        * gcc.target/arm/pac-10.c: New test.
        * gcc.target/arm/pac-11.c: Likewise.
        * gcc.target/arm/pac-12.c: Likewise.

gcc/config/arm/t-rmprofile
gcc/testsuite/gcc.target/arm/pac-10.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pac-11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/pac-12.c [new file with mode: 0644]

index fe46a1efa1a8b212e6f4051283573debfc386ff8..77e248e47feeddb2328a82aec6b485ff0f6fd62e 100644 (file)
@@ -97,6 +97,13 @@ MULTILIB_MATCHES += $(foreach FP, $(v8_1m_sp_variants), \
 MULTILIB_MATCHES += $(foreach FP, $(v8_1m_dp_variants), \
                             march?armv8-m.main+fp.dp=mlibarch?armv8.1-m.main$(FP))
 
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=march?armv8.1-m.main+pacbti+fp.dp+mve.fp
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+pacbti+fp.dp+mve.fp
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=march?armv8.1-m.main+pacbti+fp.dp+mve
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+pacbti+fp.dp+mve
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=march?armv8.1-m.main+dsp+pacbti+fp.dp
+MULTILIB_MATCHES       += march?armv8.1-m.main+pacbti+fp.dp=mlibarch?armv8.1-m.main+dsp+pacbti+fp.dp
+
 # Map all mbranch-protection values other than 'none' to 'standard'.
 MULTILIB_MATCHES       += mbranch-protection?standard=mbranch-protection?bti
 MULTILIB_MATCHES       += mbranch-protection?standard=mbranch-protection?pac-ret
diff --git a/gcc/testsuite/gcc.target/arm/pac-10.c b/gcc/testsuite/gcc.target/arm/pac-10.c
new file mode 100644 (file)
index 0000000..faf836b
--- /dev/null
@@ -0,0 +1,7 @@
+/* Testing PACBTI multilib matches.  */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_pacbti_hw } */
+/* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" } } */
+/* { dg-options "-march=armv8.1-m.main+mve.fp+fp.dp+pacbti -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
+
+#include "pac.h"
diff --git a/gcc/testsuite/gcc.target/arm/pac-11.c b/gcc/testsuite/gcc.target/arm/pac-11.c
new file mode 100644 (file)
index 0000000..51609b6
--- /dev/null
@@ -0,0 +1,7 @@
+/* Testing PACBTI multilibs matches without mve float.  */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_pacbti_hw } */
+/* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" } } */
+/* { dg-options "-march=armv8.1-m.main+mve+fp.dp+pacbti -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
+
+#include "pac.h"
diff --git a/gcc/testsuite/gcc.target/arm/pac-12.c b/gcc/testsuite/gcc.target/arm/pac-12.c
new file mode 100644 (file)
index 0000000..6e1295c
--- /dev/null
@@ -0,0 +1,7 @@
+/* Testing PACBTI multilibs matches without mve.  */
+/* { dg-do run } */
+/* { dg-require-effective-target arm_pacbti_hw } */
+/* { dg-skip-if "need fp instructions" { *-*-* } { "" } { "-mfloat-abi=hard" } } */
+/* { dg-options "-march=armv8.1-m.main+dsp+fp.dp+pacbti -mbranch-protection=standard -mthumb -mfloat-abi=hard" } */
+
+#include "pac.h"