Allow extension availability to depend on several architecture bits

2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>

gas/
	* config/tc-arm.c (struct arm_option_extension_value_table): Make
	allowed_archs an array with 2 entries.
	(ARM_EXT_OPT): Adapt to only fill the first entry of allowed_archs.
	(ARM_EXT_OPT2): New macro filling the two entries of allowed_archs.
	(arm_extensions): Use separate entries in allowed_archs when several
	archs are allowed to use an extension and change ARCH_ANY in
	ARM_ARCH_NONE in allowed_archs.
	(arm_parse_extension): Check that, for each allowed_archs entry, all
	bits are set in the current architecture, ignoring ARM_ANY entries.
	(s_arm_arch_extension): Likewise.

include/
	* arm.h (ARM_FSET_CPU_SUBSET): Define macro.
This commit is contained in:
Thomas Preud'homme
2016-05-10 15:06:41 +01:00
parent 16a1fa25be
commit d942732e82
4 changed files with 68 additions and 15 deletions

View File

@@ -330,6 +330,12 @@ typedef struct
|| ((CPU).core[1] & (FEAT).core[1]) != 0 \
|| ((CPU).coproc & (FEAT).coproc) != 0)
/* Tests whether the features of A are a subset of B. */
#define ARM_FSET_CPU_SUBSET(A,B) \
(((A).core[0] & (B).core[0]) == (A).core[0] \
&& ((A).core[1] & (B).core[1]) == (A).core[1] \
&& ((A).coproc & (B).coproc) == (A).coproc)
#define ARM_CPU_IS_ANY(CPU) \
((CPU).core[0] == ((arm_feature_set)ARM_ANY).core[0] \
&& (CPU).core[1] == ((arm_feature_set)ARM_ANY).core[1])