aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2022-05-18 16:02:12 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2022-05-20 15:10:37 +0100
commit1be715f31605976d8e4336973d3b81c5b7cea79f (patch)
tree0adb70628d3362e551d54c5edb49a5f3b08116e7 /gcc/config.gcc
parentff171cb13df671a2a0647a68da0fdc1f9a78b8c9 (diff)
downloadgcc-1be715f31605976d8e4336973d3b81c5b7cea79f.zip
gcc-1be715f31605976d8e4336973d3b81c5b7cea79f.tar.gz
gcc-1be715f31605976d8e4336973d3b81c5b7cea79f.tar.bz2
AArch64: Cleanup CPU option processing code
The --with-cpu/--with-arch configure option processing not only checks valid arguments but also sets TARGET_CPU_DEFAULT with a CPU and extension bitmask. This isn't used however since a --with-cpu is translated into a -mcpu option which is processed as if written on the command-line (so TARGET_CPU_DEFAULT is never accessed). So remove all the complex processing and bitmask, and just validate the option. Fix a bug that always reports valid architecture extensions as invalid. As a result the CPU processing in aarch64.c can be simplified. gcc/ * config.gcc (aarch64*-*-*): Simplify --with-cpu and --with-arch processing. Add support for architectural extensions. * config/aarch64/aarch64.h (TARGET_CPU_DEFAULT): Remove AARCH64_CPU_DEFAULT_FLAGS. (TARGET_CPU_NBITS): Remove. (TARGET_CPU_MASK): Remove. * config/aarch64/aarch64.cc (AARCH64_CPU_DEFAULT_FLAGS): Remove define. (get_tune_cpu): Assert CPU is always valid. (get_arch): Assert architecture is always valid. (aarch64_override_options): Cleanup CPU selection code and simplify logic. (aarch64_option_restore): Remove unnecessary checks on tune.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc43
1 files changed, 1 insertions, 42 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index c5064dd..b48d545 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4178,8 +4178,6 @@ case "${target}" in
pattern=AARCH64_CORE
fi
- ext_mask=AARCH64_CPU_DEFAULT_FLAGS
-
# Find the base CPU or ARCH id in aarch64-cores.def or
# aarch64-arches.def
if [ x"$base_val" = x ] \
@@ -4187,23 +4185,6 @@ case "${target}" in
${srcdir}/config/aarch64/$def \
> /dev/null; then
- if [ $which = arch ]; then
- base_id=`grep "^$pattern(\"$base_val\"," \
- ${srcdir}/config/aarch64/$def | \
- sed -e 's/^[^,]*,[ ]*//' | \
- sed -e 's/,.*$//'`
- # Extract the architecture flags from aarch64-arches.def
- ext_mask=`grep "^$pattern(\"$base_val\"," \
- ${srcdir}/config/aarch64/$def | \
- sed -e 's/)$//' | \
- sed -e 's/^.*,//'`
- else
- base_id=`grep "^$pattern(\"$base_val\"," \
- ${srcdir}/config/aarch64/$def | \
- sed -e 's/^[^,]*,[ ]*//' | \
- sed -e 's/,.*$//'`
- fi
-
# Disallow extensions in --with-tune=cortex-a53+crc.
if [ $which = tune ] && [ x"$ext_val" != x ]; then
echo "Architecture extensions not supported in --with-$which=$val" 1>&2
@@ -4234,25 +4215,7 @@ case "${target}" in
grep "^\"$base_ext\""`
if [ x"$base_ext" = x ] \
- || [[ -n $opt_line ]]; then
-
- # These regexp extract the elements based on
- # their group match index in the regexp.
- ext_canon=`echo -e "$opt_line" | \
- sed -e "s/$sed_patt/\2/"`
- ext_on=`echo -e "$opt_line" | \
- sed -e "s/$sed_patt/\3/"`
- ext_off=`echo -e "$opt_line" | \
- sed -e "s/$sed_patt/\4/"`
-
- if [ $ext = $base_ext ]; then
- # Adding extension
- ext_mask="("$ext_mask") | ("$ext_on" | "$ext_canon")"
- else
- # Removing extension
- ext_mask="("$ext_mask") & ~("$ext_off" | "$ext_canon")"
- fi
-
+ || [ x"$opt_line" != x ]; then
true
else
echo "Unknown extension used in --with-$which=$val" 1>&2
@@ -4261,10 +4224,6 @@ case "${target}" in
ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
done
- ext_mask="(("$ext_mask") << TARGET_CPU_NBITS)"
- if [ x"$base_id" != x ]; then
- target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
- fi
true
else
# Allow --with-$which=native.