From: Tamar Christina Date: Wed, 15 Nov 2017 15:56:23 +0000 (+0000) Subject: Separate the new FP16 instructions backported from Armv8.4-a to Armv8.2-a into a... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01f48020363f1ca9b31df2ee0b2afedc38db1259;p=binutils-gdb.git Separate the new FP16 instructions backported from Armv8.4-a to Armv8.2-a into a new flag order to distinguish them from the rest of the already existing optional FP16 instructions in Armv8.2-a. The new flag "+fp16fml" is available from Armv8.2-a and implies +fp16 and is mandatory from Armv8.4-a. gas/ * config/tc-arm.c (arm_ext_fp16_fml, fp16fml): New. (do_neon_fmac_maybe_scalar_long): Use arm_ext_fp16_fml. * doc/c-arm.texi (fp16, fp16fml): New. * testsuite/gas/arm/armv8_2-a-fp16.d (fp16): Make fp16fml. * testsuite/gas/arm/armv8_3-a-fp16.d (fp16): Make fp16fml. * testsuite/gas/arm/armv8_2-a-fp16-illegal.d (fp16): Make fp16fml. * testsuite/gas/arm/armv8_2-a-fp16-thumb2.d (fp16): Make fp16fml. include/ * opcode/arm.h: (ARM_EXT2_FP16_FML): New. (ARM_AEXT2_V8_4A): Add ARM_EXT2_FP16_FML. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 8ebdb8b470d..307fb00f292 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2017-11-15 Tamar Christina + + * config/tc-arm.c (arm_ext_fp16_fml, fp16fml): New. + (do_neon_fmac_maybe_scalar_long): Use arm_ext_fp16_fml. + * doc/c-arm.texi (fp16, fp16fml): New. + * testsuite/gas/arm/armv8_2-a-fp16.d (fp16): Make fp16fml. + * testsuite/gas/arm/armv8_3-a-fp16.d (fp16): Make fp16fml. + * testsuite/gas/arm/armv8_2-a-fp16-illegal.d (fp16): Make fp16fml. + * testsuite/gas/arm/armv8_2-a-fp16-thumb2.d (fp16): Make fp16fml. + 2017-11-15 Nick Clifton PR 15152 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 128ab38db69..e920637c809 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -235,6 +235,8 @@ static const arm_feature_set arm_ext_ras = /* FP16 instructions. */ static const arm_feature_set arm_ext_fp16 = ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST); +static const arm_feature_set arm_ext_fp16_fml = + ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_FML); static const arm_feature_set arm_ext_v8_2 = ARM_FEATURE_CORE_HIGH (ARM_EXT2_V8_2A); static const arm_feature_set arm_ext_v8_3 = @@ -16210,7 +16212,7 @@ do_neon_fmac_maybe_scalar_long (int subtype) as_warn (_("vfmal/vfmsl with FP16 type cannot be conditional, the " "behaviour is UNPREDICTABLE")); - constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_fp16), + constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_fp16_fml), _(BAD_FP16)); constraint (!ARM_CPU_HAS_FEATURE (cpu_variant, fpu_neon_ext_armv8), @@ -26243,6 +26245,11 @@ static const struct arm_option_extension_value_table arm_extensions[] = ARM_EXT_OPT ("fp16", ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST), ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST), ARM_ARCH_V8_2A), + ARM_EXT_OPT ("fp16fml", ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST + | ARM_EXT2_FP16_FML), + ARM_FEATURE_CORE_HIGH (ARM_EXT2_FP16_INST + | ARM_EXT2_FP16_FML), + ARM_ARCH_V8_2A), ARM_EXT_OPT2 ("idiv", ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV | ARM_EXT_DIV), ARM_FEATURE_CORE_LOW (ARM_EXT_ADIV | ARM_EXT_DIV), ARM_FEATURE_CORE_LOW (ARM_EXT_V7A), diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 5e518c69fed..075716f1f23 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -178,6 +178,8 @@ The following extensions are currently supported: @code{crypto} (Cryptography Extensions for v8-A architecture, implies @code{fp+simd}), @code{dotprod} (Dot Product Extensions for v8.2-A architecture, implies @code{fp+simd}), @code{fp} (Floating Point Extensions for v8-A architecture), +@code{fp16} (FP16 Extensions for v8.2-A architecture, implies @code{fp}), +@code{fp16fml} (FP16 Floating Point Multiplication Variant Extensions for v8.2-A architecture, implies @code{fp16}), @code{idiv} (Integer Divide Extensions for v7-A and v7-R architectures), @code{iwmmxt}, @code{iwmmxt2}, diff --git a/gas/testsuite/gas/arm/armv8_2-a-fp16-illegal.d b/gas/testsuite/gas/arm/armv8_2-a-fp16-illegal.d index 745ae052bca..b5680874a4b 100644 --- a/gas/testsuite/gas/arm/armv8_2-a-fp16-illegal.d +++ b/gas/testsuite/gas/arm/armv8_2-a-fp16-illegal.d @@ -1,2 +1,2 @@ -#as: -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8 +#as: -march=armv8.2-a+fp16fml -mfpu=neon-fp-armv8 #error-output: armv8_2-a-fp16-illegal.l diff --git a/gas/testsuite/gas/arm/armv8_2-a-fp16-thumb2.d b/gas/testsuite/gas/arm/armv8_2-a-fp16-thumb2.d index b03a8ae0122..010eda7dbb8 100644 --- a/gas/testsuite/gas/arm/armv8_2-a-fp16-thumb2.d +++ b/gas/testsuite/gas/arm/armv8_2-a-fp16-thumb2.d @@ -1,4 +1,4 @@ -#as: -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8 -mthumb +#as: -march=armv8.2-a+fp16fml -mfpu=neon-fp-armv8 -mthumb #source: armv8_2-a-fp16.s #objdump: -d diff --git a/gas/testsuite/gas/arm/armv8_2-a-fp16.d b/gas/testsuite/gas/arm/armv8_2-a-fp16.d index 9f99828d02e..e6392537d4c 100644 --- a/gas/testsuite/gas/arm/armv8_2-a-fp16.d +++ b/gas/testsuite/gas/arm/armv8_2-a-fp16.d @@ -1,4 +1,4 @@ -#as: -march=armv8.2-a+fp16 -mfpu=neon-fp-armv8 +#as: -march=armv8.2-a+fp16fml -mfpu=neon-fp-armv8 #source: armv8_2-a-fp16.s #objdump: -d diff --git a/gas/testsuite/gas/arm/armv8_3-a-fp16.d b/gas/testsuite/gas/arm/armv8_3-a-fp16.d index 545275a82ad..70d693084c1 100644 --- a/gas/testsuite/gas/arm/armv8_3-a-fp16.d +++ b/gas/testsuite/gas/arm/armv8_3-a-fp16.d @@ -1,4 +1,4 @@ -#as: -march=armv8.3-a+fp16 -mfpu=neon-fp-armv8 +#as: -march=armv8.3-a+fp16fml -mfpu=neon-fp-armv8 #source: armv8_2-a-fp16.s #objdump: -d diff --git a/include/ChangeLog b/include/ChangeLog index a6e3ebcb973..79b6eeb7738 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2017-11-15 Tamar Christina + + * opcode/arm.h: (ARM_EXT2_FP16_FML): New. + (ARM_AEXT2_V8_4A): Add ARM_EXT2_FP16_FML. + 2017-11-13 Jan Beulich * coff/pe.h (COFF_ENCODE_ALIGNMENT): Cap value to maximum one diff --git a/include/opcode/arm.h b/include/opcode/arm.h index 932bf630f07..a15e5d613e3 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -67,6 +67,7 @@ #define ARM_EXT2_V8_3A 0x00000100 /* ARM V8.3A. */ #define ARM_EXT2_V8A 0x00000200 /* ARMv8-A. */ #define ARM_EXT2_V8_4A 0x00000400 /* ARM V8.4A. */ +#define ARM_EXT2_FP16_FML 0x00000800 /* ARM V8.2A FP16-FML instructions. */ /* Co-processor space extensions. */ #define ARM_CEXT_XSCALE 0x00000001 /* Allow MIA etc. */ @@ -157,7 +158,7 @@ #define ARM_AEXT2_V8_1A (ARM_AEXT2_V8A | ARM_EXT2_PAN) #define ARM_AEXT2_V8_2A (ARM_AEXT2_V8_1A | ARM_EXT2_V8_2A | ARM_EXT2_RAS) #define ARM_AEXT2_V8_3A (ARM_AEXT2_V8_2A | ARM_EXT2_V8_3A) -#define ARM_AEXT2_V8_4A (ARM_AEXT2_V8_3A | ARM_EXT2_V8_4A) +#define ARM_AEXT2_V8_4A (ARM_AEXT2_V8_3A | ARM_EXT2_FP16_FML | ARM_EXT2_V8_4A) #define ARM_AEXT_V8M_BASE (ARM_AEXT_V6SM | ARM_EXT_DIV) #define ARM_AEXT_V8M_MAIN ARM_AEXT_V7M #define ARM_AEXT_V8M_MAIN_DSP ARM_AEXT_V7EM