Re: [PATCH, GCC/ARM] Multilib mapping for Armv8-R
Hi Thomas, On 16/02/18 10:30, Thomas Preudhomme wrote: 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 * config/arm/t-multilib: Map Armv8-R to Armv7 multilibs. *** gcc/testsuite/ChangeLog *** 2018-02-13 Thomas Preud'homme * gcc.target/arm/multilib.exp: Add tests for Armv8-R multilib mappings. Thanks for fixing this. This is ok for trunk, Kyrill 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:
Re: [PATCH, GCC/ARM] Multilib mapping for Armv8-R
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 * config/arm/t-multilib: Map Armv8-R to Armv7 multilibs. *** gcc/testsuite/ChangeLog *** 2018-02-13 Thomas Preud'homme * 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-
Re: [PATCH, GCC/ARM] Multilib mapping for Armv8-R
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 * 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. 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
[PATCH, GCC/ARM] Multilib mapping for Armv8-R
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 * 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+cryp