Coverage Report

Created: 2023-12-08 06:05

/src/capstonenext/arch/AArch64/AArch64BaseInfo.h
Line
Count
Source (jump to first uncovered line)
1
/* Capstone Disassembly Engine, http://www.capstone-engine.org */
2
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2022, */
3
/*    Rot127 <unisono@quyllur.org> 2022-2023 */
4
/* Automatically translated source file from LLVM. */
5
6
/* LLVM-commit: <commit> */
7
/* LLVM-tag: <tag> */
8
9
/* Only small edits allowed. */
10
/* For multiple similar edits, please create a Patch for the translator. */
11
12
/* Capstone's C++ file translator: */
13
/* https://github.com/capstone-engine/capstone/tree/next/suite/auto-sync */
14
15
//===-- AArch64BaseInfo.h - Top level definitions for AArch64 ---*- C++ -*-===//
16
//
17
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
18
// See https://llvm.org/LICENSE.txt for license information.
19
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
20
//
21
//===----------------------------------------------------------------------===//
22
//
23
// This file contains small standalone helper functions and enum definitions for
24
// the AArch64 target useful for the compiler back-end and the MC libraries.
25
// As such, it deliberately does not include references to LLVM core
26
// code gen types, passes, etc..
27
//
28
//===----------------------------------------------------------------------===//
29
30
#ifndef LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64BASEINFO_H
31
#define LLVM_LIB_TARGET_AARCH64_UTILS_AARCH64BASEINFO_H
32
33
// FIXME: Is it easiest to fix this layering violation by moving the .inc
34
// #includes from AArch64MCTargetDesc.h to here?
35
#include <capstone/platform.h>
36
#include <stdio.h>
37
#include <stdlib.h>
38
#include <string.h>
39
40
#include "../../MCInstPrinter.h"
41
42
#include "../../utils.h"
43
#include "capstone/aarch64.h"
44
45
#define GET_SUBTARGETINFO_ENUM
46
#include "AArch64GenSubtargetInfo.inc"
47
48
#define GET_REGINFO_ENUM
49
#define GET_REGINFO_MC_DESC
50
#include "AArch64GenRegisterInfo.inc"
51
52
#define GET_INSTRINFO_ENUM
53
#include "AArch64GenInstrInfo.inc"
54
55
#define CONCAT(a, b) CONCAT_(a, b)
56
#define CONCAT_(a, b) a##_##b
57
58
inline static unsigned getWRegFromXReg(unsigned Reg)
59
13.5k
{
60
13.5k
  switch (Reg) {
61
214
  case AArch64_X0:
62
214
    return AArch64_W0;
63
78
  case AArch64_X1:
64
78
    return AArch64_W1;
65
42
  case AArch64_X2:
66
42
    return AArch64_W2;
67
1.05k
  case AArch64_X3:
68
1.05k
    return AArch64_W3;
69
754
  case AArch64_X4:
70
754
    return AArch64_W4;
71
170
  case AArch64_X5:
72
170
    return AArch64_W5;
73
132
  case AArch64_X6:
74
132
    return AArch64_W6;
75
104
  case AArch64_X7:
76
104
    return AArch64_W7;
77
92
  case AArch64_X8:
78
92
    return AArch64_W8;
79
114
  case AArch64_X9:
80
114
    return AArch64_W9;
81
974
  case AArch64_X10:
82
974
    return AArch64_W10;
83
42
  case AArch64_X11:
84
42
    return AArch64_W11;
85
66
  case AArch64_X12:
86
66
    return AArch64_W12;
87
44
  case AArch64_X13:
88
44
    return AArch64_W13;
89
872
  case AArch64_X14:
90
872
    return AArch64_W14;
91
1.72k
  case AArch64_X15:
92
1.72k
    return AArch64_W15;
93
50
  case AArch64_X16:
94
50
    return AArch64_W16;
95
72
  case AArch64_X17:
96
72
    return AArch64_W17;
97
312
  case AArch64_X18:
98
312
    return AArch64_W18;
99
1.99k
  case AArch64_X19:
100
1.99k
    return AArch64_W19;
101
42
  case AArch64_X20:
102
42
    return AArch64_W20;
103
96
  case AArch64_X21:
104
96
    return AArch64_W21;
105
66
  case AArch64_X22:
106
66
    return AArch64_W22;
107
448
  case AArch64_X23:
108
448
    return AArch64_W23;
109
1.20k
  case AArch64_X24:
110
1.20k
    return AArch64_W24;
111
178
  case AArch64_X25:
112
178
    return AArch64_W25;
113
528
  case AArch64_X26:
114
528
    return AArch64_W26;
115
118
  case AArch64_X27:
116
118
    return AArch64_W27;
117
134
  case AArch64_X28:
118
134
    return AArch64_W28;
119
1.20k
  case AArch64_FP:
120
1.20k
    return AArch64_W29;
121
162
  case AArch64_LR:
122
162
    return AArch64_W30;
123
0
  case AArch64_SP:
124
0
    return AArch64_WSP;
125
388
  case AArch64_XZR:
126
388
    return AArch64_WZR;
127
13.5k
  }
128
  // For anything else, return it unchanged.
129
46
  return Reg;
130
13.5k
}
AArch64Mapping.c:getWRegFromXReg
Line
Count
Source
59
4.40k
{
60
4.40k
  switch (Reg) {
61
107
  case AArch64_X0:
62
107
    return AArch64_W0;
63
36
  case AArch64_X1:
64
36
    return AArch64_W1;
65
21
  case AArch64_X2:
66
21
    return AArch64_W2;
67
417
  case AArch64_X3:
68
417
    return AArch64_W3;
69
31
  case AArch64_X4:
70
31
    return AArch64_W4;
71
76
  case AArch64_X5:
72
76
    return AArch64_W5;
73
63
  case AArch64_X6:
74
63
    return AArch64_W6;
75
36
  case AArch64_X7:
76
36
    return AArch64_W7;
77
26
  case AArch64_X8:
78
26
    return AArch64_W8;
79
53
  case AArch64_X9:
80
53
    return AArch64_W9;
81
486
  case AArch64_X10:
82
486
    return AArch64_W10;
83
13
  case AArch64_X11:
84
13
    return AArch64_W11;
85
19
  case AArch64_X12:
86
19
    return AArch64_W12;
87
15
  case AArch64_X13:
88
15
    return AArch64_W13;
89
434
  case AArch64_X14:
90
434
    return AArch64_W14;
91
808
  case AArch64_X15:
92
808
    return AArch64_W15;
93
10
  case AArch64_X16:
94
10
    return AArch64_W16;
95
34
  case AArch64_X17:
96
34
    return AArch64_W17;
97
102
  case AArch64_X18:
98
102
    return AArch64_W18;
99
10
  case AArch64_X19:
100
10
    return AArch64_W19;
101
11
  case AArch64_X20:
102
11
    return AArch64_W20;
103
36
  case AArch64_X21:
104
36
    return AArch64_W21;
105
31
  case AArch64_X22:
106
31
    return AArch64_W22;
107
19
  case AArch64_X23:
108
19
    return AArch64_W23;
109
587
  case AArch64_X24:
110
587
    return AArch64_W24;
111
43
  case AArch64_X25:
112
43
    return AArch64_W25;
113
264
  case AArch64_X26:
114
264
    return AArch64_W26;
115
34
  case AArch64_X27:
116
34
    return AArch64_W27;
117
10
  case AArch64_X28:
118
10
    return AArch64_W28;
119
555
  case AArch64_FP:
120
555
    return AArch64_W29;
121
8
  case AArch64_LR:
122
8
    return AArch64_W30;
123
0
  case AArch64_SP:
124
0
    return AArch64_WSP;
125
12
  case AArch64_XZR:
126
12
    return AArch64_WZR;
127
4.40k
  }
128
  // For anything else, return it unchanged.
129
0
  return Reg;
130
4.40k
}
Unexecuted instantiation: AArch64BaseInfo.c:getWRegFromXReg
Unexecuted instantiation: AArch64Disassembler.c:getWRegFromXReg
Unexecuted instantiation: AArch64DisassemblerExtension.c:getWRegFromXReg
AArch64InstPrinter.c:getWRegFromXReg
Line
Count
Source
59
9.11k
{
60
9.11k
  switch (Reg) {
61
107
  case AArch64_X0:
62
107
    return AArch64_W0;
63
42
  case AArch64_X1:
64
42
    return AArch64_W1;
65
21
  case AArch64_X2:
66
21
    return AArch64_W2;
67
641
  case AArch64_X3:
68
641
    return AArch64_W3;
69
723
  case AArch64_X4:
70
723
    return AArch64_W4;
71
94
  case AArch64_X5:
72
94
    return AArch64_W5;
73
69
  case AArch64_X6:
74
69
    return AArch64_W6;
75
68
  case AArch64_X7:
76
68
    return AArch64_W7;
77
66
  case AArch64_X8:
78
66
    return AArch64_W8;
79
61
  case AArch64_X9:
80
61
    return AArch64_W9;
81
488
  case AArch64_X10:
82
488
    return AArch64_W10;
83
29
  case AArch64_X11:
84
29
    return AArch64_W11;
85
47
  case AArch64_X12:
86
47
    return AArch64_W12;
87
29
  case AArch64_X13:
88
29
    return AArch64_W13;
89
438
  case AArch64_X14:
90
438
    return AArch64_W14;
91
912
  case AArch64_X15:
92
912
    return AArch64_W15;
93
40
  case AArch64_X16:
94
40
    return AArch64_W16;
95
38
  case AArch64_X17:
96
38
    return AArch64_W17;
97
210
  case AArch64_X18:
98
210
    return AArch64_W18;
99
1.98k
  case AArch64_X19:
100
1.98k
    return AArch64_W19;
101
31
  case AArch64_X20:
102
31
    return AArch64_W20;
103
60
  case AArch64_X21:
104
60
    return AArch64_W21;
105
35
  case AArch64_X22:
106
35
    return AArch64_W22;
107
429
  case AArch64_X23:
108
429
    return AArch64_W23;
109
619
  case AArch64_X24:
110
619
    return AArch64_W24;
111
135
  case AArch64_X25:
112
135
    return AArch64_W25;
113
264
  case AArch64_X26:
114
264
    return AArch64_W26;
115
84
  case AArch64_X27:
116
84
    return AArch64_W27;
117
124
  case AArch64_X28:
118
124
    return AArch64_W28;
119
653
  case AArch64_FP:
120
653
    return AArch64_W29;
121
154
  case AArch64_LR:
122
154
    return AArch64_W30;
123
0
  case AArch64_SP:
124
0
    return AArch64_WSP;
125
376
  case AArch64_XZR:
126
376
    return AArch64_WZR;
127
9.11k
  }
128
  // For anything else, return it unchanged.
129
46
  return Reg;
130
9.11k
}
131
132
inline static unsigned getXRegFromWReg(unsigned Reg)
133
0
{
134
0
  switch (Reg) {
135
0
  case AArch64_W0:
136
0
    return AArch64_X0;
137
0
  case AArch64_W1:
138
0
    return AArch64_X1;
139
0
  case AArch64_W2:
140
0
    return AArch64_X2;
141
0
  case AArch64_W3:
142
0
    return AArch64_X3;
143
0
  case AArch64_W4:
144
0
    return AArch64_X4;
145
0
  case AArch64_W5:
146
0
    return AArch64_X5;
147
0
  case AArch64_W6:
148
0
    return AArch64_X6;
149
0
  case AArch64_W7:
150
0
    return AArch64_X7;
151
0
  case AArch64_W8:
152
0
    return AArch64_X8;
153
0
  case AArch64_W9:
154
0
    return AArch64_X9;
155
0
  case AArch64_W10:
156
0
    return AArch64_X10;
157
0
  case AArch64_W11:
158
0
    return AArch64_X11;
159
0
  case AArch64_W12:
160
0
    return AArch64_X12;
161
0
  case AArch64_W13:
162
0
    return AArch64_X13;
163
0
  case AArch64_W14:
164
0
    return AArch64_X14;
165
0
  case AArch64_W15:
166
0
    return AArch64_X15;
167
0
  case AArch64_W16:
168
0
    return AArch64_X16;
169
0
  case AArch64_W17:
170
0
    return AArch64_X17;
171
0
  case AArch64_W18:
172
0
    return AArch64_X18;
173
0
  case AArch64_W19:
174
0
    return AArch64_X19;
175
0
  case AArch64_W20:
176
0
    return AArch64_X20;
177
0
  case AArch64_W21:
178
0
    return AArch64_X21;
179
0
  case AArch64_W22:
180
0
    return AArch64_X22;
181
0
  case AArch64_W23:
182
0
    return AArch64_X23;
183
0
  case AArch64_W24:
184
0
    return AArch64_X24;
185
0
  case AArch64_W25:
186
0
    return AArch64_X25;
187
0
  case AArch64_W26:
188
0
    return AArch64_X26;
189
0
  case AArch64_W27:
190
0
    return AArch64_X27;
191
0
  case AArch64_W28:
192
0
    return AArch64_X28;
193
0
  case AArch64_W29:
194
0
    return AArch64_FP;
195
0
  case AArch64_W30:
196
0
    return AArch64_LR;
197
0
  case AArch64_WSP:
198
0
    return AArch64_SP;
199
0
  case AArch64_WZR:
200
0
    return AArch64_XZR;
201
0
  }
202
0
  // For anything else, return it unchanged.
203
0
  return Reg;
204
0
}
Unexecuted instantiation: AArch64Mapping.c:getXRegFromWReg
Unexecuted instantiation: AArch64BaseInfo.c:getXRegFromWReg
Unexecuted instantiation: AArch64Disassembler.c:getXRegFromWReg
Unexecuted instantiation: AArch64DisassemblerExtension.c:getXRegFromWReg
Unexecuted instantiation: AArch64InstPrinter.c:getXRegFromWReg
205
206
inline static unsigned getXRegFromXRegTuple(unsigned RegTuple)
207
0
{
208
0
  switch (RegTuple) {
209
0
  case AArch64_X0_X1_X2_X3_X4_X5_X6_X7:
210
0
    return AArch64_X0;
211
0
  case AArch64_X2_X3_X4_X5_X6_X7_X8_X9:
212
0
    return AArch64_X2;
213
0
  case AArch64_X4_X5_X6_X7_X8_X9_X10_X11:
214
0
    return AArch64_X4;
215
0
  case AArch64_X6_X7_X8_X9_X10_X11_X12_X13:
216
0
    return AArch64_X6;
217
0
  case AArch64_X8_X9_X10_X11_X12_X13_X14_X15:
218
0
    return AArch64_X8;
219
0
  case AArch64_X10_X11_X12_X13_X14_X15_X16_X17:
220
0
    return AArch64_X10;
221
0
  case AArch64_X12_X13_X14_X15_X16_X17_X18_X19:
222
0
    return AArch64_X12;
223
0
  case AArch64_X14_X15_X16_X17_X18_X19_X20_X21:
224
0
    return AArch64_X14;
225
0
  case AArch64_X16_X17_X18_X19_X20_X21_X22_X23:
226
0
    return AArch64_X16;
227
0
  case AArch64_X18_X19_X20_X21_X22_X23_X24_X25:
228
0
    return AArch64_X18;
229
0
  case AArch64_X20_X21_X22_X23_X24_X25_X26_X27:
230
0
    return AArch64_X20;
231
0
  case AArch64_X22_X23_X24_X25_X26_X27_X28_FP:
232
0
    return AArch64_X22;
233
0
  }
234
0
  // For anything else, return it unchanged.
235
0
  return RegTuple;
236
0
}
Unexecuted instantiation: AArch64Mapping.c:getXRegFromXRegTuple
Unexecuted instantiation: AArch64BaseInfo.c:getXRegFromXRegTuple
Unexecuted instantiation: AArch64Disassembler.c:getXRegFromXRegTuple
Unexecuted instantiation: AArch64DisassemblerExtension.c:getXRegFromXRegTuple
Unexecuted instantiation: AArch64InstPrinter.c:getXRegFromXRegTuple
237
238
static inline unsigned getBRegFromDReg(unsigned Reg)
239
0
{
240
0
  switch (Reg) {
241
0
  case AArch64_D0:
242
0
    return AArch64_B0;
243
0
  case AArch64_D1:
244
0
    return AArch64_B1;
245
0
  case AArch64_D2:
246
0
    return AArch64_B2;
247
0
  case AArch64_D3:
248
0
    return AArch64_B3;
249
0
  case AArch64_D4:
250
0
    return AArch64_B4;
251
0
  case AArch64_D5:
252
0
    return AArch64_B5;
253
0
  case AArch64_D6:
254
0
    return AArch64_B6;
255
0
  case AArch64_D7:
256
0
    return AArch64_B7;
257
0
  case AArch64_D8:
258
0
    return AArch64_B8;
259
0
  case AArch64_D9:
260
0
    return AArch64_B9;
261
0
  case AArch64_D10:
262
0
    return AArch64_B10;
263
0
  case AArch64_D11:
264
0
    return AArch64_B11;
265
0
  case AArch64_D12:
266
0
    return AArch64_B12;
267
0
  case AArch64_D13:
268
0
    return AArch64_B13;
269
0
  case AArch64_D14:
270
0
    return AArch64_B14;
271
0
  case AArch64_D15:
272
0
    return AArch64_B15;
273
0
  case AArch64_D16:
274
0
    return AArch64_B16;
275
0
  case AArch64_D17:
276
0
    return AArch64_B17;
277
0
  case AArch64_D18:
278
0
    return AArch64_B18;
279
0
  case AArch64_D19:
280
0
    return AArch64_B19;
281
0
  case AArch64_D20:
282
0
    return AArch64_B20;
283
0
  case AArch64_D21:
284
0
    return AArch64_B21;
285
0
  case AArch64_D22:
286
0
    return AArch64_B22;
287
0
  case AArch64_D23:
288
0
    return AArch64_B23;
289
0
  case AArch64_D24:
290
0
    return AArch64_B24;
291
0
  case AArch64_D25:
292
0
    return AArch64_B25;
293
0
  case AArch64_D26:
294
0
    return AArch64_B26;
295
0
  case AArch64_D27:
296
0
    return AArch64_B27;
297
0
  case AArch64_D28:
298
0
    return AArch64_B28;
299
0
  case AArch64_D29:
300
0
    return AArch64_B29;
301
0
  case AArch64_D30:
302
0
    return AArch64_B30;
303
0
  case AArch64_D31:
304
0
    return AArch64_B31;
305
0
  }
306
0
  // For anything else, return it unchanged.
307
0
  return Reg;
308
0
}
Unexecuted instantiation: AArch64Mapping.c:getBRegFromDReg
Unexecuted instantiation: AArch64BaseInfo.c:getBRegFromDReg
Unexecuted instantiation: AArch64Disassembler.c:getBRegFromDReg
Unexecuted instantiation: AArch64DisassemblerExtension.c:getBRegFromDReg
Unexecuted instantiation: AArch64InstPrinter.c:getBRegFromDReg
309
310
static inline unsigned getDRegFromBReg(unsigned Reg)
311
0
{
312
0
  switch (Reg) {
313
0
  case AArch64_B0:
314
0
    return AArch64_D0;
315
0
  case AArch64_B1:
316
0
    return AArch64_D1;
317
0
  case AArch64_B2:
318
0
    return AArch64_D2;
319
0
  case AArch64_B3:
320
0
    return AArch64_D3;
321
0
  case AArch64_B4:
322
0
    return AArch64_D4;
323
0
  case AArch64_B5:
324
0
    return AArch64_D5;
325
0
  case AArch64_B6:
326
0
    return AArch64_D6;
327
0
  case AArch64_B7:
328
0
    return AArch64_D7;
329
0
  case AArch64_B8:
330
0
    return AArch64_D8;
331
0
  case AArch64_B9:
332
0
    return AArch64_D9;
333
0
  case AArch64_B10:
334
0
    return AArch64_D10;
335
0
  case AArch64_B11:
336
0
    return AArch64_D11;
337
0
  case AArch64_B12:
338
0
    return AArch64_D12;
339
0
  case AArch64_B13:
340
0
    return AArch64_D13;
341
0
  case AArch64_B14:
342
0
    return AArch64_D14;
343
0
  case AArch64_B15:
344
0
    return AArch64_D15;
345
0
  case AArch64_B16:
346
0
    return AArch64_D16;
347
0
  case AArch64_B17:
348
0
    return AArch64_D17;
349
0
  case AArch64_B18:
350
0
    return AArch64_D18;
351
0
  case AArch64_B19:
352
0
    return AArch64_D19;
353
0
  case AArch64_B20:
354
0
    return AArch64_D20;
355
0
  case AArch64_B21:
356
0
    return AArch64_D21;
357
0
  case AArch64_B22:
358
0
    return AArch64_D22;
359
0
  case AArch64_B23:
360
0
    return AArch64_D23;
361
0
  case AArch64_B24:
362
0
    return AArch64_D24;
363
0
  case AArch64_B25:
364
0
    return AArch64_D25;
365
0
  case AArch64_B26:
366
0
    return AArch64_D26;
367
0
  case AArch64_B27:
368
0
    return AArch64_D27;
369
0
  case AArch64_B28:
370
0
    return AArch64_D28;
371
0
  case AArch64_B29:
372
0
    return AArch64_D29;
373
0
  case AArch64_B30:
374
0
    return AArch64_D30;
375
0
  case AArch64_B31:
376
0
    return AArch64_D31;
377
0
  }
378
0
  // For anything else, return it unchanged.
379
0
  return Reg;
380
0
}
Unexecuted instantiation: AArch64Mapping.c:getDRegFromBReg
Unexecuted instantiation: AArch64BaseInfo.c:getDRegFromBReg
Unexecuted instantiation: AArch64Disassembler.c:getDRegFromBReg
Unexecuted instantiation: AArch64DisassemblerExtension.c:getDRegFromBReg
Unexecuted instantiation: AArch64InstPrinter.c:getDRegFromBReg
381
382
static inline bool atomicBarrierDroppedOnZero(unsigned Opcode)
383
0
{
384
0
  switch (Opcode) {
385
0
  case AArch64_LDADDAB:
386
0
  case AArch64_LDADDAH:
387
0
  case AArch64_LDADDAW:
388
0
  case AArch64_LDADDAX:
389
0
  case AArch64_LDADDALB:
390
0
  case AArch64_LDADDALH:
391
0
  case AArch64_LDADDALW:
392
0
  case AArch64_LDADDALX:
393
0
  case AArch64_LDCLRAB:
394
0
  case AArch64_LDCLRAH:
395
0
  case AArch64_LDCLRAW:
396
0
  case AArch64_LDCLRAX:
397
0
  case AArch64_LDCLRALB:
398
0
  case AArch64_LDCLRALH:
399
0
  case AArch64_LDCLRALW:
400
0
  case AArch64_LDCLRALX:
401
0
  case AArch64_LDEORAB:
402
0
  case AArch64_LDEORAH:
403
0
  case AArch64_LDEORAW:
404
0
  case AArch64_LDEORAX:
405
0
  case AArch64_LDEORALB:
406
0
  case AArch64_LDEORALH:
407
0
  case AArch64_LDEORALW:
408
0
  case AArch64_LDEORALX:
409
0
  case AArch64_LDSETAB:
410
0
  case AArch64_LDSETAH:
411
0
  case AArch64_LDSETAW:
412
0
  case AArch64_LDSETAX:
413
0
  case AArch64_LDSETALB:
414
0
  case AArch64_LDSETALH:
415
0
  case AArch64_LDSETALW:
416
0
  case AArch64_LDSETALX:
417
0
  case AArch64_LDSMAXAB:
418
0
  case AArch64_LDSMAXAH:
419
0
  case AArch64_LDSMAXAW:
420
0
  case AArch64_LDSMAXAX:
421
0
  case AArch64_LDSMAXALB:
422
0
  case AArch64_LDSMAXALH:
423
0
  case AArch64_LDSMAXALW:
424
0
  case AArch64_LDSMAXALX:
425
0
  case AArch64_LDSMINAB:
426
0
  case AArch64_LDSMINAH:
427
0
  case AArch64_LDSMINAW:
428
0
  case AArch64_LDSMINAX:
429
0
  case AArch64_LDSMINALB:
430
0
  case AArch64_LDSMINALH:
431
0
  case AArch64_LDSMINALW:
432
0
  case AArch64_LDSMINALX:
433
0
  case AArch64_LDUMAXAB:
434
0
  case AArch64_LDUMAXAH:
435
0
  case AArch64_LDUMAXAW:
436
0
  case AArch64_LDUMAXAX:
437
0
  case AArch64_LDUMAXALB:
438
0
  case AArch64_LDUMAXALH:
439
0
  case AArch64_LDUMAXALW:
440
0
  case AArch64_LDUMAXALX:
441
0
  case AArch64_LDUMINAB:
442
0
  case AArch64_LDUMINAH:
443
0
  case AArch64_LDUMINAW:
444
0
  case AArch64_LDUMINAX:
445
0
  case AArch64_LDUMINALB:
446
0
  case AArch64_LDUMINALH:
447
0
  case AArch64_LDUMINALW:
448
0
  case AArch64_LDUMINALX:
449
0
  case AArch64_SWPAB:
450
0
  case AArch64_SWPAH:
451
0
  case AArch64_SWPAW:
452
0
  case AArch64_SWPAX:
453
0
  case AArch64_SWPALB:
454
0
  case AArch64_SWPALH:
455
0
  case AArch64_SWPALW:
456
0
  case AArch64_SWPALX:
457
0
    return true;
458
0
  }
459
0
  return false;
460
0
}
Unexecuted instantiation: AArch64Mapping.c:atomicBarrierDroppedOnZero
Unexecuted instantiation: AArch64BaseInfo.c:atomicBarrierDroppedOnZero
Unexecuted instantiation: AArch64Disassembler.c:atomicBarrierDroppedOnZero
Unexecuted instantiation: AArch64DisassemblerExtension.c:atomicBarrierDroppedOnZero
Unexecuted instantiation: AArch64InstPrinter.c:atomicBarrierDroppedOnZero
461
462
// AArch64CC namespace moved to main header aarch64.h
463
464
typedef struct SysAlias {
465
  const char *Name;
466
  aarch64_sysop_alias SysAlias;
467
  uint16_t Encoding;
468
  aarch64_insn_group FeaturesRequired[3];
469
} SysAlias;
470
471
typedef struct SysAliasReg {
472
  const char *Name;
473
  aarch64_sysop_reg SysReg;
474
  uint16_t Encoding;
475
  bool NeedsReg;
476
  aarch64_insn_group FeaturesRequired[3];
477
} SysAliasReg;
478
479
typedef struct SysAliasImm {
480
  const char *Name;
481
  aarch64_sysop_imm SysImm;
482
  uint16_t ImmValue;
483
  uint16_t Encoding;
484
  aarch64_insn_group FeaturesRequired[3];
485
} SysAliasImm;
486
487
// CS namespace begin: AArch64SVCR
488
489
#define AArch64SVCR_SVCR SysAlias
490
491
#define GET_SVCR_DECL
492
#include "AArch64GenSystemOperands.inc"
493
494
// CS namespace end: AArch64SVCR
495
496
// CS namespace begin: AArch64AT
497
498
#define AArch64AT_AT SysAlias
499
500
#define GET_AT_DECL
501
#include "AArch64GenSystemOperands.inc"
502
503
// CS namespace end: AArch64AT
504
505
// CS namespace begin: AArch64DB
506
507
#define AArch64DB_DB SysAlias
508
509
#define GET_DB_DECL
510
#include "AArch64GenSystemOperands.inc"
511
512
// CS namespace end: AArch64DB
513
514
// CS namespace begin: AArch64DBnXS
515
516
#define AArch64DBnXS_DBnXS SysAliasImm
517
518
#define GET_DBNXS_DECL
519
#include "AArch64GenSystemOperands.inc"
520
521
// CS namespace end: AArch64DBnXS
522
523
// CS namespace begin: AArch64DC
524
525
#define AArch64DC_DC SysAlias
526
527
#define GET_DC_DECL
528
#include "AArch64GenSystemOperands.inc"
529
530
// CS namespace end: AArch64DC
531
532
// CS namespace begin: AArch64IC
533
534
#define AArch64IC_IC SysAliasReg
535
536
#define GET_IC_DECL
537
#include "AArch64GenSystemOperands.inc"
538
539
// CS namespace end: AArch64IC
540
541
// CS namespace begin: AArch64ISB
542
543
#define AArch64ISB_ISB SysAlias
544
545
#define GET_ISB_DECL
546
#include "AArch64GenSystemOperands.inc"
547
548
// CS namespace end: AArch64ISB
549
550
// CS namespace begin: AArch64TSB
551
552
#define AArch64TSB_TSB SysAlias
553
554
#define GET_TSB_DECL
555
#include "AArch64GenSystemOperands.inc"
556
557
// CS namespace end: AArch64TSB
558
559
// CS namespace begin: AArch64PRFM
560
561
#define AArch64PRFM_PRFM SysAlias
562
563
#define GET_PRFM_DECL
564
#include "AArch64GenSystemOperands.inc"
565
566
// CS namespace end: AArch64PRFM
567
568
// CS namespace begin: AArch64SVEPRFM
569
570
#define AArch64SVEPRFM_SVEPRFM SysAlias
571
572
#define GET_SVEPRFM_DECL
573
#include "AArch64GenSystemOperands.inc"
574
575
// CS namespace end: AArch64SVEPRFM
576
577
// CS namespace begin: AArch64RPRFM
578
579
#define AArch64RPRFM_RPRFM SysAlias
580
581
#define GET_RPRFM_DECL
582
#include "AArch64GenSystemOperands.inc"
583
584
// CS namespace end: AArch64RPRFM
585
586
// CS namespace begin: AArch64SVEPredPattern
587
588
typedef struct SVEPREDPAT {
589
  const char *Name;
590
  aarch64_sysop_alias SysAlias;
591
  uint16_t Encoding;
592
} AArch64SVEPredPattern_SVEPREDPAT;
593
594
#define GET_SVEPREDPAT_DECL
595
#include "AArch64GenSystemOperands.inc"
596
597
// CS namespace end: AArch64SVEPredPattern
598
599
// CS namespace begin: AArch64SVEVecLenSpecifier
600
601
typedef struct SVEVECLENSPECIFIER {
602
  const char *Name;
603
  aarch64_sysop_alias SysAlias;
604
  uint16_t Encoding;
605
} AArch64SVEVecLenSpecifier_SVEVECLENSPECIFIER;
606
607
#define GET_SVEVECLENSPECIFIER_DECL
608
#include "AArch64GenSystemOperands.inc"
609
610
// CS namespace end: AArch64SVEVecLenSpecifier
611
612
// CS namespace begin: AArch64ExactFPImm
613
typedef struct ExactFPImm {
614
  const char *Name;
615
  aarch64_sysop_imm SysImm;
616
  int Enum;
617
  const char *Repr;
618
} AArch64ExactFPImm_ExactFPImm;
619
620
enum {
621
  AArch64ExactFPImm_half = 0,
622
  AArch64ExactFPImm_one = 1,
623
  AArch64ExactFPImm_two = 2,
624
  AArch64ExactFPImm_zero = 3,
625
};
626
627
#define GET_EXACTFPIMM_DECL
628
#include "AArch64GenSystemOperands.inc"
629
630
// CS namespace end: AArch64ExactFPImm
631
632
// CS namespace begin: AArch64PState
633
634
#define AArch64PState_PStateImm0_15 SysAlias
635
636
#define GET_PSTATEIMM0_15_DECL
637
#include "AArch64GenSystemOperands.inc"
638
639
#define AArch64PState_PStateImm0_1 SysAlias
640
641
#define GET_PSTATEIMM0_1_DECL
642
#include "AArch64GenSystemOperands.inc"
643
644
// CS namespace end: AArch64PState
645
646
// CS namespace begin: AArch64PSBHint
647
648
#define AArch64PSBHint_PSB SysAlias
649
650
#define GET_PSB_DECL
651
#include "AArch64GenSystemOperands.inc"
652
653
// CS namespace end: AArch64PSBHint
654
655
// CS namespace begin: AArch64BTIHint
656
657
#define AArch64BTIHint_BTI SysAlias
658
659
#define GET_BTI_DECL
660
#include "AArch64GenSystemOperands.inc"
661
662
// CS namespace end: AArch64BTIHint
663
664
// CS namespace begin: AArch64SE
665
666
typedef enum ShiftExtSpecifiers {
667
  AArch64SE_Invalid = -1,
668
  AArch64SE_LSL,
669
  AArch64SE_MSL,
670
  AArch64SE_LSR,
671
  AArch64SE_ASR,
672
  AArch64SE_ROR,
673
674
  AArch64SE_UXTB,
675
  AArch64SE_UXTH,
676
  AArch64SE_UXTW,
677
  AArch64SE_UXTX,
678
679
  AArch64SE_SXTB,
680
  AArch64SE_SXTH,
681
  AArch64SE_SXTW,
682
  AArch64SE_SXTX
683
} AArch64SE_ShiftExtSpecifiers;
684
685
// CS namespace end: AArch64SE
686
687
// CS namespace begin: AArch64Layout
688
689
// Vector layout move to aarch64.h
690
691
// CS namespace end: AArch64Layout
692
693
// CS namespace begin: AArch64SysReg
694
695
typedef struct SysReg {
696
  const char *Name;
697
  aarch64_sysop_reg SysReg;
698
  const char *AltName;
699
  aarch64_sysop_reg AliasReg;
700
  unsigned Encoding;
701
  bool Readable;
702
  bool Writeable;
703
  aarch64_insn_group FeaturesRequired[3];
704
} AArch64SysReg_SysReg;
705
706
#define GET_SYSREG_DECL
707
#include "AArch64GenSystemOperands.inc"
708
709
const AArch64SysReg_SysReg *AArch64SysReg_lookupSysRegByName(const char *Name);
710
const AArch64SysReg_SysReg *AArch64SysReg_lookupSysRegByEncoding(uint16_t Encoding);
711
7.18k
#define AARCH64_GRS_LEN 128
712
void AArch64SysReg_genericRegisterString(uint32_t Bits, char *result);
713
714
// CS namespace end: AArch64SysReg
715
716
// CS namespace begin: AArch64TLBI
717
718
#define AArch64TLBI_TLBI SysAliasReg
719
720
#define GET_TLBITable_DECL
721
#include "AArch64GenSystemOperands.inc"
722
723
// CS namespace end: AArch64TLBI
724
725
// CS namespace begin: AArch64PRCTX
726
727
#define AArch64PRCTX_PRCTX SysAliasReg
728
729
#define GET_PRCTX_DECL
730
#include "AArch64GenSystemOperands.inc"
731
732
// CS namespace end: AArch64PRCTX
733
734
// CS namespace begin: AArch64II
735
736
/// Target Operand Flag enum.
737
typedef enum TOF {
738
  //===------------------------------------------------------------------===//
739
  // AArch64 Specific MachineOperand flags.
740
741
  AArch64II_MO_NO_FLAG,
742
743
  AArch64II_MO_FRAGMENT = 0x7,
744
745
  /// MO_PAGE - A symbol operand with this flag represents the pc-relative
746
  /// offset of the 4K page containing the symbol.  This is used with the
747
  /// ADRP instruction.
748
  AArch64II_MO_PAGE = 1,
749
750
  /// MO_PAGEOFF - A symbol operand with this flag represents the offset of
751
  /// that symbol within a 4K page.  This offset is added to the page address
752
  /// to produce the complete address.
753
  AArch64II_MO_PAGEOFF = 2,
754
755
  /// MO_G3 - A symbol operand with this flag (granule 3) represents the high
756
  /// 16-bits of a 64-bit address, used in a MOVZ or MOVK instruction
757
  AArch64II_MO_G3 = 3,
758
759
  /// MO_G2 - A symbol operand with this flag (granule 2) represents the bits
760
  /// 32-47 of a 64-bit address, used in a MOVZ or MOVK instruction
761
  AArch64II_MO_G2 = 4,
762
763
  /// MO_G1 - A symbol operand with this flag (granule 1) represents the bits
764
  /// 16-31 of a 64-bit address, used in a MOVZ or MOVK instruction
765
  AArch64II_MO_G1 = 5,
766
767
  /// MO_G0 - A symbol operand with this flag (granule 0) represents the bits
768
  /// 0-15 of a 64-bit address, used in a MOVZ or MOVK instruction
769
  AArch64II_MO_G0 = 6,
770
771
  /// MO_HI12 - This flag indicates that a symbol operand represents the bits
772
  /// 13-24 of a 64-bit address, used in a arithmetic immediate-shifted-left-
773
  /// by-12-bits instruction.
774
  AArch64II_MO_HI12 = 7,
775
776
  /// MO_COFFSTUB - On a symbol operand "FOO", this indicates that the
777
  /// reference is actually to the ".refptr.FOO" symbol.  This is used for
778
  /// stub symbols on windows.
779
  AArch64II_MO_COFFSTUB = 0x8,
780
781
  /// MO_GOT - This flag indicates that a symbol operand represents the
782
  /// address of the GOT entry for the symbol, rather than the address of
783
  /// the symbol itself.
784
  AArch64II_MO_GOT = 0x10,
785
786
  /// MO_NC - Indicates whether the linker is expected to check the symbol
787
  /// reference for overflow. For example in an ADRP/ADD pair of relocations
788
  /// the ADRP usually does check, but not the ADD.
789
  AArch64II_MO_NC = 0x20,
790
791
  /// MO_TLS - Indicates that the operand being accessed is some kind of
792
  /// thread-local symbol. On Darwin, only one type of thread-local access
793
  /// exists (pre linker-relaxation), but on ELF the TLSModel used for the
794
  /// referee will affect interpretation.
795
  AArch64II_MO_TLS = 0x40,
796
797
  /// MO_DLLIMPORT - On a symbol operand, this represents that the reference
798
  /// to the symbol is for an import stub.  This is used for DLL import
799
  /// storage class indication on Windows.
800
  AArch64II_MO_DLLIMPORT = 0x80,
801
802
  /// MO_S - Indicates that the bits of the symbol operand represented by
803
  /// MO_G0 etc are signed.
804
  AArch64II_MO_S = 0x100,
805
806
  /// MO_PREL - Indicates that the bits of the symbol operand represented by
807
  /// MO_G0 etc are PC relative.
808
  AArch64II_MO_PREL = 0x200,
809
810
  /// MO_TAGGED - With MO_PAGE, indicates that the page includes a memory tag
811
  /// in bits 56-63.
812
  /// On a FrameIndex operand, indicates that the underlying memory is tagged
813
  /// with an unknown tag value (MTE); this needs to be lowered either to an
814
  /// SP-relative load or store instruction (which do not check tags), or to
815
  /// an LDG instruction to obtain the tag value.
816
  AArch64II_MO_TAGGED = 0x400,
817
818
  /// MO_DLLIMPORTAUX - Symbol refers to "auxilliary" import stub. On
819
  /// Arm64EC, there are two kinds of import stubs used for DLL import of
820
  /// functions: MO_DLLIMPORT refers to natively callable Arm64 code, and
821
  /// MO_DLLIMPORTAUX refers to the original address which can be compared
822
  /// for equality.
823
  AArch64II_MO_DLLIMPORTAUX = 0x800,
824
} AArch64II_TOF;
825
826
// end namespace AArch64II
827
828
//===----------------------------------------------------------------------===//
829
// v8.3a Pointer Authentication
830
//
831
832
typedef enum ID {
833
  AArch64PACKey_IA = 0,
834
  AArch64PACKey_IB = 1,
835
  AArch64PACKey_DA = 2,
836
  AArch64PACKey_DB = 3,
837
  AArch64PACKey_LAST = AArch64PACKey_DB
838
} AArch64PACKey_ID;
839
840
// namespace AArch64PACKey
841
842
/// Return 2-letter identifier string for numeric key ID.
843
inline static const char *AArch64PACKeyIDToString(AArch64PACKey_ID KeyID)
844
0
{
845
0
  switch (KeyID) {
846
0
  case AArch64PACKey_IA:
847
0
    return "ia";
848
0
  case AArch64PACKey_IB:
849
0
    return "ib";
850
0
  case AArch64PACKey_DA:
851
0
    return "da";
852
0
  case AArch64PACKey_DB:
853
0
    return "db";
854
0
  }
855
0
}
Unexecuted instantiation: AArch64Mapping.c:AArch64PACKeyIDToString
Unexecuted instantiation: AArch64BaseInfo.c:AArch64PACKeyIDToString
Unexecuted instantiation: AArch64Disassembler.c:AArch64PACKeyIDToString
Unexecuted instantiation: AArch64DisassemblerExtension.c:AArch64PACKeyIDToString
Unexecuted instantiation: AArch64InstPrinter.c:AArch64PACKeyIDToString
856
857
/// Return numeric key ID for 2-letter identifier string.
858
inline static AArch64PACKey_ID
859
AArch64StringToPACKeyID(const char *Name)
860
0
{
861
0
  if (strcmp(Name, "ia") == 0)
862
0
    return AArch64PACKey_IA;
863
0
  if (strcmp(Name, "ib") == 0)
864
0
    return AArch64PACKey_IB;
865
0
  if (strcmp(Name, "da") == 0)
866
0
    return AArch64PACKey_DA;
867
0
  if (strcmp(Name, "db") == 0)
868
0
    return AArch64PACKey_DB;
869
0
  assert(0 && "Invalid PAC key");
870
0
}
Unexecuted instantiation: AArch64Mapping.c:AArch64StringToPACKeyID
Unexecuted instantiation: AArch64BaseInfo.c:AArch64StringToPACKeyID
Unexecuted instantiation: AArch64Disassembler.c:AArch64StringToPACKeyID
Unexecuted instantiation: AArch64DisassemblerExtension.c:AArch64StringToPACKeyID
Unexecuted instantiation: AArch64InstPrinter.c:AArch64StringToPACKeyID
871
872
// end namespace AArch64
873
// end namespace llvm
874
875
#endif