Re: [PATCH 1/17][ARM] Add ARMv8.2-A command line option and profile.

2016-09-21 Thread Ramana Radhakrishnan
On Mon, Jul 4, 2016 at 2:46 PM, Matthew Wahab
 wrote:
> On 17/05/16 15:22, Matthew Wahab wrote:
>> This patch adds the command options for the architecture ARMv8.2-A and
>> the half-precision extension. The architecture is selected by
>> -march=armv8.2-a and has all the properties of -march=armv8.1-a.
>>
>> This patch also enables the CRC extension (+crc) which is required
>> for both ARMv8.2-A and ARMv8.1-A architectures but is not currently
>> enabled by default for -march=armv8.1-a.
>>
>> The half-precision extension is selected using the extension +fp16. This
>> enables the VFP FP16 instructions if an ARMv8 VFP unit is also
>> specified, e.g. by -mfpu=fp-armv8. It also enables the FP16 NEON
>> instructions if an ARMv8 NEON unit is specified, e.g. by
>> -mfpu=neon-fp-armv8. Note that if the NEON FP16 instructions are enabled
>> then so are the VFP FP16 instructions.
>
> This a minor respin that moves the setting of arm_fp16_inst in
> arm_option_override to immediately before it is used to set the required
> arm_fp16_format.
>
> Tested the series for arm-none-linux-gnueabihf with native bootstrap and
> make check and for arm-none-eabi and armeb-none-eabi with make check on
> an ARMv8.2-A emulator.


OK.

Thanks,
Ramana
>
> 2016-07-04  Matthew Wahab  
>
>
> * config/arm/arm-arches.def ("armv8.1-a"): Add FL_CRC32.
> ("armv8.2-a"): New.
> ("armv8.2-a+fp16"): New.
> * config/arm/arm-protos.h (FL2_ARCH8_2): New.
> (FL2_FP16INST): New.
> (FL2_FOR_ARCH8_2A): New.
> * config/arm/arm-tables.opt: Regenerate.
> * config/arm/arm.c (arm_arch8_2): New.
> (arm_fp16_inst): New.
> (arm_option_override): Set arm_arch8_2 and arm_fp16_inst.  Check
> for incompatible fp16-format settings.
> * config/arm/arm.h (TARGET_VFP_FP16INST): New.
> (TARGET_NEON_FP16INST): New.
> (arm_arch8_2): Declare.
> (arm_fp16_inst): Declare.
> * config/arm/bpabi.h (BE8_LINK_SPEC): Add entries for
> march=armv8.2-a and march=armv8.2-a+fp16.
> * config/arm/t-aprofile (Arch Matches): Add entries for armv8.2-a
> and armv8.2-a+fp16.
> * doc/invoke.texi (ARM Options): Add "-march=armv8.1-a",
> "-march=armv8.2-a" and "-march=armv8.2-a+fp16".
>


Re: [PATCH 1/17][ARM] Add ARMv8.2-A command line option and profile.

2016-07-04 Thread Matthew Wahab

On 17/05/16 15:22, Matthew Wahab wrote:
> This patch adds the command options for the architecture ARMv8.2-A and
> the half-precision extension. The architecture is selected by
> -march=armv8.2-a and has all the properties of -march=armv8.1-a.
>
> This patch also enables the CRC extension (+crc) which is required
> for both ARMv8.2-A and ARMv8.1-A architectures but is not currently
> enabled by default for -march=armv8.1-a.
>
> The half-precision extension is selected using the extension +fp16. This
> enables the VFP FP16 instructions if an ARMv8 VFP unit is also
> specified, e.g. by -mfpu=fp-armv8. It also enables the FP16 NEON
> instructions if an ARMv8 NEON unit is specified, e.g. by
> -mfpu=neon-fp-armv8. Note that if the NEON FP16 instructions are enabled
> then so are the VFP FP16 instructions.

This a minor respin that moves the setting of arm_fp16_inst in
arm_option_override to immediately before it is used to set the required
arm_fp16_format.

Tested the series for arm-none-linux-gnueabihf with native bootstrap and
make check and for arm-none-eabi and armeb-none-eabi with make check on
an ARMv8.2-A emulator.

2016-07-04  Matthew Wahab  

* config/arm/arm-arches.def ("armv8.1-a"): Add FL_CRC32.
("armv8.2-a"): New.
("armv8.2-a+fp16"): New.
* config/arm/arm-protos.h (FL2_ARCH8_2): New.
(FL2_FP16INST): New.
(FL2_FOR_ARCH8_2A): New.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm.c (arm_arch8_2): New.
(arm_fp16_inst): New.
(arm_option_override): Set arm_arch8_2 and arm_fp16_inst.  Check
for incompatible fp16-format settings.
* config/arm/arm.h (TARGET_VFP_FP16INST): New.
(TARGET_NEON_FP16INST): New.
(arm_arch8_2): Declare.
(arm_fp16_inst): Declare.
* config/arm/bpabi.h (BE8_LINK_SPEC): Add entries for
march=armv8.2-a and march=armv8.2-a+fp16.
* config/arm/t-aprofile (Arch Matches): Add entries for armv8.2-a
and armv8.2-a+fp16.
* doc/invoke.texi (ARM Options): Add "-march=armv8.1-a",
"-march=armv8.2-a" and "-march=armv8.2-a+fp16".

