[PATCH][AArch64][10/14] Implement target pragmas

2015-07-16 Thread Kyrill Tkachov

Hi all,

This patch implements target pragmas for aarch64.
The pragmas accepted are the same as for target attributes (as required).
In addition pragmas will need to redefine the target-specific preprocessor
macros if appropriate.

A new file: aarch64-c.c is added and the code from TARGET_CPU_CPP_BUILTINS is 
moved there
and split up into the unconditional parts that are always defined and the 
conditional stuff
that depends on certain architectural features.  The pragma processing code 
calls that
to redefine preprocessor macros on the fly.
The implementation is similar to the rs6000 one.

With target pragmas implemented, we can use them in the arm_neon.h and 
arm_acle.h headers to
specify the architectural features required for those intrinsics, rather than 
#ifdef'ing them
out when FP/SIMD is not available from the command line.

We need to do this in order to handle cases where the user compiles a file with 
-mgeneral-regs-only
but has a function tagged with +simd and tries to use the arm_neon.h intrinsics.
Tests and documentation comes as a separate patch later on in the series

Bootstrapped and tested on aarch64.

Ok for trunk?

Thanks,
Kyrill

2015-07-16  Kyrylo Tkachov  

* config.gcc (aarch64*-*-*): Specify c_target_objs and cxx_target_objs.
* config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS):
(TARGET_CPU_CPP_BUILTINS): Redefine to call aarch64_cpu_cpp_builtins.
* config/aarch64/aarch64.c (aarch64_override_options_internal): Remove
static keyword.
(aarch64_reset_previous_fndecl): New function.
* config/aarch64/aarch64-c.c: New file.
* config/aarch64/arm_acle.h: Add pragma +crc+nofp at the top.
Push and pop options at beginning and end.  Remove ifdef
__ARM_FEATURE_CRC32.
* config/aarch64/arm_neon.h: Remove #ifdef check on __ARM_NEON.
Add pragma arch=armv8-a+simd and +crypto where appropriate.
* config/aarch64/t-aarch64 (aarch64-c.o): New rule.

2015-07-16  Kyrylo Tkachov  

* gcc.target/aarch64/arm_neon-nosimd-error.c: Delete.
commit 62979865acc0a1c832882cbb8871e6860efce620
Author: Kyrylo Tkachov 
Date:   Thu May 14 15:36:07 2015 +0100

[AArch64][10/N] Implement target pragmas

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 900aa18..5da8442 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -302,6 +302,8 @@ m32c*-*-*)
 aarch64*-*-*)
 	cpu_type=aarch64
 	extra_headers="arm_neon.h arm_acle.h"
+c_target_objs="aarch64-c.o"
+cxx_target_objs="aarch64-c.o"
 	extra_objs="aarch64-builtins.o aarch-common.o cortex-a57-fma-steering.o"
 	target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c"
 	target_has_targetm_common=yes
