[GCC/ARM] Multilib mapping for Armv8-R

Message ID 333ec2c7-72e5-3ca7-1b1b-e99e45bfd9d6@foss.arm.com
State New
Headers show
Series
  • [GCC/ARM] Multilib mapping for Armv8-R
Related show

Commit Message

Thomas Preudhomme Feb. 13, 2018, 10:24 a.m.
Hi,

Due to there being no multilib mapping for Armv8-R, default multilib
targeting -march=armv4t with softfloat floating-point arithmetic is
being used. This patch maps it instead to the existing Armv7 multilibs.
Note that since there is no single-precision multilib compatible with
R profile, -march=armv8-r+fp.sp is mapped to -march=armv7 ie. Armv7
with softfloat floating-point.

Changelog entry is as follows:

*** gcc/ChangeLog ***

2018-02-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* config/arm/t-multilib: Map Armv8-R to Armv7 multilibs.

Testing:

Ran -print-multi-directory for all combinations of extensions one can
pass to -march=armv8-r (including no extension but only considering a
single ordering of extension). All gave the expected result. Details in
appendix.

Is this ok for stage4?

Best regards,

Thomas

Appendix: output of -print-multi-directory for all extensions available
to -march=armv8-r

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=soft 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=softfp 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=softfp -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=softfp -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=softfp 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=softfp -print-multi-directory: 
thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=softfp 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=hard 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=hard -print-multi-directory: 
thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=hard -print-multi-directory: 
thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=hard 
-print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard

Comments

Kyrill Tkachov Feb. 13, 2018, 10:27 a.m. | #1
Hi Thomas,

On 13/02/18 10:24, Thomas Preudhomme wrote:
> Hi,
>
> Due to there being no multilib mapping for Armv8-R, default multilib
> targeting -march=armv4t with softfloat floating-point arithmetic is
> being used. This patch maps it instead to the existing Armv7 multilibs.
> Note that since there is no single-precision multilib compatible with
> R profile, -march=armv8-r+fp.sp is mapped to -march=armv7 ie. Armv7
> with softfloat floating-point.
>

Thanks for doing this.

> Changelog entry is as follows:
>
> *** gcc/ChangeLog ***
>
> 2018-02-12  Thomas Preud'homme <thomas.preudhomme@arm.com>
>
>         * config/arm/t-multilib: Map Armv8-R to Armv7 multilibs.
>
> Testing:
>
> Ran -print-multi-directory for all combinations of extensions one can
> pass to -march=armv8-r (including no extension but only considering a
> single ordering of extension). All gave the expected result. Details in
> appendix.
>
> Is this ok for stage4?
>
> Best regards,
>
> Thomas
>
> Appendix: output of -print-multi-directory for all extensions available
> to -march=armv8-r
>

Can you please add a representative subset of these as tests to gcc.target/arm/multilib.exp.
That way we can have the peace of mind that they have sane mappings as we go forward.

<snip, thanks for the results>

diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 2f790097670e1bf81b56b069a6b1582763aab6e9..cd5927a7c9ec053b4d5b9725f7b30daeca3b1aa3 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -70,6 +70,7 @@ v8_a_simd_variants	:= $(call all_feat_combs, simd crypto)
  v8_1_a_simd_variants	:= $(call all_feat_combs, simd crypto)
  v8_2_a_simd_variants	:= $(call all_feat_combs, simd fp16 fp16fml crypto dotprod)
  v8_4_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto)
+v8_r_nosimd_variants	:= $(call all_feat_combs, crc fp.sp)
  
  ifneq (,$(HAS_APROFILE))
  include $(srcdir)/config/arm/t-aprofile
@@ -105,6 +106,20 @@ MULTILIB_MATCHES	+= march?armv7+fp=march?armv7-r+fp+idiv
  
  MULTILIB_MATCHES	+= $(foreach ARCH, $(all_early_arch), \
  			     march?armv5te+fp=march?$(ARCH)+fp)
+#
+# Armv8-r: map down onto common v7 code.


Please use Armv8-R.



  +# Note 1: there is no single-precision armv7 multilib so +fp.sp is mapped
+# down to softfloat armv7 (second MULTILIB_MATCHES).
+# Note 2: +fp.sp being a subset of +simd and +crypto, there is no need to
+# consider the combination of +fp.sp with a simd extension since matching
+# is run after canonicalization
+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))
+
  
  ifeq (,$(HAS_APROFILE))
  # Map all v7-a
