From 0c012e9bf7a7c16283091714f18f8aa3633d89b6 Mon Sep 17 00:00:00 2001
From: Richard Earnshaw <rearnsha@arm.com>
Date: Wed, 16 Nov 2016 14:02:10 +0000
Subject: [PATCH] [arm] Add vfpv2 and neon-vfpv3

	* arm/arm-fpus.def (vfpv2): New FPU, currently an alias for 'vfp'.
	(neon-vfpv3): New FPU, currently an alias for 'neon'.
	* arm/arm-tables.opt: Regenerated.
        * arm/t-aprofile (MULTILIB_REUSE): Add reuse rules for vfpv2 and
        neon-vfpv3.
	* doc/invoke.texi (ARM: -mfpu): Document new options.  Note that 'vfp'
	and 'neon' are aliases for specific implementations.

From-SVN: r242491
---
 gcc/ChangeLog                 | 10 +++++++++
 gcc/config/arm/arm-fpus.def   |  2 ++
 gcc/config/arm/arm-tables.opt | 42 ++++++++++++++++++++---------------
 gcc/config/arm/t-aprofile     |  2 ++
 gcc/doc/invoke.texi           |  6 +++--
 5 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a49cda325b53..205afa8e1803 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2016-11-16  Richard Earnshaw  <rearnsha@arm.com>
+
+	* arm/arm-fpus.def (vfpv2): New FPU, currently an alias for 'vfp'.
+	(neon-vfpv3): New FPU, currently an alias for 'neon'.
+	* arm/arm-tables.opt: Regenerated.
+        * arm/t-aprofile (MULTILIB_REUSE): Add reuse rules for vfpv2 and
+        neon-vfpv3.
+	* doc/invoke.texi (ARM: -mfpu): Document new options.  Note that 'vfp'
+	and 'neon' are aliases for specific implementations.
+
 2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>
diff --git a/gcc/config/arm/arm-fpus.def b/gcc/config/arm/arm-fpus.def
index e0c43651d939..04b2ef140c44 100644
--- a/gcc/config/arm/arm-fpus.def
+++ b/gcc/config/arm/arm-fpus.def
@@ -26,6 +26,7 @@
    genopt.sh assumes no whitespace up to the first "," in each entry.  */
 
 ARM_FPU("vfp",		2, VFP_REG_D16, FPU_FL_NONE)
+ARM_FPU("vfpv2",	2, VFP_REG_D16, FPU_FL_NONE)
 ARM_FPU("vfpv3",	3, VFP_REG_D32, FPU_FL_NONE)
 ARM_FPU("vfpv3-fp16",	3, VFP_REG_D32, FPU_FL_FP16)
 ARM_FPU("vfpv3-d16",	3, VFP_REG_D16, FPU_FL_NONE)
@@ -33,6 +34,7 @@ ARM_FPU("vfpv3-d16-fp16", 3, VFP_REG_D16, FPU_FL_FP16)
 ARM_FPU("vfpv3xd",	3, VFP_REG_SINGLE, FPU_FL_NONE)
 ARM_FPU("vfpv3xd-fp16",	3, VFP_REG_SINGLE, FPU_FL_FP16)
 ARM_FPU("neon",		3, VFP_REG_D32, FPU_FL_NEON)
+ARM_FPU("neon-vfpv3",	3, VFP_REG_D32, FPU_FL_NEON)
 ARM_FPU("neon-fp16",	3, VFP_REG_D32, FPU_FL_NEON | FPU_FL_FP16)
 ARM_FPU("vfpv4",	4, VFP_REG_D32, FPU_FL_FP16)
 ARM_FPU("vfpv4-d16",	4, VFP_REG_D16, FPU_FL_FP16)
diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
index c143ff5b9abd..b12e4588557a 100644
--- a/gcc/config/arm/arm-tables.opt
+++ b/gcc/config/arm/arm-tables.opt
@@ -474,56 +474,62 @@ EnumValue
 Enum(arm_fpu) String(vfp) Value(0)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3) Value(1)