diff --git a/gcc/config/aarch64/aarch64-c.c b/gcc/config/aarch64/aarch64-c.c
new file mode 100644
index 000..c3798a1
--- /dev/null
+++ b/gcc/config/aarch64/aarch64-c.c
@@ -0,0 +1,192 @@
+/* Target-specific code for C family languages.
+   Copyright (C) 2015 Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GCC; see the file COPYING3.  If not see
+   .  */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "input.h"
+#include "tm_p.h"
+#include "flags.h"
+#include "c-family/c-common.h"
+#include "cpplib.h"
+#include "c-family/c-pragma.h"
+#include "langhooks.h"
+#include "target.h"
+
+
+#define builtin_define(TXT) cpp_define (pfile, TXT)
+#define builtin_assert(TXT) cpp_assert (pfile, TXT)
+
+
+static void
+aarch64_def_or_undef (bool def_p, const char *macro, cpp_reader *pfile)
+{
+  if (def_p)
+cpp_define (pfile, macro);
+  else
+cpp_undef (pfile, macro);
+}
+
+/* Define the macros that we always expect to have on AArch64.  */
+static void
+aarch64_define_unconditional_macros (cpp_reader *pfile)
+{
+  builtin_define ("__aarch64__");
+  builtin_define ("__ARM_64BIT_STATE");
+
+  builtin_define ("__ARM_ARCH_ISA_A64");
+  builtin_define_with_int_value ("__ARM_ALIGN_MAX_PWR", 28);
+  builtin_define_with_int_value ("__ARM_ALIGN_MAX_STACK_PWR", 16);
+
+  /* __ARM_ARCH_8A is not mandated by ACLE but we define it unconditionally
+ as interoperability with the same arm macro.  */
+  builtin_define ("__ARM_ARCH_8A");
+
+  builtin_define_with_int_value ("__ARM_ARCH_PROFILE", 'A');
+  builtin_define ("__ARM_FEATURE_CLZ");
+  builtin_define ("__ARM_FEATURE_IDIV");
+  builtin_define ("__ARM_FEATURE_UNALIGNED");
+  builtin_define ("__ARM_PCS_AAPCS64");
+  builtin_d

Re: [PATCH][AArch64][10/14] Implement target pragmas

2015-07-21 Thread James Greenhalgh
On Thu, Jul 16, 2015 at 04:21:05PM +0100, Kyrill Tkachov wrote:
> Hi all,
> 
> This patch implements target pragmas for aarch64.
> The pragmas accepted are the same as for target attributes (as required).
> In addition pragmas will need to redefine the target-specific preprocessor
> macros if appropriate.
> 
> A new file: aarch64-c.c is added and the code from TARGET_CPU_CPP_BUILTINS is 
> moved there
> and split up into the unconditional parts that are always defined and the 
> conditional stuff
> that depends on certain architectural features.  The pragma processing code 
> calls that
> to redefine preprocessor macros on the fly.
> The implementation is similar to the rs6000 one.
> 
> With target pragmas implemented, we can use them in the arm_neon.h and 
> arm_acle.h headers to
> specify the architectural features required for those intrinsics, rather than 
> #ifdef'ing them
> out when FP/SIMD is not available from the command line.
> 
> We need to do this in order to handle cases where the user compiles a file 
> with -mgeneral-regs-only
> but has a function tagged with +simd and tries to use the arm_neon.h 
> intrinsics.
> Tests and documentation comes as a separate patch later on in the series
> 
> Bootstrapped and tested on aarch64.
> 
> Ok for trunk?

A couple of ChangeLog nits and some comments below.

> 
> 2015-07-16  Kyrylo Tkachov  
> 
>  * config.gcc (aarch64*-*-*): Specify c_target_objs and cxx_target_objs.
>  * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS):

This should say 

>  * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS): New.

Presumably (or maybe "Define.").


>  (TARGET_CPU_CPP_BUILTINS): Redefine to call aarch64_cpu_cpp_builtins.
>  * config/aarch64/aarch64.c (aarch64_override_options_internal): Remove
>  static keyword.
>  (aarch64_reset_previous_fndecl): New function.
>  * config/aarch64/aarch64-c.c: New file.
>  * config/aarch64/arm_acle.h: Add pragma +crc+nofp at the top.
>  Push and pop options at beginning and end.  Remove ifdef
>  __ARM_FEATURE_CRC32.
>  * config/aarch64/arm_neon.h: Remove #ifdef check on __ARM_NEON.
>  Add pragma arch=armv8-a+simd and +crypto where appropriate.
>  * config/aarch64/t-aarch64 (aarch64-c.o): New rule.

I don't see a ChangeLog entry for these hunks:

