aboutsummaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2024-09-27 17:44:16 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2024-12-06 11:59:51 +0100
commit86b3a7532d56f74fcd1c362f2da7f95e8cc4e4a6 (patch)
treef4fe93700887e3d7d5dececb04c30cf304a11279 /gcc/config.gcc
parent2b707b41b178dc2f42aee1d28b2ee62583241cca (diff)
downloadgcc-86b3a7532d56f74fcd1c362f2da7f95e8cc4e4a6.zip
gcc-86b3a7532d56f74fcd1c362f2da7f95e8cc4e4a6.tar.gz
gcc-86b3a7532d56f74fcd1c362f2da7f95e8cc4e4a6.tar.bz2
nvptx: Support '--with-multilib-list'
No change in behavior unless specifying it. gcc/ * config.gcc: nvptx: Support '--with-multilib-list'. * config/nvptx/gen-multilib-matches.sh: Adjust. * configure.ac: Likewise. * configure: Regenerate. * doc/install.texi: Update. * doc/invoke.texi: Align. * config/nvptx/gen-multilib-matches-tests: Extend.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc69
1 files changed, 59 insertions, 10 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index f4ae14c..6381a57 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5595,21 +5595,70 @@ case "${target}" in
;;
nvptx-*)
supported_defaults=arch
- TM_MULTILIB_CONFIG=$with_arch
- #TODO 'sm_[...]' list per 'nvptx-sm.def'.
- case $with_arch in
- sm_30 )
- # OK; default.
+
+ nvptx_multilibs_default=sm_30
+
+ case "x${with_multilib_list}" in
+ x | xno)
+ nvptx_multilibs=
+ ;;
+ xdefault | xyes)
+ nvptx_multilibs=default
+ ;;
+ *)
+ nvptx_multilibs=$with_multilib_list
+ ;;
+ esac
+ nvptx_multilibs=`echo $nvptx_multilibs | sed -e 's/,/ /g'`
+ # Expand 'default'.
+ nvptx_multilibs_expanded=
+ for nvptx_multilib in $nvptx_multilibs; do
+ case $nvptx_multilib in
+ default )
+ nvptx_multilibs_expanded="$nvptx_multilibs_expanded $nvptx_multilibs_default"
+ ;;
+ * )
+ nvptx_multilibs_expanded="$nvptx_multilibs_expanded $nvptx_multilib"
;;
- sm_35 | sm_53 | sm_70 | sm_75 | sm_80 )
- # OK, but we'd like 'sm_30', too.
- TM_MULTILIB_CONFIG="$TM_MULTILIB_CONFIG sm_30"
+ esac
+ done
+ # The '--with-arch=[...]' one comes first.
+ nvptx_multilibs=$with_arch$nvptx_multilibs_expanded
+ # Filter out any duplicates.
+ nvptx_multilibs_filtered=
+ for nvptx_multilib in $nvptx_multilibs; do
+ case " $nvptx_multilibs_filtered " in
+ *" $nvptx_multilib "* )
+ :
+ ;;
+ * )
+ nvptx_multilibs_filtered="$nvptx_multilibs_filtered $nvptx_multilib"
+ ;;
+ esac
+ done
+ nvptx_multilibs=$nvptx_multilibs_filtered
+ # Verify, and build 'TM_MULTILIB_CONFIG'.
+ TM_MULTILIB_CONFIG=
+ for nvptx_multilib in $nvptx_multilibs; do
+ case $nvptx_multilib in
+ #TODO 'sm_[...]' list per 'nvptx-sm.def'.
+ sm_30 | sm_35 \
+ | sm_53 \
+ | sm_70 | sm_75 \
+ | sm_80 )
+ TM_MULTILIB_CONFIG="$TM_MULTILIB_CONFIG $nvptx_multilib"
+ ;;
+ $with_arch )
+ echo "Unknown arch used in --with-arch=$nvptx_multilib" 1>&2
+ exit 1
;;
* )
- echo "Unknown arch used in --with-arch=$with_arch" 1>&2
+ echo "Unknown arch used in --with-multilib-list: $nvptx_multilib" 1>&2
exit 1
;;
- esac
+ esac
+ done
+ TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^ //'`
;;
powerpc*-*-* | rs6000-*-*)