Blame SOURCES/binutils-2.25.1-aarch64-arch-extension.patch

4910d4
diff -rup binutils-2.25.1.orig/gas/doc/c-aarch64.texi binutils-2.25.1/gas/doc/c-aarch64.texi
4910d4
--- binutils-2.25.1.orig/gas/doc/c-aarch64.texi	2016-06-15 16:35:49.887888595 +0100
4910d4
+++ binutils-2.25.1/gas/doc/c-aarch64.texi	2016-06-15 16:44:41.276361877 +0100
4910d4
@@ -55,11 +55,13 @@ file in ELF32 and ELF64 format respectiv
4910d4
 This option specifies the target processor.  The assembler will issue an error
4910d4
 message if an attempt is made to assemble an instruction which will not execute
4910d4
 on the target processor.  The following processor names are recognized:
4910d4
+@code{cortex-a35},
4910d4
 @code{cortex-a53},
4910d4
 @code{cortex-a57},
4910d4
 @code{cortex-a72},
4910d4
+@code{cortex-a73},
4910d4
 @code{exynos-m1},
4910d4
-@code{xgene1},
4910d4
+@code{xgene1}
4910d4
 and
4910d4
 @code{xgene2}.
4910d4
 The special name @code{all} may be used to allow the assembler to accept
4910d4
@@ -233,6 +235,24 @@ The AArch64 architecture uses @sc{ieee}
4910d4
 @table @code
4910d4
 
4910d4
 @c AAAAAAAAAAAAAAAAAAAAAAAAA
4910d4
+
4910d4
+@cindex @code{.arch} directive, AArch64
4910d4
+@item .arch @var{name}
4910d4
+Select the target architecture.  Valid values for @var{name} are the same as
4910d4
+for the @option{-march} commandline option.
4910d4
+
4910d4
+Specifying @code{.arch} clears any previously selected architecture
4910d4
+extensions.
4910d4
+
4910d4
+@cindex @code{.arch_extension} directive, AArch64
4910d4
+@item .arch_extension @var{name}
4910d4
+Add or remove an architecture extension to the target architecture.  Valid
4910d4
+values for @var{name} are the same as those accepted as architectural
4910d4
+extensions by the @option{-mcpu} commandline option.
4910d4
+
4910d4
+@code{.arch_extension} may be used multiple times to add or remove extensions
4910d4
+incrementally to the architecture being compiled for.
4910d4
+
4910d4
 @c BBBBBBBBBBBBBBBBBBBBBBBBBB
4910d4
 
4910d4
 @cindex @code{.bss} directive, AArch64
4910d4
@@ -240,12 +260,35 @@ The AArch64 architecture uses @sc{ieee}
4910d4
 This directive switches to the @code{.bss} section.
4910d4
 
4910d4
 @c CCCCCCCCCCCCCCCCCCCCCCCCCC
4910d4
+
4910d4
+@cindex @code{.cpu} directive, AArch64
4910d4
+@item .cpu @var{name}
4910d4
+Set the target processor.  Valid values for @var{name} are the same as
4910d4
+those accepted by the @option{-mcpu=} command line option.
4910d4
+
4910d4
 @c DDDDDDDDDDDDDDDDDDDDDDDDDD
4910d4
+
4910d4
+@cindex @code{.dword} directive, AArch64
4910d4
+@item .dword @var{expressions}
4910d4
+The @code{.dword} directive produces 64 bit values.
4910d4
+
4910d4
 @c EEEEEEEEEEEEEEEEEEEEEEEEEE
4910d4
+
4910d4
+@cindex @code{.even} directive, AArch64
4910d4
+@item .even
4910d4
+The @code{.even} directive aligns the output on the next even byte
4910d4
+boundary.
4910d4
+
4910d4
 @c FFFFFFFFFFFFFFFFFFFFFFFFFF
4910d4
 @c GGGGGGGGGGGGGGGGGGGGGGGGGG
4910d4
 @c HHHHHHHHHHHHHHHHHHHHHHHHHH
4910d4
 @c IIIIIIIIIIIIIIIIIIIIIIIIII
4910d4
+
4910d4
+@cindex @code{.inst} directive, AArch64
4910d4
+@item .inst @var{expressions}
4910d4
+Inserts the expressions into the output as if they were instructions,
4910d4
+rather than data.
4910d4
+
4910d4
 @c JJJJJJJJJJJJJJJJJJJJJJJJJJ