>From e165b4e8bc4338608ff9505a7fd1a26d8a996b0a Mon Sep 17 00:00:00 2001
From: Matthew Wahab 
Date: Thu, 7 Apr 2016 13:31:24 +0100
Subject: [PATCH 01/17] [PATCH 1/17][ARM] Add ARMv8.2-A command line option and
 profile.

2016-07-04  Matthew Wahab  

	* config/arm/arm-arches.def ("armv8.1-a"): Add FL_CRC32.
	("armv8.2-a"): New.
	("armv8.2-a+fp16"): New.
	* config/arm/arm-protos.h (FL2_ARCH8_2): New.
	(FL2_FP16INST): New.
	(FL2_FOR_ARCH8_2A): New.
	* config/arm/arm-tables.opt: Regenerate.
	* config/arm/arm.c (arm_arch8_2): New.
	(arm_fp16_inst): New.
	(arm_option_override): Set arm_arch8_2 and arm_fp16_inst.  Check
	for incompatible fp16-format settings.
	* config/arm/arm.h (TARGET_VFP_FP16INST): New.
	(TARGET_NEON_FP16INST): New.
	(arm_arch8_2): Declare.
	(arm_fp16_inst): Declare.
	* config/arm/bpabi.h (BE8_LINK_SPEC): Add entries for
	march=armv8.2-a and march=armv8.2-a+fp16.
	* config/arm/t-aprofile (Arch Matches): Add entries for armv8.2-a
	and armv8.2-a+fp16.
	* doc/invoke.texi (ARM Options): Add "-march=armv8.1-a",
	"-march=armv8.2-a" and "-march=armv8.2-a+fp16".
---
 gcc/config/arm/arm-arches.def | 10 --
 gcc/config/arm/arm-protos.h   |  4 
 gcc/config/arm/arm-tables.opt | 10 --
 gcc/config/arm/arm.c  | 15 +++
 gcc/config/arm/arm.h  | 14 ++
 gcc/config/arm/bpabi.h|  4 
 gcc/config/arm/t-aprofile |  2 ++
 gcc/doc/invoke.texi   | 13 +
 8 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/gcc/config/arm/arm-arches.def b/gcc/config/arm/arm-arches.def
index fd02b18..2b4a80e 100644
--- a/gcc/config/arm/arm-arches.def
+++ b/gcc/config/arm/arm-arches.def
@@ -58,10 +58,16 @@ ARM_ARCH("armv7e-m", cortexm4,  7EM,	ARM_FSET_MAKE_CPU1 (FL_CO_PROC |	  FL_F
 ARM_ARCH("armv8-a", cortexa53,  8A,	ARM_FSET_MAKE_CPU1 (FL_CO_PROC | FL_FOR_ARCH8A))
 ARM_ARCH("armv8-a+crc",cortexa53, 8A,   ARM_FSET_MAKE_CPU1 (FL_CO_PROC | FL_CRC32  | FL_FOR_ARCH8A))
 ARM_ARCH("armv8.1-a", cortexa53,  8A,
-	  ARM_FSET_MAKE (FL_CO_PROC | FL_FOR_ARCH8A,  FL2_FOR_ARCH8_1A))
+	  ARM_FSET_MAKE (FL_CO_PROC | FL_CRC32 | FL_FOR_ARCH8A,
+			 FL2_FOR_ARCH8_1A))
 ARM_ARCH("armv8.1-a+crc",cortexa53, 8A,
 	  ARM_FSET_MAKE (FL_CO_PROC | FL_CRC32 | FL_FOR_ARCH8A,
 			 FL2_FOR_ARCH8_1A))
+ARM_ARCH ("armv8.2-a", cortexa53,  8A,
+	  ARM_FSET_MAKE (FL_CO_PROC | FL_CRC32 | FL_FOR_ARCH8A,
+			 FL2_FOR_ARCH8_2A))
+ARM_ARCH ("armv8.2-a+fp16", cortexa53,  8A,
+	  ARM_FSET_MAKE (FL_CO_PROC | FL_CRC32 | FL_FOR_ARCH8A,
+			 FL2_FOR_ARCH8_2A | FL2_FP16INST))
 ARM_ARCH("iwmmxt",  iwmmxt, 5TE,	ARM_FSET_MAKE_CPU1 (FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT))
 ARM_ARCH("iwmmxt2", iwmmxt2,5TE,	ARM_FSET_MAKE_CPU1 (FL_LDSCHED | FL_STRONG | FL_FOR_ARCH5TE | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2))
-
diff --git a/gcc/config/arm/