> diff --git a/gcc/config/aarch64/aarch64-protos.h 
> b/gcc/config/aarch64/aarch64-protos.h
> index 3a5482d..4704736 100644
> --- a/gcc/config/aarch64/aarch64-protos.h
> +++ b/gcc/config/aarch64/aarch64-protos.h
> @@ -360,6 +360,10 @@ bool aarch64_gen_adjusted_ldpstp (rtx *, bool, enum 
> machine_mode, RTX_CODE);
>  #endif /* RTX_CODE */
>  
>  void aarch64_init_builtins (void);
> +
> +bool aarch64_process_target_attr (tree, const char*);
> +void aarch64_override_options_internal (struct gcc_options *);
> +
>  rtx aarch64_expand_builtin (tree exp,
>   rtx target,
>   rtx subtarget ATTRIBUTE_UNUSED,
> @@ -376,6 +380,9 @@ extern void aarch64_split_combinev16qi (rtx operands[3]);
>  extern void aarch64_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
>  extern bool aarch64_madd_needs_nop (rtx_insn *);
>  extern void aarch64_final_prescan_insn (rtx_insn *);
> +extern void aarch64_reset_previous_fndecl (void);
> +extern void aarch64_cpu_cpp_builtins (cpp_reader *);
> +extern void aarch64_register_pragmas (void);
>  extern bool
>  aarch64_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
>  bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,




> +static bool
> +aarch64_pragma_target_parse (tree args, tree pop_target)
> +{
> +
> +  bool ret;
> +
> +  /* If args is not NULL then process it and setup the target-specific
> + information that it specifies.  */
> +  if (args)
> +{
> +  ret = aarch64_process_target_attr (args, "pragma");
> +  if (ret)
> + aarch64_override_options_internal (&global_options);

RET must equal true.

> +  else
> + return false;

Early return of false closes the other control path here.

> +}
> +
> +  /* args is NULL, restore to the state described in pop_target.  */
> +  else
> +{
> +  pop_target = pop_target ? pop_target : target_option_default_node;
> +  cl_target_option_restore (&global_options,
> + TREE_TARGET_OPTION (pop_target));
> +  ret = true;
> +}

Therefore RET must equal true here.

> +
> +  target_option_current_node
> += build_target_option_node (&global_options);
> +
> +  aarch64_reset_previous_fndecl ();
> +  /* For the definitions, ensure all newly defined macros are considered
> + as used for -Wunused-macros.  There is no point warning about the
> + compiler predefined macros.  */
> +  cpp_options *cpp_opts = cpp_get_options (parse_in);
> +  unsigned char saved_warn_unused_macros = cpp_opts->warn_unused_macros;
> +  cpp_opts->warn_unused_macros = 0;
> +
> +  aarch64_update_cpp_builtins (parse_in);
> +
> +  cpp_opts->warn

Re: [PATCH][AArch64][10/14] Implement target pragmas

2015-07-24 Thread Kyrill Tkachov


On 21/07/15 17:52, James Greenhalgh wrote:

On Thu, Jul 16, 2015 at 04:21:05PM +0100, Kyrill Tkachov wrote:

Hi all,

This patch implements target pragmas for aarch64.
The pragmas accepted are the same as for target attributes (as required).
In addition pragmas will need to redefine the target-specific preprocessor
macros if appropriate.

A new file: aarch64-c.c is added and the code from TARGET_CPU_CPP_BUILTINS is 
moved there
and split up into the unconditional parts that are always defined and the 
conditional stuff
that depends on certain architectural features.  The pragma processing code 
calls that
to redefine preprocessor macros on the fly.
The implementation is similar to the rs6000 one.

With target pragmas implemented, we can use them in the arm_neon.h and 
arm_acle.h headers to
specify the architectural features required for those intrinsics, rather than 
#ifdef'ing them
out when FP/SIMD is not available from the command line.

We need to do this in order to handle cases where the user compiles a file with 
-mgeneral-regs-only
but has a function tagged with +simd and tries to use the arm_neon.h intrinsics.
Tests and documentation comes as a separate patch later on in the series

Bootstrapped and tested on aarch64.

Ok for trunk?

A couple of ChangeLog nits and some comments below.


2015-07-16  Kyrylo Tkachov  

  * config.gcc (aarch64*-*-*): Specify c_target_objs and cxx_target_objs.
  * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS):

This should say


  * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS): New.

Presumably (or maybe "Define.").



  (TARGET_CPU_CPP_BUILTINS): Redefine to call aarch64_cpu_cpp_builtins.
  * config/aarch64/aarch64.c (aarch64_override_options_internal): Remove
  static keyword.
  (aarch64_reset_previous_fndecl): New function.
  * config/aarch64/aarch64-c.c: New file.
  * config/aarch64/arm_acle.h: Add pragma +crc+nofp at the top.
  Push and pop options at beginning and end.  Remove ifdef
  __ARM_FEATURE_CRC32.
  * config/aarch64/arm_neon.h: Remove #ifdef check on __ARM_NEON.
  Add pragma arch=armv8-a+simd and +crypto where appropriate.
  * config/aarch64/t-aarch64 (aarch64-c.o): New rule.

I don't see a ChangeLog entry for these hunks:


