2 # Generate mips-tables.opt from the list of CPUs in mips-cpus.def.
3 # Copyright (C) 2011-2017 Free Software Foundation, Inc.
5 # This file is part of GCC.
7 # GCC is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3, or (at your option)
12 # GCC is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with GCC; see the file COPYING3. If not see
19 # <http://www.gnu.org/licenses/>.
22 ; -*- buffer-read-only: t -*-
23 ; Generated automatically by genopt.sh from mips-cpus.def.
25 ; Copyright (C) 2011-2017 Free Software Foundation, Inc.
27 ; This file is part of GCC.
29 ; GCC is free software; you can redistribute it and/or modify it under
30 ; the terms of the GNU General Public License as published by the Free
31 ; Software Foundation; either version 3, or (at your option) any later
34 ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
35 ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
36 ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
39 ; You should have received a copy of the GNU General Public License
40 ; along with GCC; see the file COPYING3. If not see
41 ; <http://www.gnu.org/licenses/>.
44 Name(mips_arch_opt_value) Type(int)
45 Known MIPS CPUs (for use with the -march= and -mtune= options):
48 Name(mips_mips_opt_value) Type(int)
49 Known MIPS ISA levels (for use with the -mips option):
52 Enum(mips_arch_opt_value) String(from-abi) Value(MIPS_ARCH_OPTION_FROM_ABI)
55 Enum(mips_arch_opt_value) String(native) Value(MIPS_ARCH_OPTION_NATIVE) DriverOnly
64 # Write an entry for a single string accepted as a -march= argument.
66 function write_one_arch_value(name, value, flags)
69 print "Enum(mips_arch_opt_value) String(" name ") Value(" value ")" flags
72 sub("^mips", "", name)
74 print "Enum(mips_mips_opt_value) String(" name ") Value(" value ")"
79 # The logic for matching CPU name variants should be the same as in GAS.
81 # Write an entry for a single string accepted as a -march= argument,
82 # plus any variant with a final "000" replaced by "k".
84 function write_arch_value_maybe_k(name, value, flags)
86 write_one_arch_value(name, value, flags)
88 sub("000$", "k", name)
89 write_one_arch_value(name, value, "")
93 # Write all the entries for a -march= argument. In addition to
94 # replacement of a final "000" with "k", an argument starting with
95 # "vr", "rm" or "r" followed by a number, or just a plain number,
96 # matches a plain number or "r" followed by a plain number.
98 function write_all_arch_values(name, value)
100 write_arch_value_maybe_k(name, value, " Canonical")
103 sub("^vr", "", cname)
104 } else if (cname ~ "^rm") {
105 sub("^rm", "", cname)
106 } else if (cname ~ "^r") {
109 if (cname ~ "^[0-9]") {
111 write_arch_value_maybe_k(cname, value, "")
114 write_arch_value_maybe_k(rname, value, "")
121 write_all_arch_values(name, value)