From 34ef62f46541d423b991850b2b7ba34d8749a6ba Mon Sep 17 00:00:00 2001 From: Andre Vieira Date: Mon, 1 Apr 2019 10:43:32 +0100 Subject: [GAS, Arm] CLI with architecture sensitive extensions This patch adds a new framework to add architecture sensitive extensions, like GCC does. This patch also implements all architecture extensions currently available in GCC. This framework works as follows. To enable architecture sensitive extensions for a particular architecture, that architecture must contain an ARM_ARCH_OPT2 entry in the 'arm_archs' table. All fields here are the same as previous, with the addition of a new extra field at the end to it's extension table. This , corresponds to a _ext_table of type 'struct arm_ext_table'. This struct can be filled with three types of entries: ARM_ADD (string , arm_feature_set ), which means + will enable ARM_REMOVE (string , arm_feature_set ), which means +no will disable ARM_EXT (string , arm_feature_set , arm_feature_set ), which means + will enable and +no will disable (this is to be used instead of adding an ARM_ADD and ARM_REMOVE for the same ) This patch does not disable the use of the old extensions, even if some of them are duplicated in the new tables. This is a "in-between-step" as we may want to deprecate the old table of extensions in later patches. For now, GAS will first look for the + or +no in the new table and if no entry is found it will continue searching in the old table, following old behaviour. If only an ARM_ADD or an ARM_REMOVE is defined for and +no or + resp. is used then it also continues to search the old table for it. A couple of caveats: - This patch does not enable the use of these architecture extensions with the '.arch_extension' directive. This is future work that I will tend to later. - This patch does not enable the use of these architecture extensions with the -mcpu option. This is future work that I will tend to later. - This patch does not change the current behaviour when combining an architecture extension and using -mfpu on the command-line. The current behaviour of GAS is to stage the union of feature bits enabled by both -march and -mfpu. GCC behaves differently here, so this is something we may want to revisit on a later date. --- include/ChangeLog | 11 +++++++++++ include/opcode/arm.h | 31 ++++++++++++++++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index f6662f7..c1639b8 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,14 @@ +2019-04-01 Andre Vieira + + * opcode/arm.h (FPU_NEON_ARMV8_1): New. + (FPU_ARCH_NEON_VFP_ARMV8_1): Use FPU_NEON_ARMV8_1. + (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1): Likewise. + (FPU_ARCH_DOTPROD_NEON_VFP_ARMV8): Likewise. + (FPU_ARCH_NEON_VFP_ARMV8_2_FP16): New. + (FPU_ARCH_NEON_VFP_ARMV8_2_FP16FML): New. + (FPU_ARCH_NEON_VFP_ARMV8_4_FP16FML): New. + (FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_4): New. + 2019-03-28 Alan Modra PR 24390 diff --git a/include/opcode/arm.h b/include/opcode/arm.h index 5888330..4f5c89f 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -205,6 +205,7 @@ | FPU_VFP_EXT_ARMV8xD) #define FPU_NEON_ARMV8 (FPU_NEON_EXT_V1 | FPU_NEON_EXT_FMA \ | FPU_NEON_EXT_ARMV8) +#define FPU_NEON_ARMV8_1 (FPU_NEON_ARMV8 | FPU_NEON_EXT_RDMA) #define FPU_CRYPTO_ARMV8 (FPU_CRYPTO_EXT_ARMV8) #define FPU_VFP_HARD (FPU_VFP_EXT_V1xD | FPU_VFP_EXT_V1 \ | FPU_VFP_EXT_V2 \ @@ -264,19 +265,35 @@ | FPU_NEON_EXT_DOTPROD) #define ARCH_CRC_ARMV8 ARM_FEATURE_COPROC (CRC_EXT_ARMV8) #define FPU_ARCH_NEON_VFP_ARMV8_1 \ - ARM_FEATURE_COPROC (FPU_NEON_ARMV8 \ - | FPU_VFP_ARMV8 \ - | FPU_NEON_EXT_RDMA) + ARM_FEATURE_COPROC (FPU_NEON_ARMV8_1 \ + | FPU_VFP_ARMV8) #define FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_1 \ ARM_FEATURE_COPROC (FPU_CRYPTO_ARMV8 \ - | FPU_NEON_ARMV8 \ - | FPU_VFP_ARMV8 \ - | FPU_NEON_EXT_RDMA) + | FPU_NEON_ARMV8_1 \ + | FPU_VFP_ARMV8) + #define FPU_ARCH_DOTPROD_NEON_VFP_ARMV8 \ ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD \ - | FPU_NEON_ARMV8 \ + | FPU_NEON_ARMV8_1 \ | FPU_VFP_ARMV8) +#define FPU_ARCH_NEON_VFP_ARMV8_2_FP16 \ + ARM_FEATURE (0, ARM_EXT2_FP16_INST, \ + FPU_NEON_ARMV8_1 | FPU_VFP_ARMV8) + +#define FPU_ARCH_NEON_VFP_ARMV8_2_FP16FML \ + ARM_FEATURE (0, ARM_EXT2_FP16_INST | ARM_EXT2_FP16_FML, \ + FPU_NEON_ARMV8_1 | FPU_VFP_ARMV8) + +#define FPU_ARCH_NEON_VFP_ARMV8_4_FP16FML \ + ARM_FEATURE (0, ARM_EXT2_FP16_INST | ARM_EXT2_FP16_FML, \ + FPU_NEON_ARMV8_1 | FPU_VFP_ARMV8 | FPU_NEON_EXT_DOTPROD) + +#define FPU_ARCH_CRYPTO_NEON_VFP_ARMV8_4 \ + ARM_FEATURE_COPROC (FPU_CRYPTO_ARMV8 \ + | FPU_NEON_ARMV8_1 \ + | FPU_VFP_ARMV8 \ + | FPU_NEON_EXT_DOTPROD) #define FPU_ARCH_ENDIAN_PURE ARM_FEATURE_COPROC (FPU_ENDIAN_PURE) -- cgit v1.1