diff --git a/gcc/config/aarch64/aarch64-protos.h 
b/gcc/config/aarch64/aarch64-protos.h
index 3a5482d..4704736 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -360,6 +360,10 @@ bool aarch64_gen_adjusted_ldpstp (rtx *, bool, enum 
machine_mode, RTX_CODE);
  #endif /* RTX_CODE */
  
  void aarch64_init_builtins (void);

+
+bool aarch64_process_target_attr (tree, const char*);
+void aarch64_override_options_internal (struct gcc_options *);
+
  rtx aarch64_expand_builtin (tree exp,
rtx target,
rtx subtarget ATTRIBUTE_UNUSED,
@@ -376,6 +380,9 @@ extern void aarch64_split_combinev16qi (rtx operands[3]);
  extern void aarch64_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
  extern bool aarch64_madd_needs_nop (rtx_insn *);
  extern void aarch64_final_prescan_insn (rtx_insn *);
+extern void aarch64_reset_previous_fndecl (void);
+extern void aarch64_cpu_cpp_builtins (cpp_reader *);
+extern void aarch64_register_pragmas (void);
  extern bool
  aarch64_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
  bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,





+static bool
+aarch64_pragma_target_parse (tree args, tree pop_target)
+{
+
+  bool ret;
+
+  /* If args is not NULL then process it and setup the target-specific
+ information that it specifies.  */
+  if (args)
+{
+  ret = aarch64_process_target_attr (args, "pragma");
+  if (ret)
+   aarch64_override_options_internal (&global_options);

RET must equal true.


+  else
+   return false;

Early return of false closes the other control path here.


+}
+
+  /* args is NULL, restore to the state described in pop_target.  */
+  else
+{
+  pop_target = pop_target ? pop_target : target_option_default_node;
+  cl_target_option_restore (&global_options,
+   TREE_TARGET_OPTION (pop_target));
+  ret = true;
+}

Therefore RET must equal true here.


+
+  target_option_current_node
+= build_target_option_node (&global_options);
+
+  aarch64_reset_previous_fndecl ();
+  /* For the definitions, ensure all newly defined macros are considered
+ as used for -Wunused-macros.  There is no point warning about the
+ compiler predefined macros.  */
+  cpp_options *cpp_opts = cpp_get_options (parse_in);
+  unsigned char saved_warn_unused_macros = cpp_opts->warn_unused_macros;
+  cpp_opts->warn_unused_macros = 0;
+
+  aarch64_update_cpp_builtins (parse_in);
+
+  cpp_opts->warn_unused_macros = saved_warn_unused_macros;
+
+  return ret;

So we don't need "RET" !


+}
+
+/* Implement REGISTER_TARGET_PRAGMAS.  */
+
+void

Re: [PATCH][AArch64][10/14] Implement target pragmas

2015-08-03 Thread Kyrill Tkachov


On 24/07/15 09:36, Kyrill Tkachov wrote:

On 21/07/15 17:52, James Greenhalgh wrote:

On Thu, Jul 16, 2015 at 04:21:05PM +0100, Kyrill Tkachov wrote:

Hi all,

This patch implements target pragmas for aarch64.
The pragmas accepted are the same as for target attributes (as required).
In addition pragmas will need to redefine the target-specific preprocessor
macros if appropriate.

A new file: aarch64-c.c is added and the code from TARGET_CPU_CPP_BUILTINS is 
moved there
and split up into the unconditional parts that are always defined and the 
conditional stuff
that depends on certain architectural features.  The pragma processing code 
calls that
to redefine preprocessor macros on the fly.
The implementation is similar to the rs6000 one.

With target pragmas implemented, we can use them in the arm_neon.h and 
arm_acle.h headers to
specify the architectural features required for those intrinsics, rather than 
#ifdef'ing them
out when FP/SIMD is not available from the command line.

We need to do this in order to handle cases where the user compiles a file with 
-mgeneral-regs-only
but has a function tagged with +simd and tries to use the arm_neon.h intrinsics.
Tests and documentation comes as a separate patch later on in the series

Bootstrapped and tested on aarch64.

Ok for trunk?

A couple of ChangeLog nits and some comments below.


2015-07-16  Kyrylo Tkachov  

   * config.gcc (aarch64*-*-*): Specify c_target_objs and cxx_target_objs.
   * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS):

