1 /* Definitions of target machine of Andes NDS32 cpu for GNU compiler
2 Copyright (C) 2012-2024 Free Software Foundation, Inc.
3 Contributed by Andes Technology Corporation.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published
9 by the Free Software Foundation; either version 3, or (at your
10 option) any later version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 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 /* ------------------------------------------------------------------------ */
24 #define TARGET_LINUX_ABI 1
27 #define SIZE_TYPE "unsigned int"
30 #define PTRDIFF_TYPE "int"
32 #define TARGET_OS_CPP_BUILTINS() \
35 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
39 #ifdef TARGET_BIG_ENDIAN_DEFAULT
40 #define LD_SO_ENDIAN_SPEC "%{mlittle-endian:le}%{!mlittle-endian:be}"
42 #define LD_SO_ENDIAN_SPEC "%{mbig-endian:be}%{!mbig-endian:le}"
45 /* Record arch version in TARGET_ARCH_DEFAULT.
47 1 means hard ABI and using full floating-point instruction;
48 2 means hard ABI and only using single-precision floating-point
50 #if TARGET_ARCH_DEFAULT
51 #define LD_SO_ABI_SPEC "%{!mabi=2:f}"
53 #define LD_SO_ABI_SPEC "%{mabi=2fp+:f}"
56 #define GLIBC_DYNAMIC_LINKER \
57 "/lib/ld-linux-nds32" LD_SO_ENDIAN_SPEC LD_SO_ABI_SPEC ".so.1"
59 /* In the configure stage we may use options --enable-default-relax,
60 --enable-Os-default-ifc and --enable-Os-default-ex9. They effect
61 the default spec of passing --relax, --mifc, and --mex9 to linker.
62 We use NDS32_RELAX_SPEC, NDS32_IFC_SPEC, and NDS32_EX9_SPEC
63 so that we can customize them conveniently. */
66 " %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
70 %{rdynamic:-export-dynamic} \
71 -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
75 #define LINK_PIE_SPEC "%{pie:%{!fno-pie:%{!fno-PIE:%{!static:-pie}}}} "
77 #define CPP_SPEC "%{pthread:-D_REENTRANT}"
79 /* The SYNC operations are implemented as library functions, not
80 INSN patterns. As a result, the HAVE defines for the patterns are
81 not defined. We need to define them to generate the corresponding
82 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* and __GCC_ATOMIC_*_LOCK_FREE
84 Ref: https://sourceware.org/ml/libc-alpha/2014-09/msg00322.html */
85 #define HAVE_sync_compare_and_swapqi 1
86 #define HAVE_sync_compare_and_swaphi 1
87 #define HAVE_sync_compare_and_swapsi 1