This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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  <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
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]