This should say


   * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS): New.

Presumably (or maybe "Define.").



   (TARGET_CPU_CPP_BUILTINS): Redefine to call aarch64_cpu_cpp_builtins.
   * config/aarch64/aarch64.c (aarch64_override_options_internal): Remove
   static keyword.
   (aarch64_reset_previous_fndecl): New function.
   * config/aarch64/aarch64-c.c: New file.
   * config/aarch64/arm_acle.h: Add pragma +crc+nofp at the top.
   Push and pop options at beginning and end.  Remove ifdef
   __ARM_FEATURE_CRC32.
   * config/aarch64/arm_neon.h: Remove #ifdef check on __ARM_NEON.
   Add pragma arch=armv8-a+simd and +crypto where appropriate.
   * config/aarch64/t-aarch64 (aarch64-c.o): New rule.

I don't see a ChangeLog entry for these hunks:


diff --git a/gcc/config/aarch64/aarch64-protos.h 
b/gcc/config/aarch64/aarch64-protos.h
index 3a5482d..4704736 100644
--- a/gcc/config/aarch64/aarch64-protos.h
+++ b/gcc/config/aarch64/aarch64-protos.h
@@ -360,6 +360,10 @@ bool aarch64_gen_adjusted_ldpstp (rtx *, bool, enum 
machine_mode, RTX_CODE);
   #endif /* RTX_CODE */

   void aarch64_init_builtins (void);