Thomas Preudhomme Feb. 16, 2018, 10:30 a.m. | #2
Hi Kyrill,

Thanks for the review. Here's my second attempt. I've fixed the typo you raised 
and added some tests (wasn't aware of those). I've also reworked the mapping 
somewhat, it's explain in the description below.


Due to there being no multilib mapping for Armv8-R, default multilib
builts for -march=armv4t with softfloat floating-point arithmetic is
being used. This patch maps it instead to the existing Armv7 multilibs.
Note that mapping for single-precision Armv8-R has been left out due to
there being no Arm implementation of that architecture variant.

Changelog entry is as follows:

*** gcc/ChangeLog ***

2018-02-12  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* config/arm/t-multilib: Map Armv8-R to Armv7 multilibs.


*** gcc/testsuite/ChangeLog ***

2018-02-13  Thomas Preud'homme  <thomas.preudhomme@arm.com>

	* gcc.target/arm/multilib.exp: Add tests for Armv8-R multilib mappings.

Testing:

Ran -print-multi-directory for all combinations of extensions one can
pass to -march=armv8-r (including no extension but only considering a
single ordering of extension). All gave the expected result. Details in
appendix.
Running multilib.exp is also successful.

Is this ok for stage4?

Best regards,

Thomas

Appendix: output of -print-multi-directory for all extensions available
to -march=armv8-r

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=soft 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=soft -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=soft 
-print-multi-directory: thumb/v7/nofp

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=softfp 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=softfp -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=softfp -print-multi-directory: 
thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=softfp 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=softfp -print-multi-directory: 
thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=softfp 
-print-multi-directory: thumb/v7/nofp
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=softfp 
-print-multi-directory: thumb/v7+fp/softfp

% for ext in "" +crc +fp.sp +simd +crypto +crc+fp.sp +crc+simd +crc+crypto 
+fp.sp+simd +fp.sp+crypto +simd+crypto +crc+fp.sp+simd +crc+fp.sp+crypto 
+crc+simd+crypto +fp.sp+simd+crypto +crc+fp.sp+simd+crypto ; do 
cmd="arm-none-eabi-gcc -march=armv8-r${ext} -mfloat-abi=hard 
-print-multi-directory" ; echo -n "$cmd: " ; eval $cmd ; done
arm-none-eabi-gcc -march=armv8-r -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+crc -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+fp.sp -mfloat-abi=hard -print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+simd -mfloat-abi=hard -print-multi-directory: 
thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crypto -mfloat-abi=hard -print-multi-directory: 
thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp -mfloat-abi=hard 
-print-multi-directory: .
arm-none-eabi-gcc -march=armv8-r+crc+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+fp.sp+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard
arm-none-eabi-gcc -march=armv8-r+crc+fp.sp+simd+crypto -mfloat-abi=hard 
-print-multi-directory: thumb/v7+fp/hard

On 13/02/18 10:27, Kyrill Tkachov wrote:
> Hi Thomas,
> 
> On 13/02/18 10:24, Thomas Preudhomme wrote:
>> Hi,
>>
>> Due to there being no multilib mapping for Armv8-R, default multilib
>> targeting -march=armv4t with softfloat floating-point arithmetic is
>> being used. This patch maps it instead to the existing Armv7 multilibs.
>> Note that since there is no single-precision multilib compatible with
>> R profile, -march=armv8-r+fp.sp is mapped to -march=armv7 ie. Armv7
>> with softfloat floating-point.
>>
> 
> Thanks for doing this.
> 
>> Changelog entry is as follows:
>>
>> *** gcc/ChangeLog ***
>>
>> 2018-02-12  Thomas Preud'homme <thomas.preudhomme@arm.com>
>>
>>         * config/arm/t-multilib: Map Armv8-R to Armv7 multilibs.
>>
>> Testing:
>>
>> Ran -print-multi-directory for all combinations of extensions one can
>> pass to -march=armv8-r (including no extension but only considering a
>> single ordering of extension). All gave the expected result. Details in
>> appendix.
>>
>> Is this ok for stage4?
>>
>> Best regards,
>>
>> Thomas
>>
>> Appendix: output of -print-multi-directory for all extensions available
>> to -march=armv8-r
>>
> 
> Can you please add a representative subset of these as tests to 
> gcc.target/arm/multilib.exp.
> That way we can have the peace of mind that they have sane mappings as we go 
> forward.
> 
> <snip, thanks for the results>
> 
> diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
> index 
> 2f790097670e1bf81b56b069a6b1582763aab6e9..cd5927a7c9ec053b4d5b9725f7b30daeca3b1aa3 
> 100644
> --- a/gcc/config/arm/t-multilib
> +++ b/gcc/config/arm/t-multilib
> @@ -70,6 +70,7 @@ v8_a_simd_variants    := $(call all_feat_combs, simd crypto)
>   v8_1_a_simd_variants    := $(call all_feat_combs, simd crypto)
>   v8_2_a_simd_variants    := $(call all_feat_combs, simd fp16 fp16fml crypto 
> dotprod)
>   v8_4_a_simd_variants    := $(call all_feat_combs, simd fp16 crypto)
> +v8_r_nosimd_variants    := $(call all_feat_combs, crc fp.sp)
> 
>   ifneq (,$(HAS_APROFILE))
>   include $(srcdir)/config/arm/t-aprofile
> @@ -105,6 +106,20 @@ MULTILIB_MATCHES    += march?armv7+fp=march?armv7-r+fp+idiv
> 
>   MULTILIB_MATCHES    += $(foreach ARCH, $(all_early_arch), \
>                    march?armv5te+fp=march?$(ARCH)+fp)
> +#
> +# Armv8-r: map down onto common v7 code.
> 
> 
> Please use Armv8-R.
> 
> 
> 
>   +# Note 1: there is no single-precision armv7 multilib so +fp.sp is mapped
> +# down to softfloat armv7 (second MULTILIB_MATCHES).
> +# Note 2: +fp.sp being a subset of +simd and +crypto, there is no need to
> +# consider the combination of +fp.sp with a simd extension since matching
> +# is run after canonicalization
> +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))
> +
> 
>   ifeq (,$(HAS_APROFILE))
>   # Map all v7-a
> 
>
diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 2f790097670e1bf81b56b069a6b1582763aab6e9..3d0c824b4ec8cacfadbbe765d9ad6fb3d83f4328 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -70,6 +70,7 @@ v8_a_simd_variants	:= $(call all_feat_combs, simd crypto)
 v8_1_a_simd_variants	:= $(call all_feat_combs, simd crypto)
 v8_2_a_simd_variants	:= $(call all_feat_combs, simd fp16 fp16fml crypto dotprod)
 v8_4_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto)
