]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/loongarch/loongarch-driver.h
1 /* Subroutine headers for the gcc driver.
2 Copyright (C) 2021-2023 Free Software Foundation, Inc.
3 Contributed by Loongson Ltd.
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/>. */
21 #ifndef LOONGARCH_DRIVER_H
22 #define LOONGARCH_DRIVER_H
24 #include "loongarch-str.h"
26 #ifndef SUBTARGET_CPP_SPEC
27 #define SUBTARGET_CPP_SPEC ""
30 #ifndef SUBTARGET_CC1_SPEC
31 #define SUBTARGET_CC1_SPEC ""
34 #ifndef SUBTARGET_ASM_SPEC
35 #define SUBTARGET_ASM_SPEC ""
39 {"early_self_spec", ""}, \
40 {"subtarget_cc1_spec", SUBTARGET_CC1_SPEC}, \
41 {"subtarget_cpp_spec", SUBTARGET_CPP_SPEC}, \
42 {"subtarget_asm_spec", SUBTARGET_ASM_SPEC},
47 "%(subtarget_cpp_spec)"
51 "%{G*} %{,ada:-gnatea %{mabi=*} -gnatez} " \
52 "%(subtarget_cc1_spec)"
56 "%{mabi=*} %(subtarget_asm_spec)"
60 la_driver_init (int argc
, const char **argv
);
63 driver_set_m_parm (int argc
, const char **argv
);
66 driver_set_no_link (int argc
, const char **argv
);
69 driver_get_normalized_m_opts (int argc
, const char **argv
);
71 #define EXTRA_SPEC_FUNCTIONS \
72 { "driver_init", la_driver_init }, \
73 { "set_m_parm", driver_set_m_parm }, \
74 { "set_no_link", driver_set_no_link }, \
75 { "get_normalized_m_opts", driver_get_normalized_m_opts },
77 /* Pre-process ABI-related options. */
78 #define LA_SET_PARM_SPEC(NAME) \
79 " %{m" OPTSTR_##NAME "=*: %:set_m_parm(" OPTSTR_##NAME " %*)}" \
81 /* For MLIB_SELF_SPECS. */
82 #include "loongarch-multilib.h"
84 #ifndef MLIB_SELF_SPECS
85 #define MLIB_SELF_SPECS ""
88 #define DRIVER_HANDLE_MACHINE_OPTIONS \
89 " %(early_self_spec)", \
92 " %{c|S|E|nostdlib: %:set_no_link()}" \
93 " %{nostartfiles: %{nodefaultlibs: %:set_no_link()}}" \
94 LA_SET_PARM_SPEC (ABI_BASE) \
95 LA_SET_PARM_SPEC (ARCH) \
96 LA_SET_PARM_SPEC (TUNE) \
97 LA_SET_PARM_SPEC (ISA_EXT_FPU) \
98 LA_SET_PARM_SPEC (ISA_EXT_SIMD) \
99 LA_SET_PARM_SPEC (CMODEL) \
100 " %:get_normalized_m_opts()"
102 #define DRIVER_SELF_SPECS \
103 DRIVER_HANDLE_MACHINE_OPTIONS
105 /* ABI spec strings. */
106 #define ABI_GRLEN_SPEC \
110 "%{mabi=lp64d:lp64d}" \
111 "%{mabi=lp64f:lp64f}" \
112 "%{mabi=lp64s:lp64s}" \
114 #endif /* LOONGARCH_DRIVER_H */