+
+bool aarch64_process_target_attr (tree, const char*);
+void aarch64_override_options_internal (struct gcc_options *);
+
   rtx aarch64_expand_builtin (tree exp,
  rtx target,
  rtx subtarget ATTRIBUTE_UNUSED,
@@ -376,6 +380,9 @@ extern void aarch64_split_combinev16qi (rtx operands[3]);
   extern void aarch64_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
   extern bool aarch64_madd_needs_nop (rtx_insn *);
   extern void aarch64_final_prescan_insn (rtx_insn *);
+extern void aarch64_reset_previous_fndecl (void);
+extern void aarch64_cpu_cpp_builtins (cpp_reader *);
+extern void aarch64_register_pragmas (void);
   extern bool
   aarch64_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
   bool aarch64_handle_option (struct gcc_options *, struct gcc_options *,




+static bool
+aarch64_pragma_target_parse (tree args, tree pop_target)
+{
+
+  bool ret;
+
+  /* If args is not NULL then process it and setup the target-specific
+ information that it specifies.  */
+  if (args)
+{
+  ret = aarch64_process_target_attr (args, "pragma");
+  if (ret)
+aarch64_override_options_internal (&global_options);

RET must equal true.


+  else
+return false;

Early return of false closes the other control path here.


+}
+
+  /* args is NULL, restore to the state described in pop_target.  */
+  else
+{
+  pop_target = pop_target ? pop_target : target_option_default_node;
+  cl_target_option_restore (&global_options,
+TREE_TARGET_OPTION (pop_target));
+  ret = true;
+}

Therefore RET must equal true here.


+
+  target_option_current_node
+= build_target_option_node (&global_options);
+
+  aarch64_reset_previous_fndecl ();
+  /* For the definitions, ensure all newly defined macros are considered
+ as used for -Wunused-macros.  There is no point warning about the
+ compiler predefined macros.  */
+  cpp_options *cpp_opts = cpp_get_options (parse_in);
+  unsigned char saved_warn_unused_macros = cpp_opts->warn_unused_macros;
+  cpp_opts->warn_unused_macros = 0;
+
+  aarch64_update_cpp_builtins (parse_in);
+
+  cpp_opts->warn_unused_macros = saved_warn_unused_macros;
+
+  return ret;

So we don't need "RET" !


+}
+
+/

Re: [PATCH][AArch64][10/14] Implement target pragmas

2015-08-03 Thread James Greenhalgh
On Mon, Aug 03, 2015 at 10:36:17AM +0100, Kyrill Tkachov wrote:
> And here is a rebased version to resolve a conflict after Alan's patches went 
> in.
> 

OK with the nits below fixed.

> 2015-08-03  Kyrylo Tkachov  
> 
>   * config.gcc (aarch64*-*-*): Specify c_target_objs and cxx_target_objs.
>   * config/aarch64/aarch64.h (REGISTER_TARGET_PRAGMAS): Define.
>   (TARGET_CPU_CPP_BUILTINS): Redefine to call aarch64_cpu_cpp_builtins.
>   * config/aarch64/aarch64.c (aarch64_override_options_internal): Remove
>   static keyword.
>   (aarch64_reset_previous_fndecl): New function.
>   (aarch64_handle_attr_isa_flags): Handle "+nothing" in the beginning of
>   the string.
>   * config/aarch64/aarch64-c.c: New file.
>   * config/aarch64/arm_acle.h: Add pragma +crc+nofp at the top.
>   Push and pop options at beginning and end.  Remove ifdef
>   __ARM_FEATURE_CRC32.
>   * config/aarch64/arm_neon.h: Remove #ifdef check on __ARM_NEON.
>   Add pragma arch=armv8-a+simd and +crypto where appropriate.
>   * config/aarch64/t-aarch64 (aarch64-c.o): New rule.
>   * config/aarch64/aarch64-protos.h (aarch64_cpu_cpp_builtins):
>   Define prototype.
>   (aarch64_register_pragmas): Likewise.
>   (aarch64_reset_previous_fndecl): Likewise.
>   (aarch64_process_target_attr): Likewise.
>   (aarch64_override_options_internal): Likewise.
> 
> 2015-08-03  Kyrylo Tkachov  
> 
>  * gcc.target/aarch64/arm_neon-nosimd-error.c: Delete.
> 
> 

> +/* Define the macros that we always expect to have on AArch64.  */
> +
> +static void
> +aarch64_define_unconditional_macros (cpp_reader *pfile)
> +{
> +  builtin_define ("__aarch64__");
> +  builtin_define ("__ARM_64BIT_STATE");
> +
> +  builtin_define ("__ARM_ARCH_ISA_A64");
> +  builtin_define_with_int_value ("__ARM_ALIGN_MAX_PWR", 28);
> +  builtin_define_with_int_value ("__ARM_ALIGN_MAX_STACK_PWR", 16);
> +
> +  /* __ARM_ARCH_8A is not mandated by ACLE but we define it unconditionally
> + as interoperability with the same arm macro.  */
> +  builtin_define ("__ARM_ARCH_8A");
> +
> +  builtin_define_with_int_value ("__ARM_ARCH_PROFILE", 'A');
> +  builtin_define ("__ARM_FEATURE_CLZ");
> +  builtin_define ("__ARM_FEATURE_IDIV");
> +  builtin_define ("__ARM_FEATURE_UNALIGNED");
> +  builtin_define ("__ARM_PCS_AAPCS64");
> +  builtin_define_with_int_value ("__ARM_SIZEOF_WCHAR_T", WCHAR_TYPE_SIZE / 
> 8);
> +
> +}

Extra newline.

> diff --git a/gcc/config/aarch64/aarch64-protos.h 
> b/gcc/config/aarch64/aarch64-protos.h
> index 3a5482d..6844c90 100644
> --- a/gcc/config/aarch64/aarch64-protos.h
> +++ b/gcc/config/aarch64/aarch64-protos.h
> @@ -249,6 +249,7 @@ enum aarch64_symbol_type
>  aarch64_classify_symbolic_expression (rtx, enum aarch64_symbol_context);
>  bool aarch64_const_vec_all_same_int_p (rtx, HOST_WIDE_INT);
>  bool aarch64_constant_address_p (rtx);
> +extern void aarch64_cpu_cpp_builtins (cpp_reader *);

No need for this "extern" - and keep this in alphabetical order (first by
return type, then by name).

> +#pragma GCC push_options
> +#pragma GCC target ("+crypto")

Keep things simple to manage and understand by inspection, and make these
"+nothing+crypto".

> @@ -21067,7 +21065,8 @@ vrsrad_n_u64 (uint64_t __a, uint64_t __b, const int 
> __c)
>return __builtin_aarch64_ursra_ndi_uuus (__a, __b, __c);
>  }
>  
> -#ifdef __ARM_FEATURE_CRYPTO
> +#pragma GCC push_options
> +#pragma GCC target ("+crypto")
>  
>  /* vsha1  */
>  

Likewise here.

Thanks,
James