From b6aada16ddfa4398e6d67711f856edf84c817300 Mon Sep 17 00:00:00 2001 From: Renlin Li Date: Wed, 24 Jun 2015 13:36:53 +0000 Subject: [PATCH] [PATCH][AARCH64]Add ACLE predefined marcos: __ARM_ALIGN_MAX_PWR and __ARM_ALIGN_MAX_STACK_PWR gcc/ 2015-06-24 Renlin Li * config/aarch64/aarch64.h(TARGET_CPU_CPP_BUILTINS): Add __ARM_ALIGN_MAX_PWR, __ARM_ALIGN_MAX_STACK_PWR. gcc/testsuite/ 2015-06-24 Renlin Li * gcc.target/aarch64/arm_align_max_pwr.c: New. * gcc.target/aarch64/arm_align_max_stack_pwr.c: New. From-SVN: r224898 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.h | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ .../gcc.target/aarch64/arm_align_max_pwr.c | 15 +++++++++++++++ .../gcc.target/aarch64/arm_align_max_stack_pwr.c | 15 +++++++++++++++ 5 files changed, 44 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c create mode 100644 gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4694b14da0..6c4a2678878 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Renlin Li + + * config/aarch64/aarch64.h(TARGET_CPU_CPP_BUILTINS): Add + __ARM_ALIGN_MAX_PWR, __ARM_ALIGN_MAX_STACK_PWR. + 2015-06-24 Richard Biener * genmatch.c (enum tree_code): Add VIEW_CONVERT[012]. diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index a22c6e40b5e..8b2d2ca6ff7 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -28,6 +28,10 @@ { \ builtin_define ("__aarch64__"); \ builtin_define ("__ARM_64BIT_STATE"); \ + builtin_define_with_int_value \ + ("__ARM_ALIGN_MAX_PWR", 28); \ + builtin_define_with_int_value \ + ("__ARM_ALIGN_MAX_STACK_PWR", 16); \ builtin_define_with_int_value \ ("__ARM_ARCH", aarch64_architecture_version); \ cpp_define_formatted \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7040593fbed..4de42859817 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-06-24 Renlin Li + + * gcc.target/aarch64/arm_align_max_pwr.c: New. + * gcc.target/aarch64/arm_align_max_stack_pwr.c: New. + 2015-06-24 Patrick Palka Revert: diff --git a/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c b/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c new file mode 100644 index 00000000000..bbb4c6f9d04 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/arm_align_max_pwr.c @@ -0,0 +1,15 @@ +/* { dg-do run } */ + +#include +#include + +#define align (1ul << __ARM_ALIGN_MAX_PWR) +static int x __attribute__ ((aligned (align))); + +int +main () +{ + assert ((((unsigned long)&x) & (align - 1)) == 0); + + return 0; +} diff --git a/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c b/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c new file mode 100644 index 00000000000..7a6355b054e --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/arm_align_max_stack_pwr.c @@ -0,0 +1,15 @@ +/* { dg-do run } */ + +#include +#include + +#define align (1ul << __ARM_ALIGN_MAX_STACK_PWR) + +int +main () +{ + int x __attribute__ ((aligned (align))); + + assert ((((unsigned long)&x) & (align - 1)) == 0); + return 0; +} -- 2.30.2