+v8_r_nosimd_variants	:= +crc
 
 ifneq (,$(HAS_APROFILE))
 include $(srcdir)/config/arm/t-aprofile
@@ -105,6 +106,14 @@ MULTILIB_MATCHES	+= march?armv7+fp=march?armv7-r+fp+idiv
 
 MULTILIB_MATCHES	+= $(foreach ARCH, $(all_early_arch), \
 			     march?armv5te+fp=march?$(ARCH)+fp)
+# Map v8-r down onto common v7 code.
+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))
+
 
 ifeq (,$(HAS_APROFILE))
 # Map all v7-a
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index c54bca85fd95e31ac5910d9ea95d3faf737d9c91..04da2b0a20eda299c5749e8702ac1c5a8c937900 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -422,6 +422,7 @@ if {[multilib_config "rmprofile"] } {
 	{-mcpu=cortex-m23 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.base/nofp"
 	{-mcpu=cortex-m33 -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
 	{-mcpu=cortex-m7+nofp.dp -mfpu=auto -mfloat-abi=soft} "thumb/v7e-m/nofp"
+	{-mcpu=cortex-r52 -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
 	{-mcpu=cortex-m0 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v6-m/nofp"
 	{-mcpu=cortex-m1 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v6-m/nofp"
 	{-mcpu=cortex-m3 -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v7-m/nofp"
@@ -466,6 +467,7 @@ if {[multilib_config "rmprofile"] } {
 	{-mcpu=cortex-m7 -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
 	{-mcpu=cortex-m33 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
 	{-mcpu=cortex-m7+nofp.dp -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
+	{-mcpu=cortex-r52 -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
 	{-mcpu=cortex-m4 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
 	{-mcpu=cortex-m7 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
 	{-mcpu=cortex-m33 -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
@@ -494,6 +496,7 @@ if {[multilib_config "rmprofile"] } {
 	{-mcpu=cortex-m23 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.base/nofp"
 	{-mcpu=cortex-m33 -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp"
 	{-mcpu=cortex-m7+nofp.dp -mfpu=auto -mfloat-abi=softfp} "thumb/v7e-m+fp/softfp"
+	{-mcpu=cortex-r52 -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
 	{-mcpu=cortex-m0 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v6-m/nofp"
 	{-mcpu=cortex-m1 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v6-m/nofp"
 	{-mcpu=cortex-m3 -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v7-m/nofp"
@@ -545,6 +548,12 @@ if {[multilib_config "rmprofile"] } {
 	{-march=armv8-m.main+fp.dp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
 	{-march=armv8-m.main+fp+dsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
 	{-march=armv8-m.main+fp.dp+dsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+	{-march=armv8-r -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
+	{-march=armv8-r+crc -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
+	{-march=armv8-r+simd -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
+	{-march=armv8-r+crc+simd -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
+	{-march=armv8-r+crypto -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
+	{-march=armv8-r+crc+crypto -mfpu=auto -mfloat-abi=soft} "thumb/v7/nofp"
 	{-march=armv6-m -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v6-m/nofp"
 	{-march=armv7-m -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v7-m/nofp"
 	{-march=armv7e-m -mfpu=vfpv3xd -mfloat-abi=soft} "thumb/v7e-m/nofp"
@@ -606,6 +615,10 @@ if {[multilib_config "rmprofile"] } {
 	{-march=armv8-m.main+fp.dp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
 	{-march=armv8-m.main+fp+dsp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
 	{-march=armv8-m.main+fp.dp+dsp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
+	{-march=armv8-r+simd -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv8-r+crc+simd -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv8-r+crypto -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
+	{-march=armv8-r+crc+crypto -mfpu=auto -mfloat-abi=hard} "thumb/v7+fp/hard"
 	{-march=armv7e-m -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
 	{-march=armv8-m.main -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
 	{-march=armv7e-m+fp -mfpu=vfpv3xd -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
@@ -657,6 +670,12 @@ if {[multilib_config "rmprofile"] } {
 	{-march=armv8-m.main+fp.dp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
 	{-march=armv8-m.main+fp+dsp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp"
 	{-march=armv8-m.main+fp.dp+dsp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+	{-march=armv8-r -mfpu=auto -mfloat-abi=softfp} "thumb/v7/nofp"
+	{-march=armv8-r+crc -mfpu=auto -mfloat-abi=softfp} "thumb/v7/nofp"
+	{-march=armv8-r+simd -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv8-r+crc+simd -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv8-r+crypto -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
+	{-march=armv8-r+crc+crypto -mfpu=auto -mfloat-abi=softfp} "thumb/v7+fp/softfp"
 	{-march=armv6-m -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v6-m/nofp"
 	{-march=armv7-m -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v7-m/nofp"
 	{-march=armv7e-m -mfpu=vfpv3xd -mfloat-abi=softfp} "thumb/v7e-m+fp/softfp"

Patch

diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index 2f790097670e1bf81b56b069a6b1582763aab6e9..cd5927a7c9ec053b4d5b9725f7b30daeca3b1aa3 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -70,6 +70,7 @@  v8_a_simd_variants	:= $(call all_feat_combs, simd crypto)
 v8_1_a_simd_variants	:= $(call all_feat_combs, simd crypto)
 v8_2_a_simd_variants	:= $(call all_feat_combs, simd fp16 fp16fml crypto dotprod)
 v8_4_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto)
+v8_r_nosimd_variants	:= $(call all_feat_combs, crc fp.sp)
 
 ifneq (,$(HAS_APROFILE))
 include $(srcdir)/config/arm/t-aprofile
@@ -105,6 +106,20 @@  MULTILIB_MATCHES	+= march?armv7+fp=march?armv7-r+fp+idiv
 
 MULTILIB_MATCHES	+= $(foreach ARCH, $(all_early_arch), \
 			     march?armv5te+fp=march?$(ARCH)+fp)
+#
+# Armv8-r: map down onto common v7 code.
+# Note 1: there is no single-precision armv7 multilib so +fp.sp is mapped
+# down to softfloat armv7 (second MULTILIB_MATCHES).
+# Note 2: +fp.sp being a subset of +simd and +crypto, there is no need to
+# consider the combination of +fp.sp with a simd extension since matching
+# is run after canonicalization
+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))
+
 
 ifeq (,$(HAS_APROFILE))
 # Map all v7-a