Commit 93aa40fe by Richard Earnshaw Committed by Richard Earnshaw

[arm] Rewrite t-aprofile using new selector methodology


Now that the default FPU is 'auto' we can finally rewrite (and
simplify) the rules for mapping compiler options to multilibs.  We
no-longer need to know the specific CPU, since the driver will
construct a suitable -march flag for us; this greatly simplifies the
overall logic.  This patch rewrites the library list for A-profile
cores.  We use various Make extention rules to simplify the logic even
further.

A couple of minor tweaks to the configure script and to the main
driver ensures that we always know the setting of -mfloat-abi and
-marm/-mthumb.  Again, this helps simplify the logic further.  The
change to arm_target_thumb_only relies on the fact that this routine
is only called if neither -marm nor -mthumb has been previously
selected or specified by the user.

A new testsuite module is added to check the libraries generated.  The
new tests are only run if the compiler is configured with the relevant
multilibs enabled.

gcc:
	* config.gcc: (arm*-*-*): When building a-profile libraries, force
	the driver to pass through the default setting of -mfloat-abi.
	* common/config/arm/arm-common.c (arm_target_thumb_only): Return -marm
	rather than NULL.
	* config/arm/t-multilib (MULTILIB_REUSE): Initialize to empty.
	(all_feat_combs): New rule.
	(MULTILIB_OPTIONS): Use explicit ARM and Thumb directories.  Rework
	default libraries.
	* config/arm/t-aprofile: Rewrite.

gcc/testsuite:
	* gcc.target/arm/multilibs.exp: New file.

From-SVN: r249296
parent 11389610
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
* config.gcc: (arm*-*-*): When building a-profile libraries, force
the driver to pass through the default setting of -mfloat-abi.
* common/config/arm/arm-common.c (arm_target_thumb_only): Return -marm
rather than NULL.
* config/arm/t-multilib (MULTILIB_REUSE): Initialize to empty.
(all_feat_combs): New rule.
(MULTILIB_OPTIONS): Use explicit ARM and Thumb directories. Rework
default libraries.
* config/arm/t-aprofile: Rewrite.
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
* config/arm/arm.h (FPUTYPE_AUTO): Define.
* config/arm/arm.c (arm_option_override): Use FPUTYPE_AUTO if the
fpu is not specified by the user/command-line.
......
......@@ -215,7 +215,9 @@ arm_target_thumb_only (int argc, const char **argv)
return "-mthumb";
}
return NULL;
/* Compiler hasn't been configured with a default, and the CPU
doesn't require Thumb, so default to ARM. */
return "-marm";
}
/* List the permitted CPU option names. If TARGET is a near miss for an
......
......@@ -3856,7 +3856,9 @@ case "${target}" in
echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
exit 1
fi
# But pass the default value for float-abi
# through to the multilib selector
with_float="soft"
tmake_file="${tmake_file} ${tmake_profile_file}"
TM_MULTILIB_CONFIG="$with_multilib_list"
fi
......
......@@ -29,6 +29,7 @@ MULTILIB_DIRNAMES =
MULTILIB_EXCEPTIONS =
MULTILIB_MATCHES =
MULTILIB_REUSE =
MULTILIB_REQUIRED =
comma := ,
tm_multilib_list := $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
......@@ -36,6 +37,26 @@ tm_multilib_list := $(subst $(comma), ,$(TM_MULTILIB_CONFIG))
HAS_APROFILE := $(filter aprofile,$(tm_multilib_list))
HAS_RMPROFILE := $(filter rmprofile,$(tm_multilib_list))
# Produce the combinatorial list of extensions. Where there are
# multiple permutations for a combination, the ordering is the
# selected by the forward ordering of the original list. This matches
# the canonical ordering generated by the canonicalizer in the driver.
#
# For example,
# $(call all_feat_combs, a b)
# will produce
# +a +a+b +b
# but will not include
# +b+a
# The rule is recursive and can be called with any (reasonable) list of
# extensions.
all_feat_combs = +$(firstword $(1)) \
$(if $(wordlist 2, $(words $(1)), $(1)), \
$(foreach OPT, \
$(call all_feat_combs, \
$(wordlist 2, $(words $(1)), $(1))), \
+$(firstword $(1))$(OPT) $(OPT)),)
ifneq (,$(HAS_APROFILE))
include $(srcdir)/config/arm/t-aprofile
endif
......@@ -45,25 +66,14 @@ endif
SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
# We have the following hierachy:
# ISA: A32 (.) or T16/T32 (thumb)
# Architecture: ARMv6-M (v6-m), ARMv7-M (v7-m), ARMv7E-M (v7e-m),
# ARMv7 (v7-ar), ARMv7-A (v7-a), ARMv7VE (v7ve),
# ARMv8-M Baseline (v8-m.base), ARMv8-M Mainline (v8-m.main)
# or ARMv8-A (v8-a).
# FPU: VFPv3-D16 (fpv3), NEONv1 (simdv1), FPV4-SP-D16 (fpv4-sp),
# VFPv4-D16 (fpv4), NEON-VFPV4 (simdvfpv4), FPV5-SP-D16 (fpv5-sp),
# VFPv5-D16 (fpv5), NEON for ARMv8 (simdv8), or None (.).
# Float-abi: Soft (.), softfp (softfp), or hard (hard).
MULTILIB_OPTIONS += mthumb
MULTILIB_DIRNAMES += thumb
MULTILIB_OPTIONS += marm/mthumb
MULTILIB_DIRNAMES += arm thumb
MULTILIB_OPTIONS += $(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
MULTILIB_DIRNAMES += $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
MULTILIB_OPTIONS += march=armv5te+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
MULTILIB_DIRNAMES += v5te $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
MULTILIB_OPTIONS += $(MULTI_FPU_OPTS_A)$(SEP)$(MULTI_FPU_OPTS_RM)
MULTILIB_DIRNAMES += $(MULTI_FPU_DIRS_A) $(MULTI_FPU_DIRS_RM)
MULTILIB_OPTIONS += mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
MULTILIB_DIRNAMES += nofp softfp hard
MULTILIB_OPTIONS += mfloat-abi=softfp/mfloat-abi=hard
MULTILIB_DIRNAMES += softfp hard
MULTILIB_REQUIRED += mthumb/mfloat-abi=soft
MULTILIB_REQUIRED += marm/march=armv5te+fp/mfloat-abi=hard
2017-06-16 Richard Earnshaw <rearnsha@arm.com>
* gcc.target/arm/multilibs.exp: New file.
2017-06-16 Martin Sebor <msebor@redhat.com>
PR tree-optimization/80933
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment