Skip various cmp-mem-const tests on lp64 hppa*-*-*
[official-gcc.git] / gcc / config / nvptx / gen-multilib-matches.sh
blob44c758c3b1bf6210a7471acef5056b8126c5b3f9
1 #!/bin/sh
3 # Print nvptx 'MULTILIB_MATCHES'
5 # Copyright (C) 2022-2024 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)
12 # any later version.
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/>.
23 set -e
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.
37 sm_next_lower=INVALID
39 for sm in $sms; do
40 if [ x"sm_$sm" = x"$multilib_options_isa_default" ]; then
41 sm_map=.
42 elif expr " $multilib_options_isa_list " : ".* sm_$sm " > /dev/null; then
43 sm_map=
44 else
45 sm_map=$sm_next_lower
48 if [ x"$sm_map" = x ]; then
49 sm_next_lower=$sm
50 else
51 # Output format as required for 'MULTILIB_MATCHES'.
52 if [ x"$sm_map" = x. ]; then
53 echo ".=misa?sm_$sm"
54 else
55 echo "misa?sm_$sm_map=misa?sm_$sm"
58 sm_next_lower=$sm_map
60 done