3 # Print nvptx 'MULTILIB_MATCHES'
5 # Copyright (C) 2022-2023 Free Software Foundation, Inc.
7 # This file is part of GCC.
9 # GCC is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3, or (at your option)
14 # GCC is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GCC; see the file COPYING3. If not see
21 # <http://www.gnu.org/licenses/>.
25 nvptx_sm_def
="$1/nvptx-sm.def"
26 multilib_options_isa_default
=$2
27 multilib_options_isa_list
=$3
29 sms
=$
(grep ^NVPTX_SM
$nvptx_sm_def |
sed 's/.*(//;s/,.*//')
31 # Every variant in 'sms' has to either be remapped to the default variant
32 # ('.', which is always built), or does get built as non-default variant
33 # ('misa=sm_SM'; thus not remapped), or has to be remapped to the "next lower"
34 # variant that does get built.
36 # The "lowest" variant has to be built.
40 if [ x
"sm_$sm" = x
"$multilib_options_isa_default" ]; then
42 elif expr " $multilib_options_isa_list " : ".* sm_$sm " > /dev
/null
; then
48 if [ x
"$sm_map" = x
]; then
51 # Output format as required for 'MULTILIB_MATCHES'.
52 if [ x
"$sm_map" = x.
]; then
55 echo "misa?sm_$sm_map=misa?sm_$sm"