commit 1ddc344d07ed643926e0f91c8467b3f0973483c0
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Mon Dec 18 19:57:22 2017 +0000

    [arm] Add -march=armv8.3-a and dotprod multilib selection rules

diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
index 3e92c62..6c34c09 100644
--- a/gcc/config/arm/t-aprofile
+++ b/gcc/config/arm/t-aprofile
@@ -88,9 +88,13 @@ MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_1_a_simd_variants), \
 # Baseline v8.2-a: map down to baseline v8-a
 MULTILIB_MATCHES	+= march?armv8-a=march?armv8.2-a
 
-# Map all v8.2-a SIMD variants to v8-a+simd
+# Baseline v8.3-a: map down to baseline v8-a
+MULTILIB_MATCHES	+= march?armv8-a=march?armv8.3-a
+
+# Map all v8.2-a and v8.3-a SIMD variants to v8-a+simd
 MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_2_a_simd_variants), \
-			     march?armv8-a+simd=march?armv8.2-a$(ARCH))
+			     march?armv8-a+simd=march?armv8.2-a$(ARCH) \
+			     march?armv8-a+simd=march?armv8.3-a$(ARCH))
 
 # Use Thumb libraries for everything.
 
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index ace4736..189ab9b 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -36,7 +36,7 @@ v7ve_fps	:= vfpv3-d16 vfpv3 vfpv3-d16-fp16 vfpv3-fp16 vfpv4 neon \
 
 # Not all these permutations exist for all architecture variants, but
 # it seems to work ok.
-v8_fps		:= simd fp16 crypto fp16+crypto
+v8_fps		:= simd fp16 crypto fp16+crypto dotprod
 
 # We don't do anything special with these.  Pre-v4t probably doesn't work.
 all_early_nofp	:= armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t
@@ -46,7 +46,7 @@ all_early_arch	:= armv5e armv5tej armv6 armv6j armv6k armv6z armv6kz \
 
 all_v7_a_r	:= armv7-a armv7ve armv7-r
 
-all_v8_archs	:= armv8-a armv8-a+crc armv8.1-a armv8.2-a
+all_v8_archs	:= armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a
 
 # No floating point variants, require thumb1 softfp
 all_nofp_t	:= armv6-m armv6s-m armv8-m.base
diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 58448a9..c0ca255 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -139,9 +139,13 @@ MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_1_a_simd_variants), \
 # Baseline v8.2-a: map down to baseline v8-a
 MULTILIB_MATCHES	+= march?armv7=march?armv8.2-a
 
-# Map all v8.2-a SIMD variants
+# Baseline v8.3-a: map down to baseline v8-a
+MULTILIB_MATCHES	+= march?armv7=march?armv8.3-a
+
+# Map all v8.2-a SIMD variants.  v8.3-a SIMD variants have the same mappings
 MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_2_a_simd_variants), \
-			     march?armv7+fp=march?armv8.2-a$(ARCH))
+			     march?armv7+fp=march?armv8.2-a$(ARCH) \
+			     march?armv7+fp=march?armv8.3-a$(ARCH))
 
 # Use Thumb libraries for everything.
 
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index 5de87c4..c3c8e1f 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -72,6 +72,26 @@ if {[multilib_config "aprofile"] } {
 	{-march=armv8.2-a+simd+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
 	{-march=armv8.2-a+simd+crypto+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
 	{-march=armv8.2-a+simd+nofp+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.2-a+fp16 -mfloat-abi=soft} "thumb/v8-a/nofp"
+	{-march=armv8.2-a+simd+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.2-a+simd+fp16+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
+	{-march=armv8.2-a+simd+nofp+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.2-a+dotprod -mfloat-abi=soft} "thumb/v8-a/nofp"
+	{-march=armv8.2-a+simd+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.2-a+simd+dotprod+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
+	{-march=armv8.2-a+simd+nofp+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+crypto -mfloat-abi=soft} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+simd+crypto+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+nofp+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+fp16 -mfloat-abi=soft} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+simd+fp16+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+nofp+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+dotprod -mfloat-abi=soft} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv8.3-a+simd+dotprod+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
+	{-march=armv8.3-a+simd+nofp+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
 	{-mcpu=cortex-a53+crypto -mfloat-abi=hard} "thumb/v8-a+simd/hard"
 	{-mcpu=cortex-a53+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
 	{-march=armv8-a+crc -mfloat-abi=hard -mfpu=vfp} "thumb/v8-a+simd/hard"
