aboutsummaryrefslogtreecommitdiff
path: root/gcc/common
diff options
context:
space:
mode:
authorJames Greenhalgh <james.greenhalgh@arm.com>2013-12-18 19:21:45 +0000
committerJames Greenhalgh <jgreenhalgh@gcc.gnu.org>2013-12-18 19:21:45 +0000
commit682287fb313413b08b53e35d38d61a3e64e29b45 (patch)
treebf2e9db6c35899121d12968e429df52ba042112e /gcc/common
parenta5dcac11d5cdcc49bae97841462059acbb149f6e (diff)
downloadgcc-682287fb313413b08b53e35d38d61a3e64e29b45.zip
gcc-682287fb313413b08b53e35d38d61a3e64e29b45.tar.gz
gcc-682287fb313413b08b53e35d38d61a3e64e29b45.tar.bz2
[AArch64 1/3 big.LITTLE] Driver rewriting of big.LITTLE names.
gcc/ * common/config/aarch64/aarch64-common.c (aarch64_rewrite_selected_cpu): New. (aarch64_rewrite_mcpu): New. * config/aarch64/aarch64-protos.h (aarch64_rewrite_selected_cpu): New. * config/aarch64/aarch64.h (BIG_LITTLE_SPEC): New. (BIG_LITTLE_SPEC_FUNCTIONS): Likewise. (ASM_CPU_SPEC): Likewise. (EXTRA_SPEC_FUNCTIONS): Likewise. (EXTRA_SPECS): Likewise. (ASM_SPEC): Likewise. * config/aarch64/aarch64.c (aarch64_start_file): Rewrite target CPU name. From-SVN: r206098
Diffstat (limited to 'gcc/common')
-rw-r--r--gcc/common/config/aarch64/aarch64-common.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c
index 9c8e770..19acce1 100644
--- a/gcc/common/config/aarch64/aarch64-common.c
+++ b/gcc/common/config/aarch64/aarch64-common.c
@@ -88,3 +88,38 @@ aarch64_handle_option (struct gcc_options *opts,
}
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
+
+#define AARCH64_CPU_NAME_LENGTH 20
+
+/* Truncate NAME at the first '.' character seen, or return
+ NAME unmodified. */
+
+const char *
+aarch64_rewrite_selected_cpu (const char *name)
+{
+ static char output_buf[AARCH64_CPU_NAME_LENGTH + 1] = {0};
+ char *arg_pos;
+
+ strncpy (output_buf, name, AARCH64_CPU_NAME_LENGTH);
+ arg_pos = strchr (output_buf, '.');
+
+ /* If we found a '.' truncate the entry at that point. */
+ if (arg_pos)
+ *arg_pos = '\0';
+
+ return output_buf;
+}
+
+/* Called by the driver to rewrite a name passed to the -mcpu
+ argument in preparation to be passed to the assembler. The
+ name will be in ARGV[0], ARGC should always be 1. */
+
+const char *
+aarch64_rewrite_mcpu (int argc, const char **argv)
+{
+ gcc_assert (argc == 1);
+ return aarch64_rewrite_selected_cpu (argv[0]);
+}
+
+#undef AARCH64_CPU_NAME_LENGTH
+