LLVM: lib/Target/M68k/MCTargetDesc/M68kBaseInfo.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef LLVM_LIB_TARGET_M68K_MCTARGETDESC_M68KBASEINFO_H
18#define LLVM_LIB_TARGET_M68K_MCTARGETDESC_M68KBASEINFO_H
19
21
26
27#define GET_INSTRINFO_MI_OPS_INFO
28#define GET_INSTRINFO_OPERAND_TYPES_ENUM
29#define GET_INSTRINFO_LOGICAL_OPERAND_SIZE_MAP
30#include "M68kGenInstrInfo.inc"
31
32namespace llvm {
33
34namespace M68k {
35
36
37
38
39
40
41
43
44
45
46
47
48
50
75};
76
77
78
79
80
81template <typename value_t> value_t swapWord(value_t Val) {
82 const unsigned NumWords = sizeof(Val) / 2;
83 if (NumWords <= 1)
84 return Val;
86 value_t NewVal = 0;
87 for (unsigned i = 0U; i != NumWords; ++i) {
88 uint16_t Part = (Val >> (i * 16)) & 0xFFFF;
90 NewVal |= (Part << (i * 16));
91 }
92 return NewVal;
93}
94}
95
97enum {
112};
113
114
115enum {
118};
119}
120
121
122
124
126
128
129
130
132
133
134
136
137
138
139
140
142
143
144
145
146
148
149
150
151
152
154
155
156
157
158
160
161
162
163
164
166
167
168
169
170
172
173
174
175
176
178
179
180
181
182
184
185
186
187
188
190
191};
192
193
194
196 switch (TargetFlag) {
197 default:
198 return false;
201 return true;
202 }
203}
204
205
206
208 switch (Flag) {
209 default:
210 return false;
214 return true;
215 }
216}
217
218
219
220
222 switch (TargetFlag) {
223 default:
224 return false;
227 return true;
228 }
229}
230
231
233 switch (Flag) {
234 default:
235 return false;
238 return true;
239 }
240}
241
242
244 switch (Flag) {
245 default:
246 return false;
248 return true;
249 }
250}
251
253 switch (RegNo) {
254 case M68k::WA0:
255 case M68k::WA1:
256 case M68k::WA2:
257 case M68k::WA3:
258 case M68k::WA4:
259 case M68k::WA5:
260 case M68k::WA6:
261 case M68k::WSP:
262 case M68k::A0:
263 case M68k::A1:
264 case M68k::A2:
265 case M68k::A3:
266 case M68k::A4:
267 case M68k::A5:
268 case M68k::A6:
269 case M68k::SP:
270 return true;
271 default:
272 return false;
273 }
274}
275
277 return M68k::getLogicalOperandSize(Op, LogicalOpIdx) > 1;
278}
279
281 switch (order) {
282 default:
283 return 0;
284 case 0:
285 return M68k::D0;
286 case 1:
287 return M68k::D1;
288 case 2:
289 return M68k::D2;
290 case 3:
291 return M68k::D3;
292 case 4:
293 return M68k::D4;
294 case 5:
295 return M68k::D5;
296 case 6:
297 return M68k::D6;
298 case 7:
299 return M68k::D7;
300 case 8:
301 return M68k::A0;
302 case 9:
303 return M68k::A1;
304 case 10:
305 return M68k::A2;
306 case 11:
307 return M68k::A3;
308 case 12:
309 return M68k::A4;
310 case 13:
311 return M68k::A5;
312 case 14:
313 return M68k::A6;
314 case 15:
315 return M68k::SP;
316 }
317}
318
319}
320
321}
322
323#endif
This file provides M68k specific target descriptions.
Definition M68kBaseInfo.h:96
@ Term
Definition M68kBaseInfo.h:116
@ Ignore
Definition M68kBaseInfo.h:117
@ Imm8
Definition M68kBaseInfo.h:108
@ Imm32
Definition M68kBaseInfo.h:110
@ Bits4
Definition M68kBaseInfo.h:102
@ DReg
Definition M68kBaseInfo.h:106
@ Imm16
Definition M68kBaseInfo.h:109
@ DAReg
Definition M68kBaseInfo.h:103
@ Reg
Definition M68kBaseInfo.h:105
@ Bits1
Definition M68kBaseInfo.h:99
@ DA
Definition M68kBaseInfo.h:104
@ Ctrl
Definition M68kBaseInfo.h:98
@ Bits3
Definition M68kBaseInfo.h:101
@ Disp8
Definition M68kBaseInfo.h:107
@ Bits2
Definition M68kBaseInfo.h:100
@ Imm3
Definition M68kBaseInfo.h:111
This namespace holds all of the target specific flags that instruction info tracks.
Definition M68kBaseInfo.h:123
static bool isAddressRegister(unsigned RegNo)
Definition M68kBaseInfo.h:252
static bool isPCRelBlockReference(unsigned char Flag)
Return True if the Block is referenced using PC.
Definition M68kBaseInfo.h:243
static bool isGlobalRelativeToPICBase(unsigned char TargetFlag)
Return true if the specified global value reference is relative to a 32-bit PIC base (M68kISD::GLOBAL...
Definition M68kBaseInfo.h:221
static bool isGlobalStubReference(unsigned char TargetFlag)
Return true if the specified TargetFlag operand is a reference to a stub for a global,...
Definition M68kBaseInfo.h:195
static bool isPCRelGlobalReference(unsigned char Flag)
Return True if the specified GlobalValue requires PC addressing mode.
Definition M68kBaseInfo.h:232
static bool hasMultiMIOperands(unsigned Op, unsigned LogicalOpIdx)
Definition M68kBaseInfo.h:276
static unsigned getMaskedSpillRegister(unsigned order)
Definition M68kBaseInfo.h:280
TOF
Target Operand Flag enum.
Definition M68kBaseInfo.h:125
@ MO_GOTOFF
On a symbol operand this indicates that the immediate is the offset to the location of the symbol nam...
Definition M68kBaseInfo.h:147
@ MO_TLSLDM
On a symbol operand, this indicates that the immediate is the offset to the slot in GOT which stores ...
Definition M68kBaseInfo.h:177
@ MO_PLT
On a symbol operand this indicates that the immediate is offset to the PLT entry of symbol name from ...
Definition M68kBaseInfo.h:159
@ MO_TLSLE
On a symbol operand, this indicates that the immediate is the offset to the variable within in the th...
Definition M68kBaseInfo.h:189
@ MO_GOT
On a symbol operand this indicates that the immediate is the offset to the GOT entry for the symbol n...
Definition M68kBaseInfo.h:141
@ MO_TLSGD
On a symbol operand, this indicates that the immediate is the offset to the slot in GOT which stores ...
Definition M68kBaseInfo.h:165
@ MO_ABSOLUTE_ADDRESS
On a symbol operand this indicates that the immediate is the absolute address of the symbol.
Definition M68kBaseInfo.h:131
@ MO_GOTPCREL
On a symbol operand this indicates that the immediate is offset to the GOT entry for the symbol name ...
Definition M68kBaseInfo.h:153
@ MO_PC_RELATIVE_ADDRESS
On a symbol operand this indicates that the immediate is the pc-relative address of the symbol.
Definition M68kBaseInfo.h:135
@ MO_TLSIE
On a symbol operand, this indicates that the immediate is the offset to the variable within the threa...
Definition M68kBaseInfo.h:183
@ MO_TLSLD
On a symbol operand, this indicates that the immediate is the offset to variable within the thread lo...
Definition M68kBaseInfo.h:171
@ MO_NO_FLAG
Definition M68kBaseInfo.h:127
static bool isDirectGlobalReference(unsigned char Flag)
Return True if the specified GlobalValue is a direct reference for a symbol.
Definition M68kBaseInfo.h:207
@ PCRelIndex
Definition M68kBaseInfo.h:49
@ PCRelDisp
Definition M68kBaseInfo.h:49
@ PCRelOuter
Definition M68kBaseInfo.h:49
@ MemBase
Definition M68kBaseInfo.h:42
@ MemIndex
Definition M68kBaseInfo.h:42
@ MemDisp
Definition M68kBaseInfo.h:42
@ MemOuter
Definition M68kBaseInfo.h:42
value_t swapWord(value_t Val)
Definition M68kBaseInfo.h:81
MemAddrModeKind
Definition M68kBaseInfo.h:51
@ X
Definition M68kBaseInfo.h:72
@ l
Definition M68kBaseInfo.h:69
@ j
Definition M68kBaseInfo.h:52
@ y
Definition M68kBaseInfo.h:73
@ U
Definition M68kBaseInfo.h:61
@ V
Definition M68kBaseInfo.h:63
@ Y
Definition M68kBaseInfo.h:74
@ q
Definition M68kBaseInfo.h:66
@ u
Definition M68kBaseInfo.h:60
@ F
Definition M68kBaseInfo.h:57
@ p
Definition M68kBaseInfo.h:55
@ k
Definition M68kBaseInfo.h:67
@ f
Definition M68kBaseInfo.h:56
@ b
Definition M68kBaseInfo.h:64
@ B
Definition M68kBaseInfo.h:65
@ x
Definition M68kBaseInfo.h:71
@ v
Definition M68kBaseInfo.h:62
@ K
Definition M68kBaseInfo.h:68
@ g
Definition M68kBaseInfo.h:58
@ L
Definition M68kBaseInfo.h:70
@ o
Definition M68kBaseInfo.h:53
@ G
Definition M68kBaseInfo.h:59
@ e
Definition M68kBaseInfo.h:54
value_type byte_swap(value_type value, endianness endian)
This is an optimization pass for GlobalISel generic memory operations.
DWARFExpression::Operation Op