+Enum(arm_fpu) String(vfpv2) Value(1)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3-fp16) Value(2)
+Enum(arm_fpu) String(vfpv3) Value(2)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3-d16) Value(3)
+Enum(arm_fpu) String(vfpv3-fp16) Value(3)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3-d16-fp16) Value(4)
+Enum(arm_fpu) String(vfpv3-d16) Value(4)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3xd) Value(5)
+Enum(arm_fpu) String(vfpv3-d16-fp16) Value(5)
 
 EnumValue
-Enum(arm_fpu) String(vfpv3xd-fp16) Value(6)
+Enum(arm_fpu) String(vfpv3xd) Value(6)
 
 EnumValue
-Enum(arm_fpu) String(neon) Value(7)
+Enum(arm_fpu) String(vfpv3xd-fp16) Value(7)
 
 EnumValue
-Enum(arm_fpu) String(neon-fp16) Value(8)
+Enum(arm_fpu) String(neon) Value(8)
 
 EnumValue
-Enum(arm_fpu) String(vfpv4) Value(9)
+Enum(arm_fpu) String(neon-vfpv3) Value(9)
 
 EnumValue
-Enum(arm_fpu) String(vfpv4-d16) Value(10)
+Enum(arm_fpu) String(neon-fp16) Value(10)
 
 EnumValue
-Enum(arm_fpu) String(fpv4-sp-d16) Value(11)
+Enum(arm_fpu) String(vfpv4) Value(11)
 
 EnumValue
-Enum(arm_fpu) String(fpv5-sp-d16) Value(12)
+Enum(arm_fpu) String(vfpv4-d16) Value(12)
 
 EnumValue
-Enum(arm_fpu) String(fpv5-d16) Value(13)
+Enum(arm_fpu) String(fpv4-sp-d16) Value(13)
 
 EnumValue
-Enum(arm_fpu) String(neon-vfpv4) Value(14)
+Enum(arm_fpu) String(fpv5-sp-d16) Value(14)
 
 EnumValue
-Enum(arm_fpu) String(fp-armv8) Value(15)
+Enum(arm_fpu) String(fpv5-d16) Value(15)
 
 EnumValue
-Enum(arm_fpu) String(neon-fp-armv8) Value(16)
+Enum(arm_fpu) String(neon-vfpv4) Value(16)
 
 EnumValue
-Enum(arm_fpu) String(crypto-neon-fp-armv8) Value(17)
+Enum(arm_fpu) String(fp-armv8) Value(17)
 
 EnumValue
-Enum(arm_fpu) String(vfp3) Value(18)
+Enum(arm_fpu) String(neon-fp-armv8) Value(18)
+
+EnumValue
+Enum(arm_fpu) String(crypto-neon-fp-armv8) Value(19)
+
+EnumValue
+Enum(arm_fpu) String(vfp3) Value(20)
 
diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
index 8b591badf603..4ca8ea3d0025 100644
--- a/gcc/config/arm/t-aprofile
+++ b/gcc/config/arm/t-aprofile
@@ -112,6 +112,8 @@ MULTILIB_MATCHES       += mfpu?vfpv4-d16=mfpu?vfpv4
 MULTILIB_MATCHES       += mfpu?vfpv4-d16=mfpu?fpv5-d16
 MULTILIB_MATCHES       += mfpu?vfpv4-d16=mfpu?fp-armv8
 MULTILIB_MATCHES       += mfpu?neon-fp-armv8=mfpu?crypto-neon-fp-armv8
+MULTILIB_MATCHES       += mfpu?vfp=mfpu?vfpv2
+MULTILIB_MATCHES       += mfpu?neon=mfpu?neon-vfpv3
 
 
 # Map all requests for vfpv3 with a later CPU to vfpv3-d16 v7-a.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 14f9d8de205e..1d24b31a3f9d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15103,12 +15103,14 @@ is unsuccessful the option has no effect.
 @item -mfpu=@var{name}
 @opindex mfpu
 This specifies what floating-point hardware (or hardware emulation) is
-available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
+available on the target.  Permissible names are: @samp{vfpv2}, @samp{vfpv3},
 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
-@samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
+@samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
+Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
+is an alias for @samp{vfpv2}.
 
 If @option{-msoft-float} is specified this specifies the format of
 floating-point values.
-- 
GitLab