diff mbox series

[committed,arm] Backport -- Fix multilibs for Armv7-R(was Re: [PATCH, arm] Backport -- Fix multilibs for Armv7-R)

Message ID ec96c707-82c9-6997-34a8-b5d124c64fc5@arm.com
State New
Headers show
Series [committed,arm] Backport -- Fix multilibs for Armv7-R(was Re: [PATCH, arm] Backport -- Fix multilibs for Armv7-R) | expand

Commit Message

Andre Vieira (lists) Oct. 24, 2019, 4:56 p.m. UTC
Hi,

We had a chat offline with Kyrill in which he approved committing the 
patch now.  Unfortunately he isn't able to access his email until 
tomorrow to confirm his approval, but given a time sensitive deadline 
and the fact that this patch was previously reviewed and accepted on 
trunk I am committing the attached patch on behalf of Mihail Ionescu 
with Kyrylo Tkachov's offline approval.

Committed to gcc-9-branch in revision r277417.

Cheers,
Andre


On 22/10/2019 17:21, Mihail Ionescu wrote:
> Hi,
> 
> I previously did not properly attach the diff.
> 
> 
> Regards,
> Mihail
> 
> On 10/22/2019 05:06 PM, Mihail Ionescu wrote:
>> Hi,
>>
>> This is a backport from trunk for GCC9.
>>
>> SVN revision: r277156.
>>
>> Built and tested on arm-none-eabi (comparted 
>> -march=armv7e-m+fp/-mfloat-abi=hard
>> to -march=armv7-r+fp.sp/-mfloat-abi=hard).
>>
>>
>> gcc/ChangeLog:
>>
>> 2019-10-21  Mihail Ionescu  <mihail.ionescu@arm.com>
>>
>>      Backport from mainline
>>      2019-10-18  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>      * config/arm/t-multilib: Add new multilib variants and new
>>      mappings.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2019-10-21  Mihail Ionescu  <mihail.ionescu@arm.com>
>>
>>      Backport from mainline
>>      2019-10-18  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>      * gcc.target/arm/multilib.exp: Add extra tests.
>>
>>
>> Is it ok for backport to GCC9?
>>
>>
>> Regards,
>> Mihail
>>
>>
>> ###############     Attachment also inlined for ease of reply 
>> ###############
>>
>>
>> diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
>> index 
>> 08526302283eea03e4a8f22a2a049e85bd7bb6af..dc97c8f09fb0b7f53520432e1a174adfce1bf6af 
>> 100644
>> --- a/gcc/config/arm/t-multilib
>> +++ b/gcc/config/arm/t-multilib
>> @@ -24,6 +24,8 @@
>>   # values during the configure step.  We enforce this during the
>>   # top-level configury.
>>   +s-mlib: $(srcdir)/config/arm/t-multilib 
>> $(srcdir)/config/arm/t-aprofile $(srcdir)/config/arm/t-rmprofile
>> +
>>   MULTILIB_OPTIONS     =
>>   MULTILIB_DIRNAMES    =
>>   MULTILIB_EXCEPTIONS  =
>> @@ -63,6 +65,8 @@ all_early_arch        := armv5tej armv6 armv6j 
>> armv6k armv6z armv6kz \
>>   v7_a_arch_variants    := $(call all_feat_combs, mp sec)
>>   v7_a_nosimd_variants    := +fp +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 
>> +vfpv4-d16 +vfpv4
>>   v7_a_simd_variants    := +simd +neon-fp16 +neon-vfpv4
>> +v7_r_sp_variants    := +fp.sp +fp.sp+idiv +vfpv3xd-fp16 
>> +vfpv3xd-fp16+idiv
>> +v7_r_dp_variants    := +fp +fp+idiv +vfpv3-d16-fp16 +vfpv3-d16-fp16+idiv
>>   v7ve_nosimd_variants    := +vfpv3-d16 +vfpv3 +vfpv3-d16-fp16 
>> +vfpv3-fp16 +fp +vfpv4
>>   v7ve_vfpv3_simd_variants := +neon +neon-fp16
>>   v7ve_vfpv4_simd_variants := +simd
>> @@ -86,8 +90,8 @@ SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
>>   MULTILIB_OPTIONS    += marm/mthumb
>>   MULTILIB_DIRNAMES    += arm thumb
>>   -MULTILIB_OPTIONS    += 
>> march=armv5te+fp/march=armv7/march=armv7+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM) 
>>
>> -MULTILIB_DIRNAMES    += v5te v7 v7+fp $(MULTI_ARCH_DIRS_A) 
>> $(MULTI_ARCH_DIRS_RM)
>> +MULTILIB_OPTIONS    += 
>> march=armv5te+fp/march=armv7/march=armv7+fp/march=armv7-r+fp.sp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM) 
>>
>> +MULTILIB_DIRNAMES    += v5te v7 v7+fp v7-r+fp.sp $(MULTI_ARCH_DIRS_A) 
>> $(MULTI_ARCH_DIRS_RM)
>>    MULTILIB_OPTIONS    += 
>> mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
>>   MULTILIB_DIRNAMES    += nofp softfp hard
>> @@ -100,22 +104,31 @@ MULTILIB_REQUIRED    += 
>> mthumb/march=armv7/mfloat-abi=soft
>>   MULTILIB_REQUIRED    += mthumb/march=armv7+fp/mfloat-abi=softfp
>>   MULTILIB_REQUIRED    += mthumb/march=armv7+fp/mfloat-abi=hard
>>   -# Map v7-r down onto common v7 code.
>> +MULTILIB_REQUIRED    += mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp
>> +MULTILIB_REQUIRED    += mthumb/march=armv7-r+fp.sp/mfloat-abi=hard
>> +
>> +# Map v7-r with double precision down onto common v7 code.
>>   MULTILIB_MATCHES    += march?armv7=march?armv7-r
>>   MULTILIB_MATCHES    += march?armv7=march?armv7-r+idiv
>> -MULTILIB_MATCHES    += march?armv7+fp=march?armv7-r+fp
>> -MULTILIB_MATCHES    += march?armv7+fp=march?armv7-r+fp+idiv
>> +MULTILIB_MATCHES    += $(foreach ARCH, $(v7_r_dp_variants), \
>> +                 march?armv7+fp=march?armv7-r$(ARCH))
>> +
>> +# Map v7-r single precision variants to v7-r with single precision.
>> +MULTILIB_MATCHES    += $(foreach ARCH, \
>> +                 $(filter-out +fp.sp, $(v7_r_sp_variants)), \
>> +                 march?armv7-r+fp.sp=march?armv7-r$(ARCH))
>>    MULTILIB_MATCHES    += $(foreach ARCH, $(all_early_arch), \
>>                    march?armv5te+fp=march?$(ARCH)+fp)
>> -# Map v8-r down onto common v7 code.
>> +# Map v8-r down onto common v7 code or v7-r sp.
>>   MULTILIB_MATCHES    += march?armv7=march?armv8-r
>>   MULTILIB_MATCHES    += $(foreach ARCH, $(v8_r_nosimd_variants), \
>>                    march?armv7=march?armv8-r$(ARCH))
>>   MULTILIB_MATCHES    += $(foreach ARCH,+simd +crypto, \
>>                    march?armv7+fp=march?armv8-r$(ARCH) \
>>                    march?armv7+fp=march?armv8-r+crc$(ARCH))
>> -
>> +MULTILIB_MATCHES    += march?armv7-r+fp.sp=march?armv8-r+fp.sp
>> +MULTILIB_MATCHES    += march?armv7-r+fp.sp=march?armv8-r+crc+fp.sp
>>    ifeq (,$(HAS_APROFILE))
>>   # Map all v7-a
>> @@ -177,7 +190,7 @@ MULTILIB_MATCHES    += $(foreach ARCH, 
>> $(v8_5_a_simd_variants), \
>>   MULTILIB_REUSE        += 
>> mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
>>    MULTILIB_REUSE        += $(foreach ABI, hard softfp, \
>> -                 $(foreach ARCH, armv7+fp, \
>> +                 $(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
>> mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI))) 
>>
>>    # Softfp but no FP, use the soft-float libraries.
>> diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp 
>> b/gcc/testsuite/gcc.target/arm/multilib.exp
>> index 
>> d82306ed630f2df0645ccaa43ba1f9dd3d5c72ed..dcea829965eb15e372401e6389df5a1403393ecb 
>> 100644
>> --- a/gcc/testsuite/gcc.target/arm/multilib.exp
>> +++ b/gcc/testsuite/gcc.target/arm/multilib.exp
>> @@ -753,6 +753,28 @@ if {[multilib_config "rmprofile"] } {
>>       {-march=armv8-m.main+fp.dp -mfpu=fpv5-d16 -mfloat-abi=softfp} 
>> "thumb/v8-m.main+dp/softfp"
>>       {-march=armv8-m.main+fp+dsp -mfpu=fpv5-d16 -mfloat-abi=softfp} 
>> "thumb/v8-m.main+dp/softfp"
>>       {-march=armv8-m.main+fp.dp+dsp -mfpu=fpv5-d16 
>> -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
>> +    {-march=armv7-r+fp -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7+fp/softfp"
>> +    {-march=armv7-r+fp -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
>> +    {-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7+fp/softfp"
>> +    {-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7+fp/hard"
>> +    {-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7+fp/softfp"
>> +    {-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7+fp/hard"
>> +    {-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto 
>> -mfloat-abi=softfp} "thumb/v7+fp/softfp"
>> +    {-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7+fp/hard"
>> +    {-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>> +    {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=softfp} 
>> "thumb/v7-r+fp.sp/softfp"
>> +    {-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=hard} 
>> "thumb/v7-r+fp.sp/hard"
>>       } {
>>       check_multi_dir $opts $dir
>>       }
>>
>>
diff mbox series

Patch

diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 08526302283eea03e4a8f22a2a049e85bd7bb6af..dc97c8f09fb0b7f53520432e1a174adfce1bf6af 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -24,6 +24,8 @@ 
 # values during the configure step.  We enforce this during the
 # top-level configury.
 
+s-mlib: $(srcdir)/config/arm/t-multilib $(srcdir)/config/arm/t-aprofile $(srcdir)/config/arm/t-rmprofile
+
 MULTILIB_OPTIONS     =
 MULTILIB_DIRNAMES    =
 MULTILIB_EXCEPTIONS  =
@@ -63,6 +65,8 @@  all_early_arch		:= armv5tej armv6 armv6j armv6k armv6z armv6kz \
 v7_a_arch_variants	:= $(call all_feat_combs, mp sec)
 v7_a_nosimd_variants	:= +fp +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +vfpv4-d16 +vfpv4
 v7_a_simd_variants	:= +simd +neon-fp16 +neon-vfpv4
+v7_r_sp_variants	:= +fp.sp +fp.sp+idiv +vfpv3xd-fp16 +vfpv3xd-fp16+idiv
+v7_r_dp_variants	:= +fp +fp+idiv +vfpv3-d16-fp16 +vfpv3-d16-fp16+idiv
 v7ve_nosimd_variants	:= +vfpv3-d16 +vfpv3 +vfpv3-d16-fp16 +vfpv3-fp16 +fp +vfpv4
 v7ve_vfpv3_simd_variants := +neon +neon-fp16
 v7ve_vfpv4_simd_variants := +simd
@@ -86,8 +90,8 @@  SEP := $(and $(HAS_APROFILE),$(HAS_RMPROFILE),/)
 MULTILIB_OPTIONS	+= marm/mthumb
 MULTILIB_DIRNAMES	+= arm thumb
 
-MULTILIB_OPTIONS	+= march=armv5te+fp/march=armv7/march=armv7+fp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
-MULTILIB_DIRNAMES	+= v5te v7 v7+fp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
+MULTILIB_OPTIONS	+= march=armv5te+fp/march=armv7/march=armv7+fp/march=armv7-r+fp.sp/$(MULTI_ARCH_OPTS_A)$(SEP)$(MULTI_ARCH_OPTS_RM)
+MULTILIB_DIRNAMES	+= v5te v7 v7+fp v7-r+fp.sp $(MULTI_ARCH_DIRS_A) $(MULTI_ARCH_DIRS_RM)
 
 MULTILIB_OPTIONS	+= mfloat-abi=soft/mfloat-abi=softfp/mfloat-abi=hard
 MULTILIB_DIRNAMES	+= nofp softfp hard
@@ -100,22 +104,31 @@  MULTILIB_REQUIRED	+= mthumb/march=armv7/mfloat-abi=soft
 MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=softfp
 MULTILIB_REQUIRED	+= mthumb/march=armv7+fp/mfloat-abi=hard
 
-# Map v7-r down onto common v7 code.
+MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=softfp
+MULTILIB_REQUIRED	+= mthumb/march=armv7-r+fp.sp/mfloat-abi=hard
+
+# Map v7-r with double precision down onto common v7 code.
 MULTILIB_MATCHES	+= march?armv7=march?armv7-r
 MULTILIB_MATCHES	+= march?armv7=march?armv7-r+idiv
-MULTILIB_MATCHES	+= march?armv7+fp=march?armv7-r+fp
-MULTILIB_MATCHES	+= march?armv7+fp=march?armv7-r+fp+idiv
+MULTILIB_MATCHES	+= $(foreach ARCH, $(v7_r_dp_variants), \
+			     march?armv7+fp=march?armv7-r$(ARCH))
+
+# Map v7-r single precision variants to v7-r with single precision.
+MULTILIB_MATCHES	+= $(foreach ARCH, \
+			     $(filter-out +fp.sp, $(v7_r_sp_variants)), \
+			     march?armv7-r+fp.sp=march?armv7-r$(ARCH))
 
 MULTILIB_MATCHES	+= $(foreach ARCH, $(all_early_arch), \
 			     march?armv5te+fp=march?$(ARCH)+fp)
-# Map v8-r down onto common v7 code.
+# Map v8-r down onto common v7 code or v7-r sp.
 MULTILIB_MATCHES	+= march?armv7=march?armv8-r
 MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_r_nosimd_variants), \
 			     march?armv7=march?armv8-r$(ARCH))
 MULTILIB_MATCHES	+= $(foreach ARCH,+simd +crypto, \
 			     march?armv7+fp=march?armv8-r$(ARCH) \
 			     march?armv7+fp=march?armv8-r+crc$(ARCH))
-
+MULTILIB_MATCHES	+= march?armv7-r+fp.sp=march?armv8-r+fp.sp
+MULTILIB_MATCHES	+= march?armv7-r+fp.sp=march?armv8-r+crc+fp.sp
 
 ifeq (,$(HAS_APROFILE))
 # Map all v7-a
@@ -177,7 +190,7 @@  MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_5_a_simd_variants), \
 MULTILIB_REUSE		+= mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft
 
 MULTILIB_REUSE		+= $(foreach ABI, hard softfp, \
-			     $(foreach ARCH, armv7+fp, \
+			     $(foreach ARCH, armv7+fp armv7-r+fp\.sp, \
 			       mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
 
 # Softfp but no FP, use the soft-float libraries.
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index d82306ed630f2df0645ccaa43ba1f9dd3d5c72ed..dcea829965eb15e372401e6389df5a1403393ecb 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -753,6 +753,28 @@  if {[multilib_config "rmprofile"] } {
 	{-march=armv8-m.main+fp.dp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
 	{-march=armv8-m.main+fp+dsp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
 	{-march=armv8-m.main+fp.dp+dsp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+	{-march=armv7-r+fp -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv7-r+fp -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv7-r+fp+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv7-r+vfpv3-d16-fp16 -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv7-r+vfpv3-d16-fp16+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv7-r+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv7-r+fp.sp+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv7-r+vfpv3xd -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv7-r+vfpv3xd+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv7-r+vfpv3xd-fp16+idiv -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+	{-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
+	{-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
     } {
 	check_multi_dir $opts $dir
     }