4910d4
 @c KKKKKKKKKKKKKKKKKKKKKKKKKK
4910d4
 @c LLLLLLLLLLLLLLLLLLLLLLLLLL
4910d4
@@ -311,6 +354,12 @@ should only be done if it is really nece
4910d4
 
4910d4
 @c WWWWWWWWWWWWWWWWWWWWWWWWWW
4910d4
 @c XXXXXXXXXXXXXXXXXXXXXXXXXX
4910d4
+
4910d4
+@cindex @code{.xword} directive, AArch64
4910d4
+@item .xword @var{expressions}
4910d4
+The @code{.xword} directive produces 64 bit values.  This is the same
4910d4
+as the @code{.dword} directive.
4910d4
+
4910d4
 @c YYYYYYYYYYYYYYYYYYYYYYYYYY
4910d4
 @c ZZZZZZZZZZZZZZZZZZZZZZZZZZ
4910d4
 
4910d4
--- binutils-2.25.1.orig/gas/config/tc-aarch64.c	2016-06-15 16:35:49.779887881 +0100
4910d4
+++ binutils-2.25.1/gas/config/tc-aarch64.c	2016-06-15 17:09:40.077963780 +0100
4910d4
@@ -1930,6 +1930,7 @@ s_tlsdesccall (int ignored ATTRIBUTE_UNU
4910d4
 
4910d4
 static void s_aarch64_arch (int);
4910d4
 static void s_aarch64_cpu (int);
4910d4
+static void s_aarch64_arch_extension (int);
4910d4
 
4910d4
 /* This table describes all the machine specific pseudo-ops the assembler
4910d4
    has to support.  The fields are:
4910d4
@@ -1947,6 +1948,7 @@ const pseudo_typeS md_pseudo_table[] = {
4910d4
   {"pool", s_ltorg, 0},
4910d4
   {"cpu", s_aarch64_cpu, 0},
4910d4
   {"arch", s_aarch64_arch, 0},
4910d4
+  {"arch_extension", s_aarch64_arch_extension, 0},
4910d4
   {"inst", s_aarch64_inst, 0},
4910d4
 #ifdef OBJ_ELF
4910d4
   {"tlsdesccall", s_tlsdesccall, 0},
4910d4
@@ -7200,12 +7202,16 @@ struct aarch64_cpu_option_table
4910d4
    recognized by GCC.  */
4910d4
 static const struct aarch64_cpu_option_table aarch64_cpus[] = {
4910d4
   {"all", AARCH64_ANY, NULL},
4910d4
+  {"cortex-a35", AARCH64_FEATURE (AARCH64_ARCH_V8,
4910d4
+				  AARCH64_FEATURE_CRC), "Cortex-A35"},
4910d4
   {"cortex-a53", AARCH64_FEATURE(AARCH64_ARCH_V8,
4910d4
 				 AARCH64_FEATURE_CRC), "Cortex-A53"},
4910d4
   {"cortex-a57", AARCH64_FEATURE(AARCH64_ARCH_V8,
4910d4
 				 AARCH64_FEATURE_CRC), "Cortex-A57"},
4910d4
   {"cortex-a72", AARCH64_FEATURE (AARCH64_ARCH_V8,
4910d4
 				  AARCH64_FEATURE_CRC), "Cortex-A72"},
4910d4
+  {"cortex-a73", AARCH64_FEATURE (AARCH64_ARCH_V8,
4910d4
+				  AARCH64_FEATURE_CRC), "Cortex-A73"},
4910d4
   {"exynos-m1", AARCH64_FEATURE (AARCH64_ARCH_V8,
4910d4
 				 AARCH64_FEATURE_CRC | AARCH64_FEATURE_CRYPTO),
4910d4
 				 "Samsung Exynos M1"},
4910d4
@@ -7265,7 +7271,8 @@ struct aarch64_long_option_table
4910d4
 };
4910d4
 
4910d4
 static int
4910d4
-aarch64_parse_features (char *str, const aarch64_feature_set **opt_p)
4910d4
+aarch64_parse_features (char *str, const aarch64_feature_set **opt_p,
4910d4
+			bfd_boolean ext_only)
4910d4
 {
4910d4
   /* We insist on extensions being added before being removed.  We achieve
4910d4
      this by using the ADDING_VALUE variable to indicate whether we are
4910d4
@@ -7281,17 +7288,19 @@ aarch64_parse_features (char *str, const
4910d4
   while (str != NULL && *str != 0)
4910d4
     {
4910d4
       const struct aarch64_option_cpu_value_table *opt;
4910d4
-      char *ext;
4910d4
+      char *ext = NULL;
4910d4
       int optlen;
4910d4
 
4910d4
-      if (*str != '+')
4910d4
+      if (!ext_only)
4910d4
 	{
4910d4
-	  as_bad (_("invalid architectural extension"));
4910d4
-	  return 0;
4910d4
-	}
4910d4
+	  if (*str != '+')
4910d4
+	    {
4910d4
+	      as_bad (_("invalid architectural extension"));
4910d4
+	      return 0;
4910d4
+	    }
4910d4
 
4910d4
-      str++;
4910d4
-      ext = strchr (str, '+');
4910d4
+	  ext = strchr (++str, '+');
4910d4
+	}
4910d4
 
4910d4
       if (ext != NULL)
4910d4
 	optlen = ext - str;
4910d4
@@ -7371,7 +7380,7 @@ aarch64_parse_cpu (char *str)
4910d4
       {
4910d4
 	mcpu_cpu_opt = &opt->value;
4910d4
 	if (ext != NULL)
4910d4
-	  return aarch64_parse_features (ext, &mcpu_cpu_opt);
4910d4
+	  return aarch64_parse_features (ext, &mcpu_cpu_opt, FALSE);
4910d4
 
4910d4
 	return 1;
4910d4
       }
4910d4
@@ -7403,7 +7412,7 @@ aarch64_parse_arch (char *str)
4910d4
       {
4910d4
 	march_cpu_opt = &opt->value;
4910d4
 	if (ext != NULL)
4910d4
-	  return aarch64_parse_features (ext, &march_cpu_opt);
4910d4
+	  return aarch64_parse_features (ext, &march_cpu_opt, FALSE);
4910d4
 
4910d4
 	return 1;
4910d4
       }
4910d4
@@ -7586,7 +7595,7 @@ s_aarch64_cpu (int ignored ATTRIBUTE_UNU
4910d4
       {
4910d4
 	mcpu_cpu_opt = &opt->value;
4910d4
 	if (ext != NULL)
4910d4
-	  if (!aarch64_parse_features (ext, &mcpu_cpu_opt))
4910d4
+	  if (!aarch64_parse_features (ext, &mcpu_cpu_opt, FALSE))
4910d4
 	    return;
4910d4
 
4910d4
 	cpu_variant = *mcpu_cpu_opt;
4910d4
@@ -7632,7 +7641,7 @@ s_aarch64_arch (int ignored ATTRIBUTE_UN
4910d4
       {
4910d4
 	mcpu_cpu_opt = &opt->value;
4910d4
 	if (ext != NULL)
4910d4
-	  if (!aarch64_parse_features (ext, &mcpu_cpu_opt))
4910d4
+	  if (!aarch64_parse_features (ext, &mcpu_cpu_opt, FALSE))
4910d4
 	    return;
4910d4
 
4910d4
 	cpu_variant = *mcpu_cpu_opt;
4910d4
@@ -7647,6 +7656,28 @@ s_aarch64_arch (int ignored ATTRIBUTE_UN
4910d4
   ignore_rest_of_line ();
4910d4
 }
4910d4
 
4910d4
+/* Parse a .arch_extension directive.  */
4910d4
+
4910d4
+static void
4910d4
+s_aarch64_arch_extension (int ignored ATTRIBUTE_UNUSED)
4910d4
+{
4910d4
+  char saved_char;
4910d4
+  char *ext = input_line_pointer;;
4910d4
+
4910d4
+  while (*input_line_pointer && !ISSPACE (*input_line_pointer))
4910d4
+    input_line_pointer++;
4910d4
+  saved_char = *input_line_pointer;
4910d4
+  *input_line_pointer = 0;
4910d4
+
4910d4
+  if (!aarch64_parse_features (ext, &mcpu_cpu_opt, TRUE))
4910d4
+    return;
4910d4
+
4910d4
+  cpu_variant = *mcpu_cpu_opt;
4910d4
+
4910d4
+  *input_line_pointer = saved_char;
4910d4
+  demand_empty_rest_of_line ();
4910d4
+}
4910d4
+
4910d4
 /* Copy symbol information.  */
4910d4
 
4910d4
 void