[arm] Allow new extended syntax CPU and architecture
This patch extends support for the new extended-style architecture strings to configure and the target default options. We validate any options passed by the user to configure against the permitted extensions for that CPU or architecture. * config.gcc (arm*-*-fucshia*): Set target_cpu_cname to the real cpu name. (arm*-*-*): Set target_cpu_default2 to a quoted string. * config/arm/parsecpu.awk (check_cpu): Validate any extension options. (check_arch): Likewise. * config/arm/arm.c (arm_configure_build_target): Handle TARGET_CPU_DEFAULT being a string constant. Scan any feature options in the default. From-SVN: r249290
This commit is contained in:
parent
357e1023c9
commit
bf35d17a30
@ -1,3 +1,15 @@
|
|||||||
|
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
|
* config.gcc (arm*-*-fucshia*): Set target_cpu_cname to the real
|
||||||
|
cpu name.
|
||||||
|
(arm*-*-*): Set target_cpu_default2 to a quoted string.
|
||||||
|
* config/arm/parsecpu.awk (check_cpu): Validate any extension
|
||||||
|
options.
|
||||||
|
(check_arch): Likewise.
|
||||||
|
* config/arm/arm.c (arm_configure_build_target): Handle
|
||||||
|
TARGET_CPU_DEFAULT being a string constant. Scan any feature
|
||||||
|
options in the default.
|
||||||
|
|
||||||
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
|
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
* config/arm/arm-protos.h (cpu_arch_extension): Add field to record
|
* config/arm/arm-protos.h (cpu_arch_extension): Add field to record
|
||||||
|
@ -1161,7 +1161,7 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
|
|||||||
arm*-*-fuchsia*)
|
arm*-*-fuchsia*)
|
||||||
tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
|
tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
|
||||||
tmake_file="${tmake_file} arm/t-bpabi"
|
tmake_file="${tmake_file} arm/t-bpabi"
|
||||||
target_cpu_cname="genericv7a"
|
target_cpu_cname="generic-armv7-a"
|
||||||
;;
|
;;
|
||||||
arm*-*-rtems*)
|
arm*-*-rtems*)
|
||||||
tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
|
tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
|
||||||
@ -4496,9 +4496,9 @@ case ${target} in
|
|||||||
arm*-*-*)
|
arm*-*-*)
|
||||||
if test x$target_cpu_cname = x
|
if test x$target_cpu_cname = x
|
||||||
then
|
then
|
||||||
target_cpu_default2=TARGET_CPU_arm6
|
target_cpu_default2="\\\"arm6\\\""
|
||||||
else
|
else
|
||||||
target_cpu_default2=TARGET_CPU_$target_cpu_cname
|
target_cpu_default2="\\\"$target_cpu_cname\\\""
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -3143,7 +3143,9 @@ arm_configure_build_target (struct arm_build_target *target,
|
|||||||
bitmap_clear (sought_isa);
|
bitmap_clear (sought_isa);
|
||||||
auto_sbitmap default_isa (isa_num_bits);
|
auto_sbitmap default_isa (isa_num_bits);
|
||||||
|
|
||||||
arm_selected_cpu = &all_cores[TARGET_CPU_DEFAULT];
|
arm_selected_cpu = arm_parse_cpu_option_name (all_cores, "default CPU",
|
||||||
|
TARGET_CPU_DEFAULT);
|
||||||
|
cpu_opts = strchr (TARGET_CPU_DEFAULT, '+');
|
||||||
gcc_assert (arm_selected_cpu->common.name);
|
gcc_assert (arm_selected_cpu->common.name);
|
||||||
|
|
||||||
/* RWE: All of the selection logic below (to the end of this
|
/* RWE: All of the selection logic below (to the end of this
|
||||||
@ -3154,6 +3156,8 @@ arm_configure_build_target (struct arm_build_target *target,
|
|||||||
support for the pre-thumb era cores is removed. */
|
support for the pre-thumb era cores is removed. */
|
||||||
sel = arm_selected_cpu;
|
sel = arm_selected_cpu;
|
||||||
arm_initialize_isa (default_isa, sel->common.isa_bits);
|
arm_initialize_isa (default_isa, sel->common.isa_bits);
|
||||||
|
arm_parse_option_features (default_isa, &arm_selected_cpu->common,
|
||||||
|
cpu_opts);
|
||||||
|
|
||||||
/* Now check to see if the user has specified any command line
|
/* Now check to see if the user has specified any command line
|
||||||
switches that require certain abilities from the cpu. */
|
switches that require certain abilities from the cpu. */
|
||||||
@ -3241,6 +3245,8 @@ arm_configure_build_target (struct arm_build_target *target,
|
|||||||
structure. */
|
structure. */
|
||||||
target->core_name = arm_selected_cpu->common.name;
|
target->core_name = arm_selected_cpu->common.name;
|
||||||
arm_initialize_isa (target->isa, arm_selected_cpu->common.isa_bits);
|
arm_initialize_isa (target->isa, arm_selected_cpu->common.isa_bits);
|
||||||
|
arm_parse_option_features (target->isa, &arm_selected_cpu->common,
|
||||||
|
cpu_opts);
|
||||||
arm_selected_arch = all_architectures + arm_selected_cpu->arch;
|
arm_selected_arch = all_architectures + arm_selected_cpu->arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,9 +393,19 @@ function gen_opt () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_cpu (name) {
|
function check_cpu (name) {
|
||||||
if (name in cpu_cnames) {
|
exts = split (name, extensions, "+")
|
||||||
print cpu_cnames[name]
|
|
||||||
} else print "error"
|
if (! extensions[1] in cpu_cnames) {
|
||||||
|
return "error"
|
||||||
|
}
|
||||||
|
|
||||||
|
for (n = 2; n <= exts; n++) {
|
||||||
|
if (!((extensions[1], extensions[n]) in cpu_opt_remove) \
|
||||||
|
&& !((extensions[1], extensions[n]) in cpu_optaliases)) {
|
||||||
|
return "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_fpu (name) {
|
function check_fpu (name) {
|
||||||
@ -405,9 +415,19 @@ function check_fpu (name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_arch (name) {
|
function check_arch (name) {
|
||||||
if (name in arch_isa) {
|
exts = split (name, extensions, "+")
|
||||||
print name
|
|
||||||
} else print "error"
|
if (! extensions[1] in arch_isa) {
|
||||||
|
return "error"
|
||||||
|
}
|
||||||
|
|
||||||
|
for (n = 2; n <= exts; n++) {
|
||||||
|
if (!((extensions[1], extensions[n]) in arch_opt_remove) \
|
||||||
|
&& !((extensions[1], extensions[n]) in arch_optaliases)) {
|
||||||
|
return "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
@ -614,10 +634,10 @@ END {
|
|||||||
gen_opt()
|
gen_opt()
|
||||||
} else if (cmd ~ /^chk(cpu|tune) /) {
|
} else if (cmd ~ /^chk(cpu|tune) /) {
|
||||||
split (cmd, target)
|
split (cmd, target)
|
||||||
check_cpu(target[2])
|
print check_cpu(target[2])
|
||||||
} else if (cmd ~ /^chkarch /) {
|
} else if (cmd ~ /^chkarch /) {
|
||||||
split (cmd, target)
|
split (cmd, target)
|
||||||
check_arch(target[2])
|
print check_arch(target[2])
|
||||||
} else if (cmd ~ /^chkfpu /) {
|
} else if (cmd ~ /^chkfpu /) {
|
||||||
split (cmd, target)
|
split (cmd, target)
|
||||||
check_fpu(target[2])
|
check_fpu(target[2])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user