aarch64.c (aarch64_print_extension): New function.
authorYufeng Zhang <yufeng.zhang@arm.com>
Wed, 10 Apr 2013 17:22:02 +0000 (17:22 +0000)
committerYufeng Zhang <yufeng@gcc.gnu.org>
Wed, 10 Apr 2013 17:22:02 +0000 (17:22 +0000)
* config/aarch64/aarch64.c (aarch64_print_extension): New function.
(aarch64_start_file): Use the new function.

From-SVN: r197677

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index b9bee5e91f1bd1bcab0e0913fbb4adb99cf100bc..3c281b4c8768f799e9768fb3e36f8335547b39ef 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-10  Yufeng Zhang  <yufeng.zhang@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_print_extension): New function.
+       (aarch64_start_file): Use the new function.
+
 2013-04-10  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
             Jason Merrill  <jason@redhat.com>
 
index 827b8dfba8253d84810f5b409eda86e3554e5bea..49016c10adfccde094d461d0ff37e21b40bb7620 100644 (file)
@@ -7079,13 +7079,31 @@ aarch64_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
   aarch64_emit_unlikely_jump (gen_rtx_SET (VOIDmode, pc_rtx, x));
 }
 
+static void
+aarch64_print_extension (void)
+{
+  const struct aarch64_option_extension *opt = NULL;
+
+  for (opt = all_extensions; opt->name != NULL; opt++)
+    if ((aarch64_isa_flags & opt->flags_on) == opt->flags_on)
+      asm_fprintf (asm_out_file, "+%s", opt->name);
+
+  asm_fprintf (asm_out_file, "\n");
+}
+
 static void
 aarch64_start_file (void)
 {
   if (selected_arch)
-    asm_fprintf (asm_out_file, "\t.arch %s\n", selected_arch->name);
+    {
+      asm_fprintf (asm_out_file, "\t.arch %s", selected_arch->name);
+      aarch64_print_extension ();
+    }
   else if (selected_cpu)
-    asm_fprintf (asm_out_file, "\t.cpu %s\n", selected_cpu->name);
+    {
+      asm_fprintf (asm_out_file, "\t.cpu %s", selected_cpu->name);
+      aarch64_print_extension ();
+    }
   default_file_start();
 }