annotate gcc/config/arc/arc.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents: 67
diff changeset
1 /* Definitions of target machine for GNU compiler, Synopsys DesignWare ARC cpu.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 1994-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
111
kono
parents: 67
diff changeset
20 #ifndef GCC_ARC_H
kono
parents: 67
diff changeset
21 #define GCC_ARC_H
kono
parents: 67
diff changeset
22
kono
parents: 67
diff changeset
23 #include <stdbool.h>
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 /* Things to do:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 - incscc, decscc?
111
kono
parents: 67
diff changeset
28
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
111
kono
parents: 67
diff changeset
31 #define SYMBOL_FLAG_SHORT_CALL (SYMBOL_FLAG_MACH_DEP << 0)
kono
parents: 67
diff changeset
32 #define SYMBOL_FLAG_MEDIUM_CALL (SYMBOL_FLAG_MACH_DEP << 1)
kono
parents: 67
diff changeset
33 #define SYMBOL_FLAG_LONG_CALL (SYMBOL_FLAG_MACH_DEP << 2)
kono
parents: 67
diff changeset
34 #define SYMBOL_FLAG_CMEM (SYMBOL_FLAG_MACH_DEP << 3)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
111
kono
parents: 67
diff changeset
36 #ifndef TARGET_CPU_DEFAULT
kono
parents: 67
diff changeset
37 #define TARGET_CPU_DEFAULT PROCESSOR_arc700
kono
parents: 67
diff changeset
38 #endif
kono
parents: 67
diff changeset
39
kono
parents: 67
diff changeset
40 /* Check if this symbol has a long_call attribute in its declaration */
kono
parents: 67
diff changeset
41 #define SYMBOL_REF_LONG_CALL_P(X) \
kono
parents: 67
diff changeset
42 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_LONG_CALL) != 0)
kono
parents: 67
diff changeset
43
kono
parents: 67
diff changeset
44 /* Check if this symbol has a medium_call attribute in its declaration */
kono
parents: 67
diff changeset
45 #define SYMBOL_REF_MEDIUM_CALL_P(X) \
kono
parents: 67
diff changeset
46 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_MEDIUM_CALL) != 0)
kono
parents: 67
diff changeset
47
kono
parents: 67
diff changeset
48 /* Check if this symbol has a short_call attribute in its declaration */
kono
parents: 67
diff changeset
49 #define SYMBOL_REF_SHORT_CALL_P(X) \
kono
parents: 67
diff changeset
50 ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SHORT_CALL) != 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 /* Names to predefine in the preprocessor for this target machine. */
111
kono
parents: 67
diff changeset
53 #define TARGET_CPU_CPP_BUILTINS() arc_cpu_cpp_builtins (pfile)
kono
parents: 67
diff changeset
54
kono
parents: 67
diff changeset
55 /* Macros enabled by specific command line option. FIXME: to be
kono
parents: 67
diff changeset
56 deprecatd. */
kono
parents: 67
diff changeset
57 #define CPP_SPEC "\
kono
parents: 67
diff changeset
58 %{msimd:-D__Xsimd} %{mno-mpy:-D__Xno_mpy} %{mswap:-D__Xswap} \
kono
parents: 67
diff changeset
59 %{mmin-max:-D__Xmin_max} %{mEA:-D__Xea} \
kono
parents: 67
diff changeset
60 %{mspfp*:-D__Xspfp} %{mdpfp*:-D__Xdpfp} \
kono
parents: 67
diff changeset
61 %{mmac-d16:-D__Xxmac_d16} %{mmac-24:-D__Xxmac_24} \
kono
parents: 67
diff changeset
62 %{mdsp-packa:-D__Xdsp_packa} %{mcrc:-D__Xcrc} %{mdvbf:-D__Xdvbf} \
kono
parents: 67
diff changeset
63 %{mtelephony:-D__Xtelephony} %{mxy:-D__Xxy} %{mmul64: -D__Xmult32} \
kono
parents: 67
diff changeset
64 %{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc} \
kono
parents: 67
diff changeset
65 %(subtarget_cpp_spec)"
kono
parents: 67
diff changeset
66
kono
parents: 67
diff changeset
67 #undef CC1_SPEC
kono
parents: 67
diff changeset
68 #define CC1_SPEC "%{EB:%{EL:%emay not use both -EB and -EL}} \
kono
parents: 67
diff changeset
69 %{EB:-mbig-endian} %{EL:-mlittle-endian} \
kono
parents: 67
diff changeset
70 %{G*} \
kono
parents: 67
diff changeset
71 "
kono
parents: 67
diff changeset
72 extern const char *arc_cpu_to_as (int argc, const char **argv);
kono
parents: 67
diff changeset
73
kono
parents: 67
diff changeset
74 #define EXTRA_SPEC_FUNCTIONS \
kono
parents: 67
diff changeset
75 { "cpu_to_as", arc_cpu_to_as },
kono
parents: 67
diff changeset
76
kono
parents: 67
diff changeset
77 /* This macro defines names of additional specifications to put in the specs
kono
parents: 67
diff changeset
78 that can be used in various specifications like CC1_SPEC. Its definition
kono
parents: 67
diff changeset
79 is an initializer with a subgrouping for each command option.
kono
parents: 67
diff changeset
80
kono
parents: 67
diff changeset
81 Each subgrouping contains a string constant, that defines the
kono
parents: 67
diff changeset
82 specification name, and a string constant that used by the GCC driver
kono
parents: 67
diff changeset
83 program.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
111
kono
parents: 67
diff changeset
85 Do not define this macro if it does not need to do anything. */
kono
parents: 67
diff changeset
86 #define EXTRA_SPECS \
kono
parents: 67
diff changeset
87 { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, \
kono
parents: 67
diff changeset
88 SUBTARGET_EXTRA_SPECS
kono
parents: 67
diff changeset
89
kono
parents: 67
diff changeset
90 #ifndef SUBTARGET_EXTRA_SPECS
kono
parents: 67
diff changeset
91 #define SUBTARGET_EXTRA_SPECS
kono
parents: 67
diff changeset
92 #endif
kono
parents: 67
diff changeset
93
kono
parents: 67
diff changeset
94 #ifndef SUBTARGET_CPP_SPEC
kono
parents: 67
diff changeset
95 #define SUBTARGET_CPP_SPEC ""
kono
parents: 67
diff changeset
96 #endif
kono
parents: 67
diff changeset
97
kono
parents: 67
diff changeset
98 #undef ASM_SPEC
kono
parents: 67
diff changeset
99 #define ASM_SPEC "%{mbig-endian|EB:-EB} %{EL} " \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
100 "%:cpu_to_as(%{mcpu=*:%*}) %{mspfp*} %{mdpfp*} " \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
101 "%{mfpu=fpuda*:-mfpuda} %{mcode-density}"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102
111
kono
parents: 67
diff changeset
103 #define OPTION_DEFAULT_SPECS \
kono
parents: 67
diff changeset
104 {"cpu", "%{!mcpu=*:%{!mARC*:%{!marc*:%{!mA7:%{!mA6:-mcpu=%(VALUE)}}}}}" }
kono
parents: 67
diff changeset
105
kono
parents: 67
diff changeset
106 #ifndef DRIVER_ENDIAN_SELF_SPECS
kono
parents: 67
diff changeset
107 #define DRIVER_ENDIAN_SELF_SPECS ""
kono
parents: 67
diff changeset
108 #endif
kono
parents: 67
diff changeset
109
kono
parents: 67
diff changeset
110 #define DRIVER_SELF_SPECS DRIVER_ENDIAN_SELF_SPECS \
kono
parents: 67
diff changeset
111 "%{mARC600|mA6: -mcpu=arc600 %<mARC600 %<mA6 %<mARC600}" \
kono
parents: 67
diff changeset
112 "%{mARC601: -mcpu=arc601 %<mARC601}" \
kono
parents: 67
diff changeset
113 "%{mARC700|mA7: -mcpu=arc700 %<mARC700 %<mA7}" \
kono
parents: 67
diff changeset
114 "%{mEA: -mea %<mEA}"
kono
parents: 67
diff changeset
115
kono
parents: 67
diff changeset
116 /* Run-time compilation parameters selecting different hardware subsets. */
kono
parents: 67
diff changeset
117
kono
parents: 67
diff changeset
118 #define TARGET_MIXED_CODE (TARGET_MIXED_CODE_SET)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119
111
kono
parents: 67
diff changeset
120 #define TARGET_SPFP (TARGET_SPFP_FAST_SET || TARGET_SPFP_COMPACT_SET)
kono
parents: 67
diff changeset
121 #define TARGET_DPFP (TARGET_DPFP_FAST_SET || TARGET_DPFP_COMPACT_SET \
kono
parents: 67
diff changeset
122 || TARGET_FP_DP_AX)
kono
parents: 67
diff changeset
123
kono
parents: 67
diff changeset
124 #define SUBTARGET_SWITCHES
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125
111
kono
parents: 67
diff changeset
126 /* Instruction set characteristics.
kono
parents: 67
diff changeset
127 These are internal macros, set by the appropriate -m option. */
kono
parents: 67
diff changeset
128
kono
parents: 67
diff changeset
129 /* Non-zero means the cpu supports norm instruction. This flag is set by
kono
parents: 67
diff changeset
130 default for A7, and only for pre A7 cores when -mnorm is given. */
kono
parents: 67
diff changeset
131 #define TARGET_NORM (TARGET_ARC700 || TARGET_NORM_SET || TARGET_HS)
kono
parents: 67
diff changeset
132 /* Indicate if an optimized floating point emulation library is available. */
kono
parents: 67
diff changeset
133 #define TARGET_OPTFPE (TARGET_ARC700 || TARGET_FPX_QUARK)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
134
111
kono
parents: 67
diff changeset
135 /* Non-zero means the cpu supports swap instruction. This flag is set by
kono
parents: 67
diff changeset
136 default for A7, and only for pre A7 cores when -mswap is given. */
kono
parents: 67
diff changeset
137 #define TARGET_SWAP (TARGET_ARC700 || TARGET_SWAP_SET)
kono
parents: 67
diff changeset
138
kono
parents: 67
diff changeset
139 /* Provide some macros for size / scheduling features of the ARC700, so
kono
parents: 67
diff changeset
140 that we can pick & choose features if we get a new cpu family member. */
kono
parents: 67
diff changeset
141
kono
parents: 67
diff changeset
142 /* Should we try to unalign likely taken branches without a delay slot. */
kono
parents: 67
diff changeset
143 #define TARGET_UNALIGN_BRANCH (TARGET_ARC700 && !optimize_size)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144
111
kono
parents: 67
diff changeset
145 /* Should we add padding before a return insn to avoid mispredict? */
kono
parents: 67
diff changeset
146 #define TARGET_PAD_RETURN (TARGET_ARC700 && !optimize_size)
kono
parents: 67
diff changeset
147
kono
parents: 67
diff changeset
148 /* For an anulled-true delay slot insn for a delayed branch, should we only
kono
parents: 67
diff changeset
149 use conditional execution? */
kono
parents: 67
diff changeset
150 #define TARGET_AT_DBR_CONDEXEC (!TARGET_ARC700 && !TARGET_V2)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151
111
kono
parents: 67
diff changeset
152 #define TARGET_ARC600 ((arc_selected_cpu->arch_info->arch_id \
kono
parents: 67
diff changeset
153 == BASE_ARCH_6xx) \
kono
parents: 67
diff changeset
154 && (TARGET_BARREL_SHIFTER))
kono
parents: 67
diff changeset
155 #define TARGET_ARC601 ((arc_selected_cpu->arch_info->arch_id \
kono
parents: 67
diff changeset
156 == BASE_ARCH_6xx) \
kono
parents: 67
diff changeset
157 && (!TARGET_BARREL_SHIFTER))
kono
parents: 67
diff changeset
158 #define TARGET_ARC700 (arc_selected_cpu->arch_info->arch_id \
kono
parents: 67
diff changeset
159 == BASE_ARCH_700)
kono
parents: 67
diff changeset
160 /* An NPS400 is a specialisation of ARC700, so it is correct for NPS400
kono
parents: 67
diff changeset
161 TARGET_ARC700 is true, and TARGET_NPS400 is true. */
kono
parents: 67
diff changeset
162 #define TARGET_NPS400 ((arc_selected_cpu->arch_info->arch_id \
kono
parents: 67
diff changeset
163 == BASE_ARCH_700) \
kono
parents: 67
diff changeset
164 && (arc_selected_cpu->processor \
kono
parents: 67
diff changeset
165 == PROCESSOR_nps400))
kono
parents: 67
diff changeset
166 #define TARGET_EM (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_em)
kono
parents: 67
diff changeset
167 #define TARGET_HS (arc_selected_cpu->arch_info->arch_id == BASE_ARCH_hs)
kono
parents: 67
diff changeset
168 #define TARGET_V2 (TARGET_EM || TARGET_HS)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169
111
kono
parents: 67
diff changeset
170 #ifndef UNALIGNED_ACCESS_DEFAULT
kono
parents: 67
diff changeset
171 #define UNALIGNED_ACCESS_DEFAULT 0
kono
parents: 67
diff changeset
172 #endif
kono
parents: 67
diff changeset
173
kono
parents: 67
diff changeset
174 #ifndef TARGET_NPS_BITOPS_DEFAULT
kono
parents: 67
diff changeset
175 #define TARGET_NPS_BITOPS_DEFAULT 0
kono
parents: 67
diff changeset
176 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177
111
kono
parents: 67
diff changeset
178 #ifndef TARGET_NPS_CMEM_DEFAULT
kono
parents: 67
diff changeset
179 #define TARGET_NPS_CMEM_DEFAULT 0
kono
parents: 67
diff changeset
180 #endif
kono
parents: 67
diff changeset
181
kono
parents: 67
diff changeset
182 /* Enable the RRQ instruction alternatives. */
kono
parents: 67
diff changeset
183
kono
parents: 67
diff changeset
184 #define TARGET_RRQ_CLASS TARGET_NPS_BITOPS
kono
parents: 67
diff changeset
185
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 /* Target machine storage layout. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187
111
kono
parents: 67
diff changeset
188 /* We want zero_extract to mean the same
kono
parents: 67
diff changeset
189 no matter what the byte endianness is. */
kono
parents: 67
diff changeset
190 #define BITS_BIG_ENDIAN 0
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 /* Define this if most significant byte of a word is the lowest numbered. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 #define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 /* Define this if most significant word of a multiword number is the lowest
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 numbered. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 #define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198
111
kono
parents: 67
diff changeset
199 /* Width in bits of a "word", which is the contents of a machine register.
kono
parents: 67
diff changeset
200 Note that this is not necessarily the width of data type `int';
kono
parents: 67
diff changeset
201 if using 16-bit ints on a 68000, this would still be 32.
kono
parents: 67
diff changeset
202 But on a machine with 16-bit registers, this would be 16. */
kono
parents: 67
diff changeset
203 #define BITS_PER_WORD 32
kono
parents: 67
diff changeset
204
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 /* Width of a word, in units (bytes). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 #define UNITS_PER_WORD 4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 /* Define this macro if it is advisable to hold scalars in registers
111
kono
parents: 67
diff changeset
209 in a wider mode than that declared by the program. In such cases,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 the value is constrained to be within the bounds of the declared
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 type, but kept valid in the wider mode. The signedness of the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 extension may differ from that of the type. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 if (GET_MODE_CLASS (MODE) == MODE_INT \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 { \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 (MODE) = SImode; \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219
111
kono
parents: 67
diff changeset
220 /* Width in bits of a pointer.
kono
parents: 67
diff changeset
221 See also the macro `Pmode' defined below. */
kono
parents: 67
diff changeset
222 #define POINTER_SIZE 32
kono
parents: 67
diff changeset
223
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 /* Allocation boundary (in *bits*) for storing arguments in argument list. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 #define PARM_BOUNDARY 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 /* Boundary (in *bits*) on which stack pointer should be aligned. */
111
kono
parents: 67
diff changeset
228 /* TOCHECK: Changed from 64 to 32 */
kono
parents: 67
diff changeset
229 #define STACK_BOUNDARY 32
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230
111
kono
parents: 67
diff changeset
231 /* ALIGN FRAMES on word boundaries. */
kono
parents: 67
diff changeset
232 #define ARC_STACK_ALIGN(LOC) \
kono
parents: 67
diff changeset
233 (((LOC) + STACK_BOUNDARY / BITS_PER_UNIT - 1) & -STACK_BOUNDARY/BITS_PER_UNIT)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 /* Allocation boundary (in *bits*) for the code of a function. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 #define FUNCTION_BOUNDARY 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 /* Alignment of field after `int : 0' in a structure. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 #define EMPTY_FIELD_BOUNDARY 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 /* Every structure's size must be a multiple of this. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 #define STRUCTURE_SIZE_BOUNDARY 8
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243
111
kono
parents: 67
diff changeset
244 /* A bitfield declared as `int' forces `int' alignment for the struct. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 #define PCC_BITFIELD_TYPE_MATTERS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246
111
kono
parents: 67
diff changeset
247 /* An expression for the alignment of a structure field FIELD if the
kono
parents: 67
diff changeset
248 alignment computed in the usual way (including applying of
kono
parents: 67
diff changeset
249 `BIGGEST_ALIGNMENT' and `BIGGEST_FIELD_ALIGNMENT' to the
kono
parents: 67
diff changeset
250 alignment) is COMPUTED. It overrides alignment only if the field
kono
parents: 67
diff changeset
251 alignment has not been set by the `__attribute__ ((aligned (N)))'
kono
parents: 67
diff changeset
252 construct.
kono
parents: 67
diff changeset
253 */
kono
parents: 67
diff changeset
254
kono
parents: 67
diff changeset
255 #define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \
kono
parents: 67
diff changeset
256 (TYPE_MODE (strip_array_types (TYPE)) == DFmode \
kono
parents: 67
diff changeset
257 ? MIN ((COMPUTED), 32) : (COMPUTED))
kono
parents: 67
diff changeset
258
kono
parents: 67
diff changeset
259
kono
parents: 67
diff changeset
260
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 /* No data type wants to be aligned rounder than this. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 /* This is bigger than currently necessary for the ARC. If 8 byte floats are
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 ever added it's not clear whether they'll need such alignment or not. For
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 now we assume they will. We can always relax it if necessary but the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 reverse isn't true. */
111
kono
parents: 67
diff changeset
266 /* TOCHECK: Changed from 64 to 32 */
kono
parents: 67
diff changeset
267 #define BIGGEST_ALIGNMENT 32
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 /* The best alignment to use in cases where we have a choice. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 #define FASTEST_ALIGNMENT 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271
111
kono
parents: 67
diff changeset
272 /* Make arrays of chars word-aligned for the same reasons. */
kono
parents: 67
diff changeset
273 #define LOCAL_ALIGNMENT(TYPE, ALIGN) \
kono
parents: 67
diff changeset
274 (TREE_CODE (TYPE) == ARRAY_TYPE \
kono
parents: 67
diff changeset
275 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
kono
parents: 67
diff changeset
276 && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 #define DATA_ALIGNMENT(TYPE, ALIGN) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 (TREE_CODE (TYPE) == ARRAY_TYPE \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
111
kono
parents: 67
diff changeset
281 && arc_size_opt_level < 3 \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 /* Set this nonzero if move instructions will actually fail to work
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 when given unaligned data. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 /* On the ARC the lower address bits are masked to 0 as necessary. The chip
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 won't croak when given an unaligned address, but the insn will still fail
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 to produce the correct result. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
289 #define STRICT_ALIGNMENT (!unaligned_access)
111
kono
parents: 67
diff changeset
290
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 /* Layout of source language data types. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 #define SHORT_TYPE_SIZE 16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 #define INT_TYPE_SIZE 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 #define LONG_TYPE_SIZE 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 #define LONG_LONG_TYPE_SIZE 64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 #define FLOAT_TYPE_SIZE 32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 #define DOUBLE_TYPE_SIZE 64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 #define LONG_DOUBLE_TYPE_SIZE 64
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 /* Define this as 1 if `char' should by default be signed; else as 0. */
111
kono
parents: 67
diff changeset
302 #define DEFAULT_SIGNED_CHAR 0
kono
parents: 67
diff changeset
303
kono
parents: 67
diff changeset
304 #undef SIZE_TYPE
kono
parents: 67
diff changeset
305 #define SIZE_TYPE "unsigned int"
kono
parents: 67
diff changeset
306
kono
parents: 67
diff changeset
307 #undef PTRDIFF_TYPE
kono
parents: 67
diff changeset
308 #define PTRDIFF_TYPE "int"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309
111
kono
parents: 67
diff changeset
310 #undef WCHAR_TYPE
kono
parents: 67
diff changeset
311 #define WCHAR_TYPE "int"
kono
parents: 67
diff changeset
312
kono
parents: 67
diff changeset
313 #undef WCHAR_TYPE_SIZE
kono
parents: 67
diff changeset
314 #define WCHAR_TYPE_SIZE 32
kono
parents: 67
diff changeset
315
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 /* Standard register usage. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 /* Number of actual hardware registers.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 The hardware registers are assigned numbers for the compiler
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 from 0 to just below FIRST_PSEUDO_REGISTER.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 All registers that the compiler knows about must be given numbers,
111
kono
parents: 67
diff changeset
322 even those that are not normally considered general registers.
kono
parents: 67
diff changeset
323
kono
parents: 67
diff changeset
324 Registers 61, 62, and 63 are not really registers and we needn't treat
kono
parents: 67
diff changeset
325 them as such. We still need a register for the condition code and
kono
parents: 67
diff changeset
326 argument pointer. */
kono
parents: 67
diff changeset
327
kono
parents: 67
diff changeset
328 /* r63 is pc, r64-r127 = simd vregs, r128-r143 = simd dma config regs
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
329 r144, r145 = ARG_POINTER, FRAME_POINTER
111
kono
parents: 67
diff changeset
330 and therefore the pseudo registers start from r146. */
kono
parents: 67
diff changeset
331 #define FIRST_PSEUDO_REGISTER 146
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 /* 1 for registers that have pervasive standard uses
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 and are not available for the register allocator.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 0-28 - general purpose registers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 29 - ilink1 (interrupt link register)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 30 - ilink2 (interrupt link register)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 31 - blink (branch link register)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 32-59 - reserved for extensions
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 60 - LP_COUNT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 61 - condition code
111
kono
parents: 67
diff changeset
343 62 - argument pointer
kono
parents: 67
diff changeset
344 63 - program counter
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345
111
kono
parents: 67
diff changeset
346 FWIW, this is how the 61-63 encodings are used by the hardware:
kono
parents: 67
diff changeset
347 61 - reserved
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 62 - long immediate data indicator
111
kono
parents: 67
diff changeset
349 63 - PCL (program counter aligned to 32 bit, read-only)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 The general purpose registers are further broken down into:
111
kono
parents: 67
diff changeset
352
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 0-7 - arguments/results
111
kono
parents: 67
diff changeset
354 8-12 - call used (r11 - static chain pointer)
kono
parents: 67
diff changeset
355 13-25 - call saved
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 26 - global pointer
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 27 - frame pointer
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 28 - stack pointer
111
kono
parents: 67
diff changeset
359 29 - ilink1
kono
parents: 67
diff changeset
360 30 - ilink2
kono
parents: 67
diff changeset
361 31 - return address register
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 By default, the extension registers are not available. */
111
kono
parents: 67
diff changeset
364 /* Present implementations only have VR0-VR23 only. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 #define FIXED_REGISTERS \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 { 0, 0, 0, 0, 0, 0, 0, 0, \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 0, 0, 0, 0, 0, 0, 0, 0, \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 0, 0, 0, 0, 0, 0, 0, 0, \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
369 0, 0, 1, 0, 1, 1, 1, 1, \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 1, 1, 1, 1, 1, 1, 1, 1, \
111
kono
parents: 67
diff changeset
372 0, 0, 0, 0, 1, 1, 1, 1, \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 1, 1, 1, 1, 1, 1, 1, 1, \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
374 1, 1, 1, 1, 1, 1, 1, 1, \
111
kono
parents: 67
diff changeset
375 \
kono
parents: 67
diff changeset
376 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
377 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
378 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
379 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
380 \
kono
parents: 67
diff changeset
381 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
382 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
383 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
384 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
385 \
kono
parents: 67
diff changeset
386 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
387 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
388 1, 1}
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 /* 1 for registers not available across function calls.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 These must include the FIXED_REGISTERS and also any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 registers that can be used without being saved.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 The latter must include the registers where values are returned
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 and the register where structure-value addresses are passed.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 Aside from that, you can include as many other registers as you like. */
111
kono
parents: 67
diff changeset
396 #define CALL_USED_REGISTERS \
kono
parents: 67
diff changeset
397 { \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 1, 1, 1, 1, 1, 1, 1, 1, \
111
kono
parents: 67
diff changeset
399 1, 1, 1, 1, 1, 0, 0, 0, \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 0, 0, 0, 0, 0, 0, 0, 0, \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
401 0, 0, 1, 0, 1, 1, 1, 1, \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 1, 1, 1, 1, 1, 1, 1, 1, \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 1, 1, 1, 1, 1, 1, 1, 1, \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 1, 1, 1, 1, 1, 1, 1, 1, \
111
kono
parents: 67
diff changeset
406 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
407 \
kono
parents: 67
diff changeset
408 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
409 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
410 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
411 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
412 \
kono
parents: 67
diff changeset
413 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
414 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
415 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
416 1, 1, 1, 1, 1, 1, 1, 1, \
kono
parents: 67
diff changeset
417 \
kono
parents: 67
diff changeset
418 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
419 0, 0, 0, 0, 0, 0, 0, 0, \
kono
parents: 67
diff changeset
420 1, 1}
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 /* If defined, an initializer for a vector of integers, containing the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 numbers of hard registers in the order in which GCC should
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 prefer to use them (from most preferred to least). */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
425 #define REG_ALLOC_ORDER \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
426 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
427 /* General registers. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
428 2, 3, 12, 13, 14, 15, 1, 0, 4, 5, 6, 7, 8, 9, 10, 11, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
429 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 30, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
430 /* Extension core registers. */ \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
432 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
433 /* VR regs. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
434 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
435 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
436 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
437 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
438 124, 125, 126, 127, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
439 /* DMA registers. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
440 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
441 142, 143, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
442 /* Register not used for general use. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
443 62, FRAME_POINTER_REGNUM, ARG_POINTER_REGNUM, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
444 SP_REG, ILINK1_REG, RETURN_ADDR_REGNUM, LP_COUNT, CC_REG, PCL_REG \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
445 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
446
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
447 /* Use different register alloc ordering for Thumb. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
448 #define ADJUST_REG_ALLOC_ORDER arc_adjust_reg_alloc_order ()
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
449
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
450 /* Tell IRA to use the order we define rather than messing it up with its
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
451 own cost calculations. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
452 #define HONOR_REG_ALLOC_ORDER 1
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453
111
kono
parents: 67
diff changeset
454 /* Internal macros to classify a register number as to whether it's a
kono
parents: 67
diff changeset
455 general purpose register for compact insns (r0-r3,r12-r15), or
kono
parents: 67
diff changeset
456 stack pointer (r28). */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457
111
kono
parents: 67
diff changeset
458 #define COMPACT_GP_REG_P(REGNO) \
kono
parents: 67
diff changeset
459 (((signed)(REGNO) >= 0 && (REGNO) <= 3) || ((REGNO) >= 12 && (REGNO) <= 15))
kono
parents: 67
diff changeset
460 #define SP_REG_P(REGNO) ((REGNO) == 28)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461
111
kono
parents: 67
diff changeset
462
kono
parents: 67
diff changeset
463
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 /* Register classes and constants. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 /* Define the classes of registers for register constraints in the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 machine description. Also define ranges of constants.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 One of the classes must always be named ALL_REGS and include all hard regs.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 If there is more than one class, another class must be named NO_REGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 and contain no registers.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 The name GENERAL_REGS must be the name of a class (or an alias for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 another name such as ALL_REGS). This is the class of registers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 that is allowed by "g" or "r" in a register constraint.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 Also, registers outside this class are allocated only when
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 instructions express preferences for them.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 The classes must be numbered in nondecreasing order; that is,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 a larger-numbered class must never be contained completely
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 in a smaller-numbered class.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 For any two classes, it is very desirable that there be another
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 class that represents their union.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 It is important that any condition codes have class NO_REGS.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 See `register_operand'. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488
111
kono
parents: 67
diff changeset
489 enum reg_class
kono
parents: 67
diff changeset
490 {
kono
parents: 67
diff changeset
491 NO_REGS,
kono
parents: 67
diff changeset
492 R0_REGS, /* 'x' */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
493 R0R1_CD_REGS, /* 'Rsd' */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
494 R0R3_CD_REGS, /* 'Rcd' */
111
kono
parents: 67
diff changeset
495 ARCOMPACT16_REGS, /* 'q' */
kono
parents: 67
diff changeset
496 SIBCALL_REGS, /* "Rsc" */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
497 AC16_H_REGS, /* 'h' */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
498 DOUBLE_REGS, /* 'D' */
111
kono
parents: 67
diff changeset
499 GENERAL_REGS, /* 'r' */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
500 SIMD_VR_REGS, /* 'v' */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
501 SIMD_DMA_CONFIG_REGS, /* 'd' */
111
kono
parents: 67
diff changeset
502 ALL_REGS,
kono
parents: 67
diff changeset
503 LIM_REG_CLASSES
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 #define N_REG_CLASSES (int) LIM_REG_CLASSES
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507
111
kono
parents: 67
diff changeset
508 /* Give names of register classes as strings for dump file. */
kono
parents: 67
diff changeset
509 #define REG_CLASS_NAMES \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
510 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
511 "NO_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
512 "R0_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
513 "R0R1_CD_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
514 "R0R3_CD_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
515 "ARCOMPACT16_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
516 "SIBCALL_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
517 "AC16_H_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
518 "DOUBLE_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
519 "GENERAL_REGS", \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
520 "SIMD_VR_REGS", \
111
kono
parents: 67
diff changeset
521 "SIMD_DMA_CONFIG_REGS", \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
522 "ALL_REGS" \
111
kono
parents: 67
diff changeset
523 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 /* Define which registers fit in which classes.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 This is an initializer for a vector of HARD_REG_SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 of length N_REG_CLASSES. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 #define REG_CLASS_CONTENTS \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
530 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
531 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* NO_REGS. */\
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
532 {0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'x'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
533 {0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'Rsd'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
534 {0x0000000f, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'Rcd'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
535 {0x0000f00f, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'q'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
536 {0x00001fff, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'Rsc'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
537 {0x9fffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, /* 'h'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
538 {0x00000000, 0x00000f00, 0x00000000, 0x00000000, 0x00000000}, /* 'D'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
539 {0xffffffff, 0x8fffffff, 0x00000000, 0x00000000, 0x00030000}, /* 'r'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
540 {0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000}, /* 'v'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
541 {0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000ffff}, /* 'd'. */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
542 {0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x0003ffff} /* ALL_REGS. */\
111
kono
parents: 67
diff changeset
543 }
kono
parents: 67
diff changeset
544
kono
parents: 67
diff changeset
545 /* Local macros to mark the first and last regs of different classes. */
kono
parents: 67
diff changeset
546 #define ARC_FIRST_SIMD_VR_REG 64
kono
parents: 67
diff changeset
547 #define ARC_LAST_SIMD_VR_REG 127
kono
parents: 67
diff changeset
548
kono
parents: 67
diff changeset
549 #define ARC_FIRST_SIMD_DMA_CONFIG_REG 128
kono
parents: 67
diff changeset
550 #define ARC_FIRST_SIMD_DMA_CONFIG_IN_REG 128
kono
parents: 67
diff changeset
551 #define ARC_FIRST_SIMD_DMA_CONFIG_OUT_REG 136
kono
parents: 67
diff changeset
552 #define ARC_LAST_SIMD_DMA_CONFIG_REG 143
kono
parents: 67
diff changeset
553
kono
parents: 67
diff changeset
554 /* ARCv2 double-register accumulator. */
kono
parents: 67
diff changeset
555 #define ACC_REG_FIRST 58
kono
parents: 67
diff changeset
556 #define ACC_REG_LAST 59
kono
parents: 67
diff changeset
557 #define ACCL_REGNO (TARGET_BIG_ENDIAN ? ACC_REG_FIRST + 1 : ACC_REG_FIRST)
kono
parents: 67
diff changeset
558 #define ACCH_REGNO (TARGET_BIG_ENDIAN ? ACC_REG_FIRST : ACC_REG_FIRST + 1)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 /* The same information, inverted:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 Return the class number of the smallest class containing
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562 reg number REGNO. This could be a conditional expression
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 or could index an array. */
111
kono
parents: 67
diff changeset
564
kono
parents: 67
diff changeset
565 extern enum reg_class arc_regno_reg_class[];
kono
parents: 67
diff changeset
566
kono
parents: 67
diff changeset
567 #define REGNO_REG_CLASS(REGNO) (arc_regno_reg_class[REGNO])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568
111
kono
parents: 67
diff changeset
569 /* The class value for valid index registers. An index register is
kono
parents: 67
diff changeset
570 one used in an address where its value is either multiplied by
kono
parents: 67
diff changeset
571 a scale factor or added to another register (as well as added to a
kono
parents: 67
diff changeset
572 displacement). */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573
111
kono
parents: 67
diff changeset
574 #define INDEX_REG_CLASS (TARGET_MIXED_CODE ? ARCOMPACT16_REGS : GENERAL_REGS)
kono
parents: 67
diff changeset
575
kono
parents: 67
diff changeset
576 /* The class value for valid base registers. A base register is one used in
kono
parents: 67
diff changeset
577 an address which is the register value plus a displacement. */
kono
parents: 67
diff changeset
578
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
579 #define BASE_REG_CLASS GENERAL_REGS
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 /* These assume that REGNO is a hard or pseudo reg number.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 They give nonzero only if REGNO is a hard reg of the suitable class
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583 or a pseudo reg currently allocated to a suitable hard reg.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584 Since they use reg_renumber, they are safe only once reg_renumber
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 has been allocated, which happens in local-alloc.c. */
111
kono
parents: 67
diff changeset
586 #define REGNO_OK_FOR_BASE_P(REGNO) \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
587 ((REGNO) < 29 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
588 || ((REGNO) == ARG_POINTER_REGNUM) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
589 || ((REGNO) == FRAME_POINTER_REGNUM) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
590 || ((REGNO) == PCL_REG) \
111
kono
parents: 67
diff changeset
591 || ((unsigned) reg_renumber[REGNO] < 29) \
kono
parents: 67
diff changeset
592 || ((unsigned) (REGNO) == (unsigned) arc_tp_regno) \
kono
parents: 67
diff changeset
593 || (fixed_regs[REGNO] == 0 && IN_RANGE (REGNO, 32, 59)) \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
594 || (fixed_regs[REGNO] == 0 && (REGNO) == R30_REG))
111
kono
parents: 67
diff changeset
595
kono
parents: 67
diff changeset
596 #define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)
kono
parents: 67
diff changeset
597
kono
parents: 67
diff changeset
598 /* Given an rtx X being reloaded into a reg required to be
kono
parents: 67
diff changeset
599 in class CLASS, return the class of reg to actually use.
kono
parents: 67
diff changeset
600 In general this is just CLASS; but on some machines
kono
parents: 67
diff changeset
601 in some cases it is preferable to use a more restrictive class. */
kono
parents: 67
diff changeset
602
kono
parents: 67
diff changeset
603 #define PREFERRED_RELOAD_CLASS(X, CLASS) \
kono
parents: 67
diff changeset
604 arc_preferred_reload_class((X), (CLASS))
kono
parents: 67
diff changeset
605
kono
parents: 67
diff changeset
606 extern enum reg_class arc_preferred_reload_class (rtx, enum reg_class);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 /* Return the maximum number of consecutive registers
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 needed to represent mode MODE in a register of class CLASS. */
111
kono
parents: 67
diff changeset
610
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 #define CLASS_MAX_NREGS(CLASS, MODE) \
111
kono
parents: 67
diff changeset
612 (( GET_MODE_SIZE (MODE) == 16 && CLASS == SIMD_VR_REGS) ? 1: \
kono
parents: 67
diff changeset
613 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
614
111
kono
parents: 67
diff changeset
615 #define SMALL_INT(X) ((unsigned) ((X) + 0x100) < 0x200)
kono
parents: 67
diff changeset
616 #define SMALL_INT_RANGE(X, OFFSET, SHIFT) \
kono
parents: 67
diff changeset
617 ((unsigned) (((X) >> (SHIFT)) + 0x100) \
kono
parents: 67
diff changeset
618 < 0x200 - ((unsigned) (OFFSET) >> (SHIFT)))
kono
parents: 67
diff changeset
619 #define SIGNED_INT12(X) ((unsigned) ((X) + 0x800) < 0x1000)
kono
parents: 67
diff changeset
620 #define SIGNED_INT16(X) ((unsigned) ((X) + 0x8000) < 0x10000)
kono
parents: 67
diff changeset
621 #define LARGE_INT(X) \
kono
parents: 67
diff changeset
622 (((X) < 0) \
kono
parents: 67
diff changeset
623 ? (X) >= (-(HOST_WIDE_INT) 0x7fffffff - 1) \
kono
parents: 67
diff changeset
624 : (unsigned HOST_WIDE_INT) (X) <= (unsigned HOST_WIDE_INT) 0xffffffff)
kono
parents: 67
diff changeset
625 #define UNSIGNED_INT3(X) ((unsigned) (X) < 0x8)
kono
parents: 67
diff changeset
626 #define UNSIGNED_INT5(X) ((unsigned) (X) < 0x20)
kono
parents: 67
diff changeset
627 #define UNSIGNED_INT6(X) ((unsigned) (X) < 0x40)
kono
parents: 67
diff changeset
628 #define UNSIGNED_INT7(X) ((unsigned) (X) < 0x80)
kono
parents: 67
diff changeset
629 #define UNSIGNED_INT8(X) ((unsigned) (X) < 0x100)
kono
parents: 67
diff changeset
630 #define UNSIGNED_INT12(X) ((unsigned) (X) < 0x800)
kono
parents: 67
diff changeset
631 #define UNSIGNED_INT16(X) ((unsigned) (X) < 0x10000)
kono
parents: 67
diff changeset
632 #define IS_ONE(X) ((X) == 1)
kono
parents: 67
diff changeset
633 #define IS_ZERO(X) ((X) == 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
635 /* Stack layout and stack pointer usage. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
636
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
637 /* Define this macro if pushing a word onto the stack moves the stack
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 pointer to a smaller address. */
111
kono
parents: 67
diff changeset
639 #define STACK_GROWS_DOWNWARD 1
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640
111
kono
parents: 67
diff changeset
641 /* Define this if the nominal address of the stack frame
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 is at the high-address end of the local variables;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 that is, each additional local variable allocated
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 goes at a more negative offset in the frame. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 #define FRAME_GROWS_DOWNWARD 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 /* Offset from the stack pointer register to the first location at which
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 outgoing arguments are placed. */
111
kono
parents: 67
diff changeset
649 #define STACK_POINTER_OFFSET (0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 /* Offset of first parameter from the argument pointer register value. */
111
kono
parents: 67
diff changeset
652 #define FIRST_PARM_OFFSET(FNDECL) (0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 /* A C expression whose value is RTL representing the address in a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 stack frame where the pointer to the caller's frame is stored.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
656 Assume that FRAMEADDR is an RTL expression for the address of the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 stack frame itself.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659 If you don't define this macro, the default is to return the value
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 of FRAMEADDR--that is, the stack frame address is also the address
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 of the stack word that points to the previous frame. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
662 /* ??? unfinished */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 /*define DYNAMIC_CHAIN_ADDRESS (FRAMEADDR)*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665 /* A C expression whose value is RTL representing the value of the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 return address for the frame COUNT steps up from the current frame.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 FRAMEADDR is the frame pointer of the COUNT frame, or the frame
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668 pointer of the COUNT - 1 frame if `RETURN_ADDR_IN_PREVIOUS_FRAME'
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
669 is defined. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 /* The current return address is in r31. The return address of anything
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671 farther back is at [%fp,4]. */
111
kono
parents: 67
diff changeset
672
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 #define RETURN_ADDR_RTX(COUNT, FRAME) \
111
kono
parents: 67
diff changeset
674 arc_return_addr_rtx(COUNT,FRAME)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
675
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
676 /* Register to use for pushing function arguments. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 #define STACK_POINTER_REGNUM 28
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 /* Base register for access to local variables of the function. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
680 #define FRAME_POINTER_REGNUM 145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
681 #define HARD_FRAME_POINTER_REGNUM 27
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682
111
kono
parents: 67
diff changeset
683 /* Base register for access to arguments of the function. This register
kono
parents: 67
diff changeset
684 will be eliminated into either fp or sp. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
685 #define ARG_POINTER_REGNUM 144
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686
111
kono
parents: 67
diff changeset
687 #define RETURN_ADDR_REGNUM 31
kono
parents: 67
diff changeset
688
kono
parents: 67
diff changeset
689 /* TODO - check usage of STATIC_CHAIN_REGNUM with a testcase */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 /* Register in which static-chain is passed to a function. This must
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 not be a register used by the prologue. */
111
kono
parents: 67
diff changeset
692 #define STATIC_CHAIN_REGNUM 11
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 /* Function argument passing. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 /* If defined, the maximum amount of space required for outgoing
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 arguments will be computed and placed into the variable
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 `crtl->outgoing_args_size'. No space will be pushed
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 onto the stack for each call; instead, the function prologue should
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
700 increase the stack frame size by this amount. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 #define ACCUMULATE_OUTGOING_ARGS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 /* Define a data type for recording info about an argument list
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704 during the scan of that argument list. This data type should
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 hold all necessary information about the function itself
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706 and about the args processed so far, enough to enable macros
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707 such as FUNCTION_ARG to determine where the next arg should go. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708 #define CUMULATIVE_ARGS int
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 /* Initialize a variable CUM of type CUMULATIVE_ARGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 for a call to a function whose data type is FNTYPE.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
712 For a library call, FNTYPE is 0. */
111
kono
parents: 67
diff changeset
713 #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
kono
parents: 67
diff changeset
714 ((CUM) = 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
715
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 /* The number of registers used for parameter passing. Local to this file. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
717 #define MAX_ARC_PARM_REGS (TARGET_RF16 ? 4 : 8)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
718
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
719 /* 1 if N is a possible register number for function argument passing. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
720 #define FUNCTION_ARG_REGNO_P(N) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
721 ((unsigned) (N) < MAX_ARC_PARM_REGS)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
722
111
kono
parents: 67
diff changeset
723 /* The ROUND_ADVANCE* macros are local to this file. */
kono
parents: 67
diff changeset
724 /* Round SIZE up to a word boundary. */
kono
parents: 67
diff changeset
725 #define ROUND_ADVANCE(SIZE) \
kono
parents: 67
diff changeset
726 (((SIZE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
kono
parents: 67
diff changeset
727
kono
parents: 67
diff changeset
728 /* Round arg MODE/TYPE up to the next word boundary. */
kono
parents: 67
diff changeset
729 #define ROUND_ADVANCE_ARG(MODE, TYPE) \
kono
parents: 67
diff changeset
730 ((MODE) == BLKmode \
kono
parents: 67
diff changeset
731 ? ROUND_ADVANCE (int_size_in_bytes (TYPE)) \
kono
parents: 67
diff changeset
732 : ROUND_ADVANCE (GET_MODE_SIZE (MODE)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
733
111
kono
parents: 67
diff changeset
734 #define ARC_FUNCTION_ARG_BOUNDARY(MODE,TYPE) PARM_BOUNDARY
kono
parents: 67
diff changeset
735 /* Round CUM up to the necessary point for argument MODE/TYPE. */
kono
parents: 67
diff changeset
736 /* N.B. Vectors have alignment exceeding BIGGEST_ALIGNMENT.
kono
parents: 67
diff changeset
737 ARC_FUNCTION_ARG_BOUNDARY reduces this to no more than 32 bit. */
kono
parents: 67
diff changeset
738 #define ROUND_ADVANCE_CUM(CUM, MODE, TYPE) \
kono
parents: 67
diff changeset
739 ((((CUM) - 1) | (ARC_FUNCTION_ARG_BOUNDARY ((MODE), (TYPE)) - 1)/BITS_PER_WORD)\
kono
parents: 67
diff changeset
740 + 1)
kono
parents: 67
diff changeset
741
kono
parents: 67
diff changeset
742 /* Return boolean indicating arg of type TYPE and mode MODE will be passed in
kono
parents: 67
diff changeset
743 a reg. This includes arguments that have to be passed by reference as the
kono
parents: 67
diff changeset
744 pointer to them is passed in a reg if one is available (and that is what
kono
parents: 67
diff changeset
745 we're given).
kono
parents: 67
diff changeset
746 When passing arguments NAMED is always 1. When receiving arguments NAMED
kono
parents: 67
diff changeset
747 is 1 for each argument except the last in a stdarg/varargs function. In
kono
parents: 67
diff changeset
748 a stdarg function we want to treat the last named arg as named. In a
kono
parents: 67
diff changeset
749 varargs function we want to treat the last named arg (which is
kono
parents: 67
diff changeset
750 `__builtin_va_alist') as unnamed.
kono
parents: 67
diff changeset
751 This macro is only used in this file. */
kono
parents: 67
diff changeset
752 #define PASS_IN_REG_P(CUM, MODE, TYPE) \
kono
parents: 67
diff changeset
753 ((CUM) < MAX_ARC_PARM_REGS)
kono
parents: 67
diff changeset
754
kono
parents: 67
diff changeset
755
kono
parents: 67
diff changeset
756 /* Function results. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
757
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
758 /* Define how to find the value returned by a library function
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 assuming the value has mode MODE. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
760 #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
761
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
762 /* 1 if N is a possible register number for a function value
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
763 as seen by the caller. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
764 /* ??? What about r1 in DI/DF values. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
765 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
766
111
kono
parents: 67
diff changeset
767 /* Tell GCC to use RETURN_IN_MEMORY. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
768 #define DEFAULT_PCC_STRUCT_RETURN 0
111
kono
parents: 67
diff changeset
769
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
770 /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
771 the stack pointer does not matter. The value is tested only in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
772 functions that have frame pointers.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
773 No definition is equivalent to always zero. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
774 #define EXIT_IGNORE_STACK 0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
775
111
kono
parents: 67
diff changeset
776 #define EPILOGUE_USES(REGNO) arc_epilogue_uses ((REGNO))
kono
parents: 67
diff changeset
777
kono
parents: 67
diff changeset
778 #define EH_USES(REGNO) arc_eh_uses((REGNO))
kono
parents: 67
diff changeset
779
kono
parents: 67
diff changeset
780 /* Definitions for register eliminations.
kono
parents: 67
diff changeset
781
kono
parents: 67
diff changeset
782 This is an array of structures. Each structure initializes one pair
kono
parents: 67
diff changeset
783 of eliminable registers. The "from" register number is given first,
kono
parents: 67
diff changeset
784 followed by "to". Eliminations of the same "from" register are listed
kono
parents: 67
diff changeset
785 in order of preference.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
786
111
kono
parents: 67
diff changeset
787 We have two registers that can be eliminated on the ARC. First, the
kono
parents: 67
diff changeset
788 argument pointer register can always be eliminated in favor of the stack
kono
parents: 67
diff changeset
789 pointer register or frame pointer register. Secondly, the frame pointer
kono
parents: 67
diff changeset
790 register can often be eliminated in favor of the stack pointer register.
kono
parents: 67
diff changeset
791 */
kono
parents: 67
diff changeset
792
kono
parents: 67
diff changeset
793 #define ELIMINABLE_REGS \
kono
parents: 67
diff changeset
794 {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
795 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
796 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
797 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
111
kono
parents: 67
diff changeset
798
kono
parents: 67
diff changeset
799 /* Define the offset between two registers, one to be eliminated, and the other
kono
parents: 67
diff changeset
800 its replacement, at the start of a routine. */
kono
parents: 67
diff changeset
801 extern int arc_initial_elimination_offset(int from, int to);
kono
parents: 67
diff changeset
802 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
kono
parents: 67
diff changeset
803 (OFFSET) = arc_initial_elimination_offset ((FROM), (TO))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
804
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
805 /* All the work done in PROFILE_HOOK, but still required. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
806 #undef FUNCTION_PROFILER
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
807 #define FUNCTION_PROFILER(STREAM, LABELNO) do { } while (0)
111
kono
parents: 67
diff changeset
808
kono
parents: 67
diff changeset
809 #define NO_PROFILE_COUNTERS 1
kono
parents: 67
diff changeset
810
kono
parents: 67
diff changeset
811 /* Trampolines. */
kono
parents: 67
diff changeset
812
kono
parents: 67
diff changeset
813 /* Length in units of the trampoline for entering a nested function. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
814 #define TRAMPOLINE_SIZE 16
111
kono
parents: 67
diff changeset
815
kono
parents: 67
diff changeset
816 /* Alignment required for a trampoline in bits . */
kono
parents: 67
diff changeset
817 /* For actual data alignment we just need 32, no more than the stack;
kono
parents: 67
diff changeset
818 however, to reduce cache coherency issues, we want to make sure that
kono
parents: 67
diff changeset
819 trampoline instructions always appear the same in any given cache line. */
kono
parents: 67
diff changeset
820 #define TRAMPOLINE_ALIGNMENT 256
kono
parents: 67
diff changeset
821
kono
parents: 67
diff changeset
822 /* Library calls. */
kono
parents: 67
diff changeset
823
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
824 /* Addressing modes, and classification of registers for them. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
825
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
826 /* Maximum number of registers that can appear in a valid memory address. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
827 /* The `ld' insn allows 2, but the `st' insn only allows 1. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
828 #define MAX_REGS_PER_ADDRESS 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
829
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
830 /* We have pre inc/dec (load/store with update). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
831 #define HAVE_PRE_INCREMENT 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
832 #define HAVE_PRE_DECREMENT 1
111
kono
parents: 67
diff changeset
833 #define HAVE_POST_INCREMENT 1
kono
parents: 67
diff changeset
834 #define HAVE_POST_DECREMENT 1
kono
parents: 67
diff changeset
835 #define HAVE_PRE_MODIFY_DISP 1
kono
parents: 67
diff changeset
836 #define HAVE_POST_MODIFY_DISP 1
kono
parents: 67
diff changeset
837 #define HAVE_PRE_MODIFY_REG 1
kono
parents: 67
diff changeset
838 #define HAVE_POST_MODIFY_REG 1
kono
parents: 67
diff changeset
839 /* ??? should also do PRE_MODIFY_REG / POST_MODIFY_REG, but that requires
kono
parents: 67
diff changeset
840 a special predicate for the memory operand of stores, like for the SH. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
841
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
842 /* Recognize any constant value that is a valid address. */
111
kono
parents: 67
diff changeset
843 #define CONSTANT_ADDRESS_P(X) \
kono
parents: 67
diff changeset
844 (flag_pic ? (arc_legitimate_pic_addr_p (X) || LABEL_P (X)): \
kono
parents: 67
diff changeset
845 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
kono
parents: 67
diff changeset
846 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
847
111
kono
parents: 67
diff changeset
848 /* Is the argument a const_int rtx, containing an exact power of 2 */
kono
parents: 67
diff changeset
849 #define IS_POWEROF2_P(X) (! ( (X) & ((X) - 1)) && (X))
kono
parents: 67
diff changeset
850 #define IS_POWEROF2_OR_0_P(X) (! ( (X) & ((X) - 1)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
851
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
852 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
853 and check its validity for a certain class.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
854 We have two alternate definitions for each of them.
111
kono
parents: 67
diff changeset
855 The *_NONSTRICT definition accepts all pseudo regs; the other rejects
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
856 them unless they have been allocated suitable hard regs.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
857
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
858 Most source files want to accept pseudo regs in the hope that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
859 they will get allocated to the class that the insn wants them to be in.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
860 Source files for reload pass need to be strict.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
861 After reload, it makes no difference, since pseudo regs have
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
862 been eliminated by then. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
863
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
864 /* Nonzero if X is a hard reg that can be used as an index
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
865 or if it is a pseudo reg. */
111
kono
parents: 67
diff changeset
866 #define REG_OK_FOR_INDEX_P_NONSTRICT(X) \
kono
parents: 67
diff changeset
867 ((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER \
kono
parents: 67
diff changeset
868 || REGNO_OK_FOR_BASE_P (REGNO (X)))
kono
parents: 67
diff changeset
869
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
870 /* Nonzero if X is a hard reg that can be used as a base reg
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
871 or if it is a pseudo reg. */
111
kono
parents: 67
diff changeset
872 #define REG_OK_FOR_BASE_P_NONSTRICT(X) \
kono
parents: 67
diff changeset
873 ((unsigned) REGNO (X) >= FIRST_PSEUDO_REGISTER \
kono
parents: 67
diff changeset
874 || REGNO_OK_FOR_BASE_P (REGNO (X)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
875
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
876 /* Nonzero if X is a hard reg that can be used as an index. */
111
kono
parents: 67
diff changeset
877 #define REG_OK_FOR_INDEX_P_STRICT(X) REGNO_OK_FOR_INDEX_P (REGNO (X))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
878 /* Nonzero if X is a hard reg that can be used as a base reg. */
111
kono
parents: 67
diff changeset
879 #define REG_OK_FOR_BASE_P_STRICT(X) REGNO_OK_FOR_BASE_P (REGNO (X))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
880
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
881 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
882 that is a valid memory address for an instruction.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
883 The MODE argument is the machine mode for the MEM expression
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
884 that wants to use this address. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
885 /* The `ld' insn allows [reg],[reg+shimm],[reg+limm],[reg+reg],[limm]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
886 but the `st' insn only allows [reg],[reg+shimm],[limm].
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
887 The only thing we can do is only allow the most strict case `st' and hope
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
888 other parts optimize out the restrictions for `ld'. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
889
111
kono
parents: 67
diff changeset
890 #define RTX_OK_FOR_BASE_P(X, STRICT) \
kono
parents: 67
diff changeset
891 (REG_P (X) \
kono
parents: 67
diff changeset
892 && ((STRICT) ? REG_OK_FOR_BASE_P_STRICT (X) : REG_OK_FOR_BASE_P_NONSTRICT (X)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
893
111
kono
parents: 67
diff changeset
894 #define RTX_OK_FOR_INDEX_P(X, STRICT) \
kono
parents: 67
diff changeset
895 (REG_P (X) \
kono
parents: 67
diff changeset
896 && ((STRICT) ? REG_OK_FOR_INDEX_P_STRICT (X) : REG_OK_FOR_INDEX_P_NONSTRICT (X)))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
897
111
kono
parents: 67
diff changeset
898 /* A C compound statement that attempts to replace X, which is an address
kono
parents: 67
diff changeset
899 that needs reloading, with a valid memory address for an operand of
kono
parents: 67
diff changeset
900 mode MODE. WIN is a C statement label elsewhere in the code.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
901
111
kono
parents: 67
diff changeset
902 We try to get a normal form
kono
parents: 67
diff changeset
903 of the address. That will allow inheritance of the address reloads. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
904
111
kono
parents: 67
diff changeset
905 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \
kono
parents: 67
diff changeset
906 do { \
kono
parents: 67
diff changeset
907 if (arc_legitimize_reload_address (&(X), (MODE), (OPNUM), (TYPE))) \
kono
parents: 67
diff changeset
908 goto WIN; \
kono
parents: 67
diff changeset
909 } while (0)
kono
parents: 67
diff changeset
910
kono
parents: 67
diff changeset
911 /* Reading lp_count for anything but the lp instruction is very slow on the
kono
parents: 67
diff changeset
912 ARC700. */
kono
parents: 67
diff changeset
913 #define DONT_REALLOC(REGNO,MODE) \
kono
parents: 67
diff changeset
914 (TARGET_ARC700 && (REGNO) == 60)
kono
parents: 67
diff changeset
915
kono
parents: 67
diff changeset
916
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
917 /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
918 return the mode to be used for the comparison. */
111
kono
parents: 67
diff changeset
919 /*extern machine_mode arc_select_cc_mode ();*/
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
920 #define SELECT_CC_MODE(OP, X, Y) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
921 arc_select_cc_mode (OP, X, Y)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
922
111
kono
parents: 67
diff changeset
923 /* Return non-zero if SELECT_CC_MODE will never return MODE for a
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
924 floating point inequality comparison. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
925 #define REVERSIBLE_CC_MODE(MODE) 1 /*???*/
111
kono
parents: 67
diff changeset
926
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
927 /* Costs. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
928
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
929 /* The cost of a branch insn. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
930 /* ??? What's the right value here? Branches are certainly more
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
931 expensive than reg->reg moves. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
932 #define BRANCH_COST(speed_p, predictable_p) 2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
933
111
kono
parents: 67
diff changeset
934 /* Scc sets the destination to 1 and then conditionally zeroes it.
kono
parents: 67
diff changeset
935 Best case, ORed SCCs can be made into clear - condset - condset.
kono
parents: 67
diff changeset
936 But it could also end up as five insns. So say it costs four on
kono
parents: 67
diff changeset
937 average.
kono
parents: 67
diff changeset
938 These extra instructions - and the second comparison - will also be
kono
parents: 67
diff changeset
939 an extra cost if the first comparison would have been decisive.
kono
parents: 67
diff changeset
940 So get an average saving, with a probability of the first branch
kono
parents: 67
diff changeset
941 beging decisive of p0, we want:
kono
parents: 67
diff changeset
942 p0 * (branch_cost - 4) > (1 - p0) * 5
kono
parents: 67
diff changeset
943 ??? We don't get to see that probability to evaluate, so we can
kono
parents: 67
diff changeset
944 only wildly guess that it might be 50%.
kono
parents: 67
diff changeset
945 ??? The compiler also lacks the notion of branch predictability. */
kono
parents: 67
diff changeset
946 #define LOGICAL_OP_NON_SHORT_CIRCUIT \
kono
parents: 67
diff changeset
947 (BRANCH_COST (optimize_function_for_speed_p (cfun), \
kono
parents: 67
diff changeset
948 false) > 9)
kono
parents: 67
diff changeset
949
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
950 /* Nonzero if access to memory by bytes is slow and undesirable.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
951 For RISC chips, it means that access to memory by bytes is no
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
952 better than access by words when possible, so grab a whole word
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
953 and maybe make use of that. */
111
kono
parents: 67
diff changeset
954 #define SLOW_BYTE_ACCESS 0
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
955
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
956 /* Define this macro if it is as good or better to call a constant
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
957 function address than to call an address kept in a register. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
958 /* On the ARC, calling through registers is slow. */
111
kono
parents: 67
diff changeset
959 #define NO_FUNCTION_CSE 1
kono
parents: 67
diff changeset
960
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
961 /* Section selection. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
962 /* WARNING: These section names also appear in dwarfout.c. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
963
111
kono
parents: 67
diff changeset
964 #define TEXT_SECTION_ASM_OP "\t.section\t.text"
kono
parents: 67
diff changeset
965 #define DATA_SECTION_ASM_OP "\t.section\t.data"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
966
111
kono
parents: 67
diff changeset
967 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
kono
parents: 67
diff changeset
968 #define SDATA_SECTION_ASM_OP "\t.section\t.sdata"
kono
parents: 67
diff changeset
969 #define SBSS_SECTION_ASM_OP "\t.section\t.sbss"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
970
111
kono
parents: 67
diff changeset
971 /* Expression whose value is a string, including spacing, containing the
kono
parents: 67
diff changeset
972 assembler operation to identify the following data as initialization/termination
kono
parents: 67
diff changeset
973 code. If not defined, GCC will assume such a section does not exist. */
kono
parents: 67
diff changeset
974 #define INIT_SECTION_ASM_OP "\t.section\t.init"
kono
parents: 67
diff changeset
975 #define FINI_SECTION_ASM_OP "\t.section\t.fini"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
976
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
977 /* Define this macro if jump tables (for tablejump insns) should be
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
978 output in the text section, along with the assembler instructions.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
979 Otherwise, the readonly data section is used.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
980 This macro is irrelevant if there is no separate readonly data section. */
111
kono
parents: 67
diff changeset
981 #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic || CASE_VECTOR_PC_RELATIVE)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
982
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
983 /* For DWARF. Marginally different than default so output is "prettier"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
984 (and consistent with above). */
111
kono
parents: 67
diff changeset
985 #define PUSHSECTION_FORMAT "\t%s %s\n"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
986
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
987 /* Tell crtstuff.c we're using ELF. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
988 #define OBJECT_FORMAT_ELF
111
kono
parents: 67
diff changeset
989
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
990 /* PIC */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
991
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
992 /* The register number of the register used to address a table of static
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
993 data addresses in memory. In some cases this register is defined by a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
994 processor's ``application binary interface'' (ABI). When this macro
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
995 is defined, RTL is generated for this register once, as with the stack
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
996 pointer and frame pointer registers. If this macro is not defined, it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
997 is up to the machine-dependent files to allocate such a register (if
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
998 necessary). */
111
kono
parents: 67
diff changeset
999 #define PIC_OFFSET_TABLE_REGNUM 26
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1000
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1001 /* Define this macro if the register defined by PIC_OFFSET_TABLE_REGNUM is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1002 clobbered by calls. Do not define this macro if PIC_OFFSET_TABLE_REGNUM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1003 is not defined. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1004 /* This register is call-saved on the ARC. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1005 /*#define PIC_OFFSET_TABLE_REG_CALL_CLOBBERED*/
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1006
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1007 /* A C expression that is nonzero if X is a legitimate immediate
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1008 operand on the target machine when generating position independent code.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1009 You can assume that X satisfies CONSTANT_P, so you need not
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1010 check this. You can also assume `flag_pic' is true, so you need not
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1011 check it either. You need not define this macro if all constants
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1012 (including SYMBOL_REF) can be immediate operands when generating
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1013 position independent code. */
111
kono
parents: 67
diff changeset
1014 #define LEGITIMATE_PIC_OPERAND_P(X) \
kono
parents: 67
diff changeset
1015 (!arc_raw_symbolic_reference_mentioned_p ((X), true))
kono
parents: 67
diff changeset
1016
kono
parents: 67
diff changeset
1017 /* PIC and small data don't mix on ARC because they use the same register. */
kono
parents: 67
diff changeset
1018 #define SDATA_BASE_REGNUM 26
kono
parents: 67
diff changeset
1019
kono
parents: 67
diff changeset
1020 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) \
kono
parents: 67
diff changeset
1021 (flag_pic \
kono
parents: 67
diff changeset
1022 ? (GLOBAL ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4 \
kono
parents: 67
diff changeset
1023 : DW_EH_PE_absptr)
kono
parents: 67
diff changeset
1024
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1025 /* Control the assembler format that we output. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1026
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1027 /* A C string constant describing how to begin a comment in the target
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1028 assembler language. The compiler assumes that the comment will
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1029 end at the end of the line. */
111
kono
parents: 67
diff changeset
1030 /* Gas needs this to be "#" in order to recognize line directives. */
kono
parents: 67
diff changeset
1031 #define ASM_COMMENT_START "#"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1032
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1033 /* Output to assembler file text saying following lines
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1034 may contain character constants, extra white space, comments, etc. */
111
kono
parents: 67
diff changeset
1035 #undef ASM_APP_ON
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1036 #define ASM_APP_ON ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1037
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1038 /* Output to assembler file text saying following lines
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1039 no longer contain unusual constructs. */
111
kono
parents: 67
diff changeset
1040 #undef ASM_APP_OFF
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1041 #define ASM_APP_OFF ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1042
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1043 /* Globalizing directive for a label. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1044 #define GLOBAL_ASM_OP "\t.global\t"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1045
111
kono
parents: 67
diff changeset
1046 /* This is how to output an assembler line defining a `char' constant. */
kono
parents: 67
diff changeset
1047 #define ASM_OUTPUT_CHAR(FILE, VALUE) \
kono
parents: 67
diff changeset
1048 ( fprintf (FILE, "\t.byte\t"), \
kono
parents: 67
diff changeset
1049 output_addr_const (FILE, (VALUE)), \
kono
parents: 67
diff changeset
1050 fprintf (FILE, "\n"))
kono
parents: 67
diff changeset
1051
kono
parents: 67
diff changeset
1052 /* This is how to output an assembler line defining a `short' constant. */
kono
parents: 67
diff changeset
1053 #define ASM_OUTPUT_SHORT(FILE, VALUE) \
kono
parents: 67
diff changeset
1054 ( fprintf (FILE, "\t.hword\t"), \
kono
parents: 67
diff changeset
1055 output_addr_const (FILE, (VALUE)), \
kono
parents: 67
diff changeset
1056 fprintf (FILE, "\n"))
kono
parents: 67
diff changeset
1057
kono
parents: 67
diff changeset
1058 /* This is how to output an assembler line defining an `int' constant.
kono
parents: 67
diff changeset
1059 We also handle symbol output here. Code addresses must be right shifted
kono
parents: 67
diff changeset
1060 by 2 because that's how the jump instruction wants them. */
kono
parents: 67
diff changeset
1061 #define ASM_OUTPUT_INT(FILE, VALUE) \
kono
parents: 67
diff changeset
1062 do { \
kono
parents: 67
diff changeset
1063 fprintf (FILE, "\t.word\t"); \
kono
parents: 67
diff changeset
1064 if (GET_CODE (VALUE) == LABEL_REF) \
kono
parents: 67
diff changeset
1065 { \
kono
parents: 67
diff changeset
1066 fprintf (FILE, "%%st(@"); \
kono
parents: 67
diff changeset
1067 output_addr_const (FILE, (VALUE)); \
kono
parents: 67
diff changeset
1068 fprintf (FILE, ")"); \
kono
parents: 67
diff changeset
1069 } \
kono
parents: 67
diff changeset
1070 else \
kono
parents: 67
diff changeset
1071 output_addr_const (FILE, (VALUE)); \
kono
parents: 67
diff changeset
1072 fprintf (FILE, "\n"); \
kono
parents: 67
diff changeset
1073 } while (0)
kono
parents: 67
diff changeset
1074
kono
parents: 67
diff changeset
1075 /* This is how to output an assembler line defining a `float' constant. */
kono
parents: 67
diff changeset
1076 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
kono
parents: 67
diff changeset
1077 { \
kono
parents: 67
diff changeset
1078 long t; \
kono
parents: 67
diff changeset
1079 char str[30]; \
kono
parents: 67
diff changeset
1080 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
kono
parents: 67
diff changeset
1081 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
kono
parents: 67
diff changeset
1082 fprintf (FILE, "\t.word\t0x%lx %s %s\n", \
kono
parents: 67
diff changeset
1083 t, ASM_COMMENT_START, str); \
kono
parents: 67
diff changeset
1084 }
kono
parents: 67
diff changeset
1085
kono
parents: 67
diff changeset
1086 /* This is how to output an assembler line defining a `double' constant. */
kono
parents: 67
diff changeset
1087 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
kono
parents: 67
diff changeset
1088 { \
kono
parents: 67
diff changeset
1089 long t[2]; \
kono
parents: 67
diff changeset
1090 char str[30]; \
kono
parents: 67
diff changeset
1091 REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \
kono
parents: 67
diff changeset
1092 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
kono
parents: 67
diff changeset
1093 fprintf (FILE, "\t.word\t0x%lx %s %s\n\t.word\t0x%lx\n", \
kono
parents: 67
diff changeset
1094 t[0], ASM_COMMENT_START, str, t[1]); \
kono
parents: 67
diff changeset
1095 }
kono
parents: 67
diff changeset
1096
kono
parents: 67
diff changeset
1097 /* This is how to output the definition of a user-level label named NAME,
kono
parents: 67
diff changeset
1098 such as the label on a static function or variable NAME. */
kono
parents: 67
diff changeset
1099 #define ASM_OUTPUT_LABEL(FILE, NAME) \
kono
parents: 67
diff changeset
1100 do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
kono
parents: 67
diff changeset
1101
kono
parents: 67
diff changeset
1102 #define ASM_NAME_P(NAME) ( NAME[0]=='*')
kono
parents: 67
diff changeset
1103
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1104 /* This is how to output a reference to a user-level label named NAME.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1105 `assemble_name' uses this. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1106 /* We work around a dwarfout.c deficiency by watching for labels from it and
111
kono
parents: 67
diff changeset
1107 not adding the '_' prefix. There is a comment in
kono
parents: 67
diff changeset
1108 dwarfout.c that says it should be using ASM_OUTPUT_INTERNAL_LABEL. */
kono
parents: 67
diff changeset
1109 #define ASM_OUTPUT_LABELREF(FILE, NAME1) \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1110 do { \
111
kono
parents: 67
diff changeset
1111 const char *NAME; \
kono
parents: 67
diff changeset
1112 NAME = (*targetm.strip_name_encoding)(NAME1); \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1113 if ((NAME)[0] == '.' && (NAME)[1] == 'L') \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1114 fprintf (FILE, "%s", NAME); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1115 else \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1116 { \
111
kono
parents: 67
diff changeset
1117 if (!ASM_NAME_P (NAME1)) \
kono
parents: 67
diff changeset
1118 fprintf (FILE, "%s", user_label_prefix); \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1119 fprintf (FILE, "%s", NAME); \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1120 } \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1121 } while (0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1122
111
kono
parents: 67
diff changeset
1123 /* This is how to output a reference to a symbol_ref / label_ref as
kono
parents: 67
diff changeset
1124 (part of) an operand. To disambiguate from register names like
kono
parents: 67
diff changeset
1125 a1 / a2 / status etc, symbols are preceded by '@'. */
kono
parents: 67
diff changeset
1126 #define ASM_OUTPUT_SYMBOL_REF(FILE,SYM) \
kono
parents: 67
diff changeset
1127 ASM_OUTPUT_LABEL_REF ((FILE), XSTR ((SYM), 0))
kono
parents: 67
diff changeset
1128 #define ASM_OUTPUT_LABEL_REF(FILE,STR) \
kono
parents: 67
diff changeset
1129 do \
kono
parents: 67
diff changeset
1130 { \
kono
parents: 67
diff changeset
1131 fputc ('@', file); \
kono
parents: 67
diff changeset
1132 assemble_name ((FILE), (STR)); \
kono
parents: 67
diff changeset
1133 } \
kono
parents: 67
diff changeset
1134 while (0)
kono
parents: 67
diff changeset
1135
kono
parents: 67
diff changeset
1136 /* Store in OUTPUT a string (made with alloca) containing
kono
parents: 67
diff changeset
1137 an assembler-name for a local static variable named NAME.
kono
parents: 67
diff changeset
1138 LABELNO is an integer which is different for each call. */
kono
parents: 67
diff changeset
1139 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
kono
parents: 67
diff changeset
1140 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \
kono
parents: 67
diff changeset
1141 sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))
kono
parents: 67
diff changeset
1142
kono
parents: 67
diff changeset
1143 /* The following macro defines the format used to output the second
kono
parents: 67
diff changeset
1144 operand of the .type assembler directive. Different svr4 assemblers
kono
parents: 67
diff changeset
1145 expect various different forms for this operand. The one given here
kono
parents: 67
diff changeset
1146 is just a default. You may need to override it in your machine-
kono
parents: 67
diff changeset
1147 specific tm.h file (depending upon the particulars of your assembler). */
kono
parents: 67
diff changeset
1148
kono
parents: 67
diff changeset
1149 #undef TYPE_OPERAND_FMT
kono
parents: 67
diff changeset
1150 #define TYPE_OPERAND_FMT "@%s"
kono
parents: 67
diff changeset
1151
kono
parents: 67
diff changeset
1152 /* A C string containing the appropriate assembler directive to
kono
parents: 67
diff changeset
1153 specify the size of a symbol, without any arguments. On systems
kono
parents: 67
diff changeset
1154 that use ELF, the default (in `config/elfos.h') is `"\t.size\t"';
kono
parents: 67
diff changeset
1155 on other systems, the default is not to define this macro. */
kono
parents: 67
diff changeset
1156 #undef SIZE_ASM_OP
kono
parents: 67
diff changeset
1157 #define SIZE_ASM_OP "\t.size\t"
kono
parents: 67
diff changeset
1158
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1159 /* Assembler pseudo-op to equate one value with another. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1160 /* ??? This is needed because dwarfout.c provides a default definition too
111
kono
parents: 67
diff changeset
1161 late for defaults.h (which contains the default definition of ASM_OTPUT_DEF
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1162 that we use). */
111
kono
parents: 67
diff changeset
1163 #ifdef SET_ASM_OP
kono
parents: 67
diff changeset
1164 #undef SET_ASM_OP
kono
parents: 67
diff changeset
1165 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1166 #define SET_ASM_OP "\t.set\t"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1167
111
kono
parents: 67
diff changeset
1168 extern char rname29[], rname30[];
kono
parents: 67
diff changeset
1169 extern char rname56[], rname57[], rname58[], rname59[];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1170 /* How to refer to registers in assembler output.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1171 This sequence is indexed by compiler's hard-register-number (see above). */
111
kono
parents: 67
diff changeset
1172 #define REGISTER_NAMES \
kono
parents: 67
diff changeset
1173 { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
kono
parents: 67
diff changeset
1174 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \
kono
parents: 67
diff changeset
1175 "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \
kono
parents: 67
diff changeset
1176 "r24", "r25", "gp", "fp", "sp", rname29, rname30, "blink", \
kono
parents: 67
diff changeset
1177 "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \
kono
parents: 67
diff changeset
1178 "d1", "d1", "d2", "d2", "r44", "r45", "r46", "r47", \
kono
parents: 67
diff changeset
1179 "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1180 rname56,rname57,rname58,rname59,"lp_count", "cc", "limm", "pcl", \
111
kono
parents: 67
diff changeset
1181 "vr0", "vr1", "vr2", "vr3", "vr4", "vr5", "vr6", "vr7", \
kono
parents: 67
diff changeset
1182 "vr8", "vr9", "vr10", "vr11", "vr12", "vr13", "vr14", "vr15", \
kono
parents: 67
diff changeset
1183 "vr16", "vr17", "vr18", "vr19", "vr20", "vr21", "vr22", "vr23", \
kono
parents: 67
diff changeset
1184 "vr24", "vr25", "vr26", "vr27", "vr28", "vr29", "vr30", "vr31", \
kono
parents: 67
diff changeset
1185 "vr32", "vr33", "vr34", "vr35", "vr36", "vr37", "vr38", "vr39", \
kono
parents: 67
diff changeset
1186 "vr40", "vr41", "vr42", "vr43", "vr44", "vr45", "vr46", "vr47", \
kono
parents: 67
diff changeset
1187 "vr48", "vr49", "vr50", "vr51", "vr52", "vr53", "vr54", "vr55", \
kono
parents: 67
diff changeset
1188 "vr56", "vr57", "vr58", "vr59", "vr60", "vr61", "vr62", "vr63", \
kono
parents: 67
diff changeset
1189 "dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7", \
kono
parents: 67
diff changeset
1190 "dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7", \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1191 "arg", "frame" \
111
kono
parents: 67
diff changeset
1192 }
kono
parents: 67
diff changeset
1193
kono
parents: 67
diff changeset
1194 #define ADDITIONAL_REGISTER_NAMES \
kono
parents: 67
diff changeset
1195 { \
kono
parents: 67
diff changeset
1196 {"ilink", 29}, \
kono
parents: 67
diff changeset
1197 {"r29", 29}, \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1198 {"r30", 30}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1199 {"r40", 40}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1200 {"r41", 41}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1201 {"r42", 42}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1202 {"r43", 43}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1203 {"r56", 56}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1204 {"r57", 57}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1205 {"r58", 58}, \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1206 {"r59", 59} \
111
kono
parents: 67
diff changeset
1207 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1208
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1209 /* Entry to the insn conditionalizer. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1210 #define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS) \
111
kono
parents: 67
diff changeset
1211 arc_final_prescan_insn (INSN, OPVEC, NOPERANDS)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1212
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1213 /* A C expression which evaluates to true if CODE is a valid
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1214 punctuation character for use in the `PRINT_OPERAND' macro. */
111
kono
parents: 67
diff changeset
1215 extern char arc_punct_chars[];
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1216 #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1217 arc_punct_chars[(unsigned char) (CHAR)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1218
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1219 /* Print operand X (an rtx) in assembler syntax to file FILE.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1220 CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1221 For `%' followed by punctuation, CODE is the punctuation and X is null. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1222 #define PRINT_OPERAND(FILE, X, CODE) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1223 arc_print_operand (FILE, X, CODE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1224
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1225 /* A C compound statement to output to stdio stream STREAM the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1226 assembler syntax for an instruction operand that is a memory
111
kono
parents: 67
diff changeset
1227 reference whose address is ADDR. ADDR is an RTL expression.
kono
parents: 67
diff changeset
1228
kono
parents: 67
diff changeset
1229 On some machines, the syntax for a symbolic address depends on
kono
parents: 67
diff changeset
1230 the section that the address refers to. On these machines,
kono
parents: 67
diff changeset
1231 define the macro `ENCODE_SECTION_INFO' to store the information
kono
parents: 67
diff changeset
1232 into the `symbol_ref', and then check for it here. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1233 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1234 arc_print_operand_address (FILE, ADDR)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1235
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1236 /* This is how to output an element of a case-vector that is absolute. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1237 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1238 do { \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1239 char label[30]; \
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1240 ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
111
kono
parents: 67
diff changeset
1241 fprintf (FILE, "\t.word "); \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1242 assemble_name (FILE, label); \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1243 fprintf (FILE, "\n"); \
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1244 } while (0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1245
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1246 /* This is how to output an element of a case-vector that is relative. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1247 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1248 do { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1249 char label[30]; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1250 ASM_GENERATE_INTERNAL_LABEL (label, "L", VALUE); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1251 if (!TARGET_BI_BIH) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1252 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1253 switch (GET_MODE (BODY)) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1254 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1255 case E_QImode: fprintf (FILE, "\t.byte "); break; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1256 case E_HImode: fprintf (FILE, "\t.hword "); break; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1257 case E_SImode: fprintf (FILE, "\t.word "); break; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1258 default: gcc_unreachable (); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1259 } \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1260 assemble_name (FILE, label); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1261 fprintf (FILE, "-"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1262 ASM_GENERATE_INTERNAL_LABEL (label, "L", REL); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1263 assemble_name (FILE, label); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1264 fprintf (FILE, "\n"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1265 } \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1266 else \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1267 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1268 switch (GET_MODE (BODY)) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1269 { \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1270 case E_SImode: fprintf (FILE, "\tb\t@"); break; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1271 case E_HImode: \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1272 case E_QImode: fprintf (FILE, "\tb_s\t@"); break; \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1273 default: gcc_unreachable (); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1274 } \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1275 assemble_name (FILE, label); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1276 fprintf(FILE, "\n"); \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1277 } \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1278 } while (0)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1279
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1280 /* Defined to also emit an .align in elfos.h. We don't want that. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1281 #undef ASM_OUTPUT_CASE_LABEL
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1282
111
kono
parents: 67
diff changeset
1283 /* ADDR_DIFF_VECs are in the text section and thus can affect the
kono
parents: 67
diff changeset
1284 current alignment. */
kono
parents: 67
diff changeset
1285 #define ASM_OUTPUT_CASE_END(FILE, NUM, JUMPTABLE) \
kono
parents: 67
diff changeset
1286 do \
kono
parents: 67
diff changeset
1287 { \
kono
parents: 67
diff changeset
1288 if (GET_CODE (PATTERN (JUMPTABLE)) == ADDR_DIFF_VEC \
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1289 && ((GET_MODE_SIZE (as_a <scalar_int_mode> \
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1290 (GET_MODE (PATTERN (JUMPTABLE)))) \
111
kono
parents: 67
diff changeset
1291 * XVECLEN (PATTERN (JUMPTABLE), 1) + 1) \
kono
parents: 67
diff changeset
1292 & 2)) \
kono
parents: 67
diff changeset
1293 arc_toggle_unalign (); \
kono
parents: 67
diff changeset
1294 } \
kono
parents: 67
diff changeset
1295 while (0)
kono
parents: 67
diff changeset
1296
kono
parents: 67
diff changeset
1297 #define JUMP_ALIGN(LABEL) (arc_size_opt_level < 2 ? 2 : 0)
kono
parents: 67
diff changeset
1298 #define LABEL_ALIGN_AFTER_BARRIER(LABEL) \
kono
parents: 67
diff changeset
1299 (JUMP_ALIGN(LABEL) \
kono
parents: 67
diff changeset
1300 ? JUMP_ALIGN(LABEL) \
kono
parents: 67
diff changeset
1301 : GET_CODE (PATTERN (prev_active_insn (LABEL))) == ADDR_DIFF_VEC \
kono
parents: 67
diff changeset
1302 ? 1 : 0)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1303 /* The desired alignment for the location counter at the beginning
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1304 of a loop. */
111
kono
parents: 67
diff changeset
1305 /* On the ARC, align loops to 4 byte boundaries unless doing all-out size
kono
parents: 67
diff changeset
1306 optimization. */
kono
parents: 67
diff changeset
1307 #define LOOP_ALIGN(X) 0
kono
parents: 67
diff changeset
1308
kono
parents: 67
diff changeset
1309 #define LABEL_ALIGN(LABEL) (arc_label_align (LABEL))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1310
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1311 /* This is how to output an assembler line
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1312 that says to advance the location counter
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1313 to a multiple of 2**LOG bytes. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1314 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
111
kono
parents: 67
diff changeset
1315 do { \
kono
parents: 67
diff changeset
1316 if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); \
kono
parents: 67
diff changeset
1317 if ((LOG) > 1) \
kono
parents: 67
diff changeset
1318 arc_clear_unalign (); \
kono
parents: 67
diff changeset
1319 } while (0)
kono
parents: 67
diff changeset
1320
kono
parents: 67
diff changeset
1321 /* ASM_OUTPUT_ALIGNED_DECL_LOCAL (STREAM, DECL, NAME, SIZE, ALIGNMENT)
kono
parents: 67
diff changeset
1322 Define this macro when you need to see the variable's decl in order to
kono
parents: 67
diff changeset
1323 chose what to output. */
kono
parents: 67
diff changeset
1324 #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGNMENT) \
kono
parents: 67
diff changeset
1325 arc_asm_output_aligned_decl_local (STREAM, DECL, NAME, SIZE, ALIGNMENT, 0)
kono
parents: 67
diff changeset
1326
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1327 /* Debugging information. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1328
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1329 /* Generate DBX and DWARF debugging information. */
111
kono
parents: 67
diff changeset
1330 #ifdef DBX_DEBUGGING_INFO
kono
parents: 67
diff changeset
1331 #undef DBX_DEBUGGING_INFO
kono
parents: 67
diff changeset
1332 #endif
kono
parents: 67
diff changeset
1333 #define DBX_DEBUGGING_INFO
kono
parents: 67
diff changeset
1334
kono
parents: 67
diff changeset
1335 #ifdef DWARF2_DEBUGGING_INFO
kono
parents: 67
diff changeset
1336 #undef DWARF2_DEBUGGING_INFO
kono
parents: 67
diff changeset
1337 #endif
kono
parents: 67
diff changeset
1338 #define DWARF2_DEBUGGING_INFO
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1339
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1340 /* Prefer STABS (for now). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1341 #undef PREFERRED_DEBUGGING_TYPE
111
kono
parents: 67
diff changeset
1342 #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
kono
parents: 67
diff changeset
1343
kono
parents: 67
diff changeset
1344 /* How to renumber registers for dbx and gdb. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1345 #define DBX_REGISTER_NUMBER(REGNO) \
111
kono
parents: 67
diff changeset
1346 ((TARGET_MULMAC_32BY16_SET && (REGNO) >= 56 && (REGNO) <= 57) \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1347 ? ((REGNO) ^ !TARGET_BIG_ENDIAN) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1348 : (TARGET_MUL64_SET && (REGNO) >= 57 && (REGNO) <= 58) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1349 ? (((REGNO) == 57) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1350 ? 58 /* MMED */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1351 : 57 + !!TARGET_MULMAC_32BY16_SET) /* MLO */ \
111
kono
parents: 67
diff changeset
1352 : (REGNO))
kono
parents: 67
diff changeset
1353
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1354 /* Use gcc hard register numbering for eh_frame. */
111
kono
parents: 67
diff changeset
1355 #define DWARF_FRAME_REGNUM(REG) (REG)
kono
parents: 67
diff changeset
1356
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1357 /* Map register numbers held in the call frame info that gcc has
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1358 collected using DWARF_FRAME_REGNUM to those that should be output
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1359 in .debug_frame and .eh_frame. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1360 #define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1361 ((TARGET_MULMAC_32BY16_SET && (REGNO) >= 56 && (REGNO) <= 57) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1362 ? ((REGNO) ^ !TARGET_BIG_ENDIAN) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1363 : (TARGET_MUL64_SET && (REGNO) >= 57 && (REGNO) <= 58) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1364 ? (((REGNO) == 57) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1365 ? 58 /* MMED */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1366 : 57 + !!TARGET_MULMAC_32BY16_SET) /* MLO */ \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1367 : (REGNO))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1368
111
kono
parents: 67
diff changeset
1369 #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (31)
kono
parents: 67
diff changeset
1370
kono
parents: 67
diff changeset
1371 #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 31)
kono
parents: 67
diff changeset
1372
kono
parents: 67
diff changeset
1373 /* Frame info. */
kono
parents: 67
diff changeset
1374
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1375 #define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1376
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1377 #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 2)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1378
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1379 /* Turn off splitting of long stabs. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1380 #define DBX_CONTIN_LENGTH 0
111
kono
parents: 67
diff changeset
1381
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1382 /* Miscellaneous. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1383
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1384 /* Specify the machine mode that this machine uses
111
kono
parents: 67
diff changeset
1385 for the index in the tablejump instruction.
kono
parents: 67
diff changeset
1386 If we have pc relative case vectors, we start the case vector shortening
kono
parents: 67
diff changeset
1387 with QImode. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1388 #define CASE_VECTOR_MODE \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1389 (TARGET_BI_BIH ? SImode \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1390 : (optimize && (CASE_VECTOR_PC_RELATIVE || flag_pic)) ? QImode : Pmode)
111
kono
parents: 67
diff changeset
1391
kono
parents: 67
diff changeset
1392 /* Define as C expression which evaluates to nonzero if the tablejump
kono
parents: 67
diff changeset
1393 instruction expects the table to contain offsets from the address of the
kono
parents: 67
diff changeset
1394 table.
kono
parents: 67
diff changeset
1395 Do not define this if the table should contain absolute addresses. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1396 #define CASE_VECTOR_PC_RELATIVE \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1397 (TARGET_CASE_VECTOR_PC_RELATIVE || TARGET_BI_BIH)
111
kono
parents: 67
diff changeset
1398
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1399 #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1400 (TARGET_BI_BIH ? \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1401 ((MIN_OFFSET) >= -512 && (MAX_OFFSET) <= 508 ? HImode : SImode) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1402 : ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1403 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1404 : (MIN_OFFSET) >= -128 && (MAX_OFFSET) <= 127 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1405 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1406 : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1407 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1408 : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1409 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1410 : SImode))
111
kono
parents: 67
diff changeset
1411
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1412 #define ADDR_VEC_ALIGN(VEC_INSN) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1413 (TARGET_BI_BIH ? 0 \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1414 : exact_log2 (GET_MODE_SIZE (as_a <scalar_int_mode> \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1415 (GET_MODE (PATTERN (VEC_INSN))))))
111
kono
parents: 67
diff changeset
1416
kono
parents: 67
diff changeset
1417 #define INSN_LENGTH_ALIGNMENT(INSN) \
kono
parents: 67
diff changeset
1418 ((JUMP_TABLE_DATA_P (INSN) \
kono
parents: 67
diff changeset
1419 && GET_CODE (PATTERN (INSN)) == ADDR_DIFF_VEC \
kono
parents: 67
diff changeset
1420 && GET_MODE (PATTERN (INSN)) == QImode) \
kono
parents: 67
diff changeset
1421 ? 0 : length_unit_log)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1422
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1423 /* Define if operations between registers always perform the operation
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1424 on the full register even if a narrower mode is specified. */
111
kono
parents: 67
diff changeset
1425 #define WORD_REGISTER_OPERATIONS 1
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1426
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1427 /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1428 will either zero-extend or sign-extend. The value of this macro should
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1429 be the code that says which one of the two operations is implicitly
111
kono
parents: 67
diff changeset
1430 done, NIL if none. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1431 #define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1432
111
kono
parents: 67
diff changeset
1433
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1434 /* Max number of bytes we can move from memory to memory
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1435 in one reasonably fast instruction. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1436 #define MOVE_MAX 4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1437
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1438 /* Undo the effects of the cpymem pattern presence on STORE_BY_PIECES_P . */
111
kono
parents: 67
diff changeset
1439 #define MOVE_RATIO(SPEED) ((SPEED) ? 15 : 3)
kono
parents: 67
diff changeset
1440
kono
parents: 67
diff changeset
1441 /* Define this to be nonzero if shift instructions ignore all but the
kono
parents: 67
diff changeset
1442 low-order few bits.
kono
parents: 67
diff changeset
1443 */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1444 #define SHIFT_COUNT_TRUNCATED 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1445
111
kono
parents: 67
diff changeset
1446 /* We assume that the store-condition-codes instructions store 0 for false
kono
parents: 67
diff changeset
1447 and some other value for true. This is the value stored for true. */
kono
parents: 67
diff changeset
1448 #define STORE_FLAG_VALUE 1
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1449
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1450 /* Specify the machine mode that pointers have.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1451 After generation of rtl, the compiler makes no further distinction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1452 between pointers and any other objects of this machine mode. */
111
kono
parents: 67
diff changeset
1453 /* ARCompact has full 32-bit pointers. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1454 #define Pmode SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1455
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1456 /* A function address in a call instruction. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1457 #define FUNCTION_MODE SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1458
111
kono
parents: 67
diff changeset
1459 /* Define the information needed to generate branch and scc insns. This is
kono
parents: 67
diff changeset
1460 stored from the compare operation. Note that we can't use "rtx" here
kono
parents: 67
diff changeset
1461 since it hasn't been defined! */
kono
parents: 67
diff changeset
1462 extern struct rtx_def *arc_compare_op0, *arc_compare_op1;
kono
parents: 67
diff changeset
1463
kono
parents: 67
diff changeset
1464 /* ARC function types. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1465 enum arc_function_type {
111
kono
parents: 67
diff changeset
1466 /* No function should have the unknown type. This value is used to
kono
parents: 67
diff changeset
1467 indicate the that function type has not yet been computed. */
kono
parents: 67
diff changeset
1468 ARC_FUNCTION_UNKNOWN = 0,
kono
parents: 67
diff changeset
1469
kono
parents: 67
diff changeset
1470 /* The normal function type indicates that the function has the
kono
parents: 67
diff changeset
1471 standard prologue and epilogue. */
kono
parents: 67
diff changeset
1472 ARC_FUNCTION_NORMAL = 1 << 0,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1473 /* These are interrupt handlers. The name corresponds to the register
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1474 name that contains the return address. */
111
kono
parents: 67
diff changeset
1475 ARC_FUNCTION_ILINK1 = 1 << 1,
kono
parents: 67
diff changeset
1476 ARC_FUNCTION_ILINK2 = 1 << 2,
kono
parents: 67
diff changeset
1477 /* Fast interrupt is only available on ARCv2 processors. */
kono
parents: 67
diff changeset
1478 ARC_FUNCTION_FIRQ = 1 << 3,
kono
parents: 67
diff changeset
1479 /* The naked function type indicates that the function does not have
kono
parents: 67
diff changeset
1480 prologue or epilogue, and that no stack frame is available. */
kono
parents: 67
diff changeset
1481 ARC_FUNCTION_NAKED = 1 << 4
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1482 };
111
kono
parents: 67
diff changeset
1483
kono
parents: 67
diff changeset
1484 /* Check if a function is an interrupt function. */
kono
parents: 67
diff changeset
1485 #define ARC_INTERRUPT_P(TYPE) \
kono
parents: 67
diff changeset
1486 (((TYPE) & (ARC_FUNCTION_ILINK1 | ARC_FUNCTION_ILINK2 \
kono
parents: 67
diff changeset
1487 | ARC_FUNCTION_FIRQ)) != 0)
kono
parents: 67
diff changeset
1488
kono
parents: 67
diff changeset
1489 /* Check if a function is a fast interrupt function. */
kono
parents: 67
diff changeset
1490 #define ARC_FAST_INTERRUPT_P(TYPE) (((TYPE) & ARC_FUNCTION_FIRQ) != 0)
kono
parents: 67
diff changeset
1491
kono
parents: 67
diff changeset
1492 /* Check if a function is normal, that is, has standard prologue and
kono
parents: 67
diff changeset
1493 epilogue. */
kono
parents: 67
diff changeset
1494 #define ARC_NORMAL_P(TYPE) (((TYPE) & ARC_FUNCTION_NORMAL) != 0)
kono
parents: 67
diff changeset
1495
kono
parents: 67
diff changeset
1496 /* Check if a function is naked. */
kono
parents: 67
diff changeset
1497 #define ARC_NAKED_P(TYPE) (((TYPE) & ARC_FUNCTION_NAKED) != 0)
kono
parents: 67
diff changeset
1498
kono
parents: 67
diff changeset
1499 /* Called by crtstuff.c to make calls to function FUNCTION that are defined in
kono
parents: 67
diff changeset
1500 SECTION_OP, and then to switch back to text section. */
kono
parents: 67
diff changeset
1501 #undef CRT_CALL_STATIC_FUNCTION
kono
parents: 67
diff changeset
1502 #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
kono
parents: 67
diff changeset
1503 asm (SECTION_OP "\n\t" \
kono
parents: 67
diff changeset
1504 "add r12,pcl,@" USER_LABEL_PREFIX #FUNC "@pcl\n\t" \
kono
parents: 67
diff changeset
1505 "jl [r12]\n" \
kono
parents: 67
diff changeset
1506 TEXT_SECTION_ASM_OP);
kono
parents: 67
diff changeset
1507
kono
parents: 67
diff changeset
1508 /* This macro expands to the name of the scratch register r12, used for
kono
parents: 67
diff changeset
1509 temporary calculations according to the ABI. */
kono
parents: 67
diff changeset
1510 #define ARC_TEMP_SCRATCH_REG "r12"
kono
parents: 67
diff changeset
1511
kono
parents: 67
diff changeset
1512 /* The C++ compiler must use one bit to indicate whether the function
kono
parents: 67
diff changeset
1513 that will be called through a pointer-to-member-function is
kono
parents: 67
diff changeset
1514 virtual. Normally, we assume that the low-order bit of a function
kono
parents: 67
diff changeset
1515 pointer must always be zero. Then, by ensuring that the
kono
parents: 67
diff changeset
1516 vtable_index is odd, we can distinguish which variant of the union
kono
parents: 67
diff changeset
1517 is in use. But, on some platforms function pointers can be odd,
kono
parents: 67
diff changeset
1518 and so this doesn't work. In that case, we use the low-order bit
kono
parents: 67
diff changeset
1519 of the `delta' field, and shift the remainder of the `delta' field
kono
parents: 67
diff changeset
1520 to the left. We needed to do this for A4 because the address was always
kono
parents: 67
diff changeset
1521 shifted and thus could be odd. */
kono
parents: 67
diff changeset
1522 #define TARGET_PTRMEMFUNC_VBIT_LOCATION \
kono
parents: 67
diff changeset
1523 (ptrmemfunc_vbit_in_pfn)
kono
parents: 67
diff changeset
1524
kono
parents: 67
diff changeset
1525 #define INSN_SETS_ARE_DELAYED(X) \
kono
parents: 67
diff changeset
1526 (GET_CODE (X) == INSN \
kono
parents: 67
diff changeset
1527 && GET_CODE (PATTERN (X)) != SEQUENCE \
kono
parents: 67
diff changeset
1528 && GET_CODE (PATTERN (X)) != USE \
kono
parents: 67
diff changeset
1529 && GET_CODE (PATTERN (X)) != CLOBBER \
kono
parents: 67
diff changeset
1530 && (get_attr_type (X) == TYPE_CALL || get_attr_type (X) == TYPE_SFUNC))
kono
parents: 67
diff changeset
1531
kono
parents: 67
diff changeset
1532 #define INSN_REFERENCES_ARE_DELAYED(insn) \
kono
parents: 67
diff changeset
1533 (INSN_SETS_ARE_DELAYED (insn))
kono
parents: 67
diff changeset
1534
kono
parents: 67
diff changeset
1535 #define CALL_ATTR(X, NAME) \
kono
parents: 67
diff changeset
1536 ((CALL_P (X) || NONJUMP_INSN_P (X)) \
kono
parents: 67
diff changeset
1537 && GET_CODE (PATTERN (X)) != USE \
kono
parents: 67
diff changeset
1538 && GET_CODE (PATTERN (X)) != CLOBBER \
kono
parents: 67
diff changeset
1539 && get_attr_is_##NAME (X) == IS_##NAME##_YES) \
kono
parents: 67
diff changeset
1540
kono
parents: 67
diff changeset
1541 #define REVERSE_CONDITION(CODE,MODE) \
kono
parents: 67
diff changeset
1542 (((MODE) == CC_FP_GTmode || (MODE) == CC_FP_GEmode \
kono
parents: 67
diff changeset
1543 || (MODE) == CC_FP_UNEQmode || (MODE) == CC_FP_ORDmode \
kono
parents: 67
diff changeset
1544 || (MODE) == CC_FPXmode || (MODE) == CC_FPU_UNEQmode \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1545 || (MODE) == CC_FPUmode || (MODE) == CC_FPUEmode) \
111
kono
parents: 67
diff changeset
1546 ? reverse_condition_maybe_unordered ((CODE)) \
kono
parents: 67
diff changeset
1547 : reverse_condition ((CODE)))
kono
parents: 67
diff changeset
1548
kono
parents: 67
diff changeset
1549 #define ADJUST_INSN_LENGTH(X, LENGTH) \
kono
parents: 67
diff changeset
1550 ((LENGTH) \
kono
parents: 67
diff changeset
1551 = (GET_CODE (PATTERN (X)) == SEQUENCE \
kono
parents: 67
diff changeset
1552 ? ((LENGTH) \
kono
parents: 67
diff changeset
1553 + arc_adjust_insn_length ( \
kono
parents: 67
diff changeset
1554 as_a <rtx_sequence *> (PATTERN (X))->insn (0), \
kono
parents: 67
diff changeset
1555 get_attr_length (as_a <rtx_sequence *> (PATTERN (X))->insn (0)), \
kono
parents: 67
diff changeset
1556 true) \
kono
parents: 67
diff changeset
1557 - get_attr_length (as_a <rtx_sequence *> (PATTERN (X))->insn (0)) \
kono
parents: 67
diff changeset
1558 + arc_adjust_insn_length ( \
kono
parents: 67
diff changeset
1559 as_a <rtx_sequence *> (PATTERN (X))->insn (1), \
kono
parents: 67
diff changeset
1560 get_attr_length (as_a <rtx_sequence *> (PATTERN (X))->insn (1)), \
kono
parents: 67
diff changeset
1561 true) \
kono
parents: 67
diff changeset
1562 - get_attr_length (as_a <rtx_sequence *> (PATTERN (X))->insn (1))) \
kono
parents: 67
diff changeset
1563 : arc_adjust_insn_length ((X), (LENGTH), false)))
kono
parents: 67
diff changeset
1564
kono
parents: 67
diff changeset
1565 #define IS_ASM_LOGICAL_LINE_SEPARATOR(C,STR) ((C) == '`')
kono
parents: 67
diff changeset
1566
kono
parents: 67
diff changeset
1567 #define INIT_EXPANDERS arc_init_expanders ()
kono
parents: 67
diff changeset
1568
kono
parents: 67
diff changeset
1569 enum
kono
parents: 67
diff changeset
1570 {
kono
parents: 67
diff changeset
1571 ARC_LRA_PRIORITY_NONE, ARC_LRA_PRIORITY_NONCOMPACT, ARC_LRA_PRIORITY_COMPACT
kono
parents: 67
diff changeset
1572 };
kono
parents: 67
diff changeset
1573
kono
parents: 67
diff changeset
1574 /* The define_cond_exec construct is rather crude, as we can't have
kono
parents: 67
diff changeset
1575 different ones with different conditions apply to different sets
kono
parents: 67
diff changeset
1576 of instructions. We can't use an attribute test inside the condition,
kono
parents: 67
diff changeset
1577 because that would lead to infinite recursion as the attribute test
kono
parents: 67
diff changeset
1578 needs to recognize the insn. So, instead we have a clause for
kono
parents: 67
diff changeset
1579 the pattern condition of all sfunc patterns which is only relevant for
kono
parents: 67
diff changeset
1580 the predicated varaint. */
kono
parents: 67
diff changeset
1581 #define SFUNC_CHECK_PREDICABLE \
kono
parents: 67
diff changeset
1582 (GET_CODE (PATTERN (insn)) != COND_EXEC || !flag_pic || !TARGET_MEDIUM_CALLS)
kono
parents: 67
diff changeset
1583
kono
parents: 67
diff changeset
1584 /* MPYW feature macro. Only valid for ARCHS and ARCEM cores. */
kono
parents: 67
diff changeset
1585 #define TARGET_MPYW ((arc_mpy_option > 0) && TARGET_V2)
kono
parents: 67
diff changeset
1586 /* Full ARCv2 multiplication feature macro. */
kono
parents: 67
diff changeset
1587 #define TARGET_MULTI ((arc_mpy_option > 1) && TARGET_V2)
kono
parents: 67
diff changeset
1588 /* General MPY feature macro. */
kono
parents: 67
diff changeset
1589 #define TARGET_MPY ((TARGET_ARC700 && (!TARGET_NOMPY_SET)) || TARGET_MULTI)
kono
parents: 67
diff changeset
1590 /* ARC700 MPY feature macro. */
kono
parents: 67
diff changeset
1591 #define TARGET_ARC700_MPY (TARGET_ARC700 && (!TARGET_NOMPY_SET))
kono
parents: 67
diff changeset
1592 /* Any multiplication feature macro. */
kono
parents: 67
diff changeset
1593 #define TARGET_ANY_MPY \
kono
parents: 67
diff changeset
1594 (TARGET_MPY || TARGET_MUL64_SET || TARGET_MULMAC_32BY16_SET)
kono
parents: 67
diff changeset
1595 /* PLUS_DMPY feature macro. */
kono
parents: 67
diff changeset
1596 #define TARGET_PLUS_DMPY ((arc_mpy_option > 6) && TARGET_HS)
kono
parents: 67
diff changeset
1597 /* PLUS_MACD feature macro. */
kono
parents: 67
diff changeset
1598 #define TARGET_PLUS_MACD ((arc_mpy_option > 7) && TARGET_HS)
kono
parents: 67
diff changeset
1599 /* PLUS_QMACW feature macro. */
kono
parents: 67
diff changeset
1600 #define TARGET_PLUS_QMACW ((arc_mpy_option > 8) && TARGET_HS)
kono
parents: 67
diff changeset
1601
kono
parents: 67
diff changeset
1602 /* ARC600 and ARC601 feature macro. */
kono
parents: 67
diff changeset
1603 #define TARGET_ARC600_FAMILY (TARGET_ARC600 || TARGET_ARC601)
kono
parents: 67
diff changeset
1604 /* ARC600, ARC601 and ARC700 feature macro. */
kono
parents: 67
diff changeset
1605 #define TARGET_ARCOMPACT_FAMILY \
kono
parents: 67
diff changeset
1606 (TARGET_ARC600 || TARGET_ARC601 || TARGET_ARC700)
kono
parents: 67
diff changeset
1607 /* Loop count register can be read in very next instruction after has
kono
parents: 67
diff changeset
1608 been written to by an ordinary instruction. */
kono
parents: 67
diff changeset
1609 #define TARGET_LP_WR_INTERLOCK (!TARGET_ARC600_FAMILY)
kono
parents: 67
diff changeset
1610
kono
parents: 67
diff changeset
1611 /* FPU defines. */
kono
parents: 67
diff changeset
1612 /* Any FPU support. */
kono
parents: 67
diff changeset
1613 #define TARGET_HARD_FLOAT ((arc_fpu_build & (FPU_SP | FPU_DP)) != 0)
kono
parents: 67
diff changeset
1614 /* Single precision floating point support. */
kono
parents: 67
diff changeset
1615 #define TARGET_FP_SP_BASE ((arc_fpu_build & FPU_SP) != 0)
kono
parents: 67
diff changeset
1616 /* Double precision floating point support. */
kono
parents: 67
diff changeset
1617 #define TARGET_FP_DP_BASE ((arc_fpu_build & FPU_DP) != 0)
kono
parents: 67
diff changeset
1618 /* Single precision floating point support with fused operation. */
kono
parents: 67
diff changeset
1619 #define TARGET_FP_SP_FUSED ((arc_fpu_build & FPU_SF) != 0)
kono
parents: 67
diff changeset
1620 /* Double precision floating point support with fused operation. */
kono
parents: 67
diff changeset
1621 #define TARGET_FP_DP_FUSED ((arc_fpu_build & FPU_DF) != 0)
kono
parents: 67
diff changeset
1622 /* Single precision floating point conversion instruction support. */
kono
parents: 67
diff changeset
1623 #define TARGET_FP_SP_CONV ((arc_fpu_build & FPU_SC) != 0)
kono
parents: 67
diff changeset
1624 /* Double precision floating point conversion instruction support. */
kono
parents: 67
diff changeset
1625 #define TARGET_FP_DP_CONV ((arc_fpu_build & FPU_DC) != 0)
kono
parents: 67
diff changeset
1626 /* Single precision floating point SQRT/DIV instruction support. */
kono
parents: 67
diff changeset
1627 #define TARGET_FP_SP_SQRT ((arc_fpu_build & FPU_SD) != 0)
kono
parents: 67
diff changeset
1628 /* Double precision floating point SQRT/DIV instruction support. */
kono
parents: 67
diff changeset
1629 #define TARGET_FP_DP_SQRT ((arc_fpu_build & FPU_DD) != 0)
kono
parents: 67
diff changeset
1630 /* Double precision floating point assist instruction support. */
kono
parents: 67
diff changeset
1631 #define TARGET_FP_DP_AX ((arc_fpu_build & FPX_DP) != 0)
kono
parents: 67
diff changeset
1632 /* Custom FP instructions used by QuarkSE EM cpu. */
kono
parents: 67
diff changeset
1633 #define TARGET_FPX_QUARK (TARGET_EM && TARGET_SPFP \
kono
parents: 67
diff changeset
1634 && (arc_fpu_build == FPX_QK))
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1635 /* DBNZ support is available for ARCv2 core3 and newer cpus. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1636 #define TARGET_DBNZ (TARGET_V2 && (arc_tune >= ARC_TUNE_CORE_3))
111
kono
parents: 67
diff changeset
1637
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1638 /* BI/BIH feature macro. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1639 #define TARGET_BI_BIH (TARGET_BRANCH_INDEX && TARGET_CODE_DENSITY)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1640
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1641 /* The default option for BI/BIH instructions. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1642 #define DEFAULT_BRANCH_INDEX 0
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1643
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1644 #ifndef TARGET_LRA
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1645 #define TARGET_LRA arc_lra_p()
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1646 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1647
111
kono
parents: 67
diff changeset
1648 #endif /* GCC_ARC_H */