Coverage Report

Created: 2023-12-08 06:05

/src/capstonenext/arch/AArch64/AArch64InstPrinter.h
Line
Count
Source
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
//===-- AArch64InstPrinter.h - Convert AArch64 MCInst to assembly syntax --===//
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 class prints an AArch64 MCInst to a .s file.
24
//
25
//===----------------------------------------------------------------------===//
26
27
#ifndef LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64INSTPRINTER_H
28
#define LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64INSTPRINTER_H
29
30
#include <capstone/platform.h>
31
#include <stdio.h>
32
#include <stdlib.h>
33
#include <string.h>
34
35
#include "AArch64Mapping.h"
36
37
#include "../../MCInst.h"
38
#include "../../MCInstPrinter.h"
39
#include "../../MCRegisterInfo.h"
40
#include "../../SStream.h"
41
#include "../../utils.h"
42
43
13.4k
#define CONCAT(a, b) CONCAT_(a, b)
44
13.4k
#define CONCAT_(a, b) a##_##b
45
583k
#define CHAR(c) #c[0]
46
47
void printInst(MCInst *MI, uint64_t Address, const char *Annot,
48
         SStream *O);
49
void printRegName(SStream *OS, unsigned Reg);
50
void printRegNameAlt(SStream *OS, unsigned Reg, unsigned AltIdx);
51
// Autogenerated by tblgen.
52
const char *getRegName(unsigned Reg);
53
bool printSysAlias(MCInst *MI, SStream *O);
54
bool printSyspAlias(MCInst *MI, SStream *O);
55
bool printRangePrefetchAlias(MCInst *MI, SStream *O, const char *Annot);
56
// Operand printers
57
void printOperand(MCInst *MI, unsigned OpNo, SStream *O);
58
void printImm(MCInst *MI, unsigned OpNo, SStream *O);
59
void printImmHex(MCInst *MI, unsigned OpNo, SStream *O);
60
#define DECLARE_printSImm(Size) \
61
  void CONCAT(printSImm, Size)(MCInst * MI, unsigned OpNo, SStream *O);
62
DECLARE_printSImm(16);
63
DECLARE_printSImm(8);
64
65
#define DECLARE_printImmSVE(T) \
66
  void CONCAT(printImmSVE, T)(T Val, SStream *O);
67
DECLARE_printImmSVE(int16_t);
68
DECLARE_printImmSVE(int8_t);
69
DECLARE_printImmSVE(int64_t);
70
DECLARE_printImmSVE(int32_t);
71
DECLARE_printImmSVE(uint16_t);
72
DECLARE_printImmSVE(uint8_t);
73
DECLARE_printImmSVE(uint64_t);
74
DECLARE_printImmSVE(uint32_t);
75
76
void printPostIncOperand(MCInst *MI, unsigned OpNo, unsigned Imm, SStream *O);
77
#define DEFINE_printPostIncOperand(Amount) \
78
  static inline void CONCAT(printPostIncOperand, Amount)(MCInst * MI, unsigned OpNo, \
79
                       SStream *O) \
80
5.61k
  { \
81
5.61k
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
5.61k
    printPostIncOperand(MI, OpNo, Amount, O); \
83
5.61k
  }
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_64
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_32
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_16
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_8
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_1
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_4
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_2
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_48
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_24
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_3
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_12
Unexecuted instantiation: AArch64Module.c:printPostIncOperand_6
AArch64InstPrinter.c:printPostIncOperand_64
Line
Count
Source
80
98
  { \
81
98
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
98
    printPostIncOperand(MI, OpNo, Amount, O); \
83
98
  }
AArch64InstPrinter.c:printPostIncOperand_32
Line
Count
Source
80
1.02k
  { \
81
1.02k
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
1.02k
    printPostIncOperand(MI, OpNo, Amount, O); \
83
1.02k
  }
AArch64InstPrinter.c:printPostIncOperand_16
Line
Count
Source
80
1.19k
  { \
81
1.19k
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
1.19k
    printPostIncOperand(MI, OpNo, Amount, O); \
83
1.19k
  }
AArch64InstPrinter.c:printPostIncOperand_8
Line
Count
Source
80
770
  { \
81
770
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
770
    printPostIncOperand(MI, OpNo, Amount, O); \
83
770
  }
AArch64InstPrinter.c:printPostIncOperand_1
Line
Count
Source
80
333
  { \
81
333
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
333
    printPostIncOperand(MI, OpNo, Amount, O); \
83
333
  }
AArch64InstPrinter.c:printPostIncOperand_4
Line
Count
Source
80
524
  { \
81
524
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
524
    printPostIncOperand(MI, OpNo, Amount, O); \
83
524
  }
AArch64InstPrinter.c:printPostIncOperand_2
Line
Count
Source
80
583
  { \
81
583
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
583
    printPostIncOperand(MI, OpNo, Amount, O); \
83
583
  }
AArch64InstPrinter.c:printPostIncOperand_48
Line
Count
Source
80
55
  { \
81
55
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
55
    printPostIncOperand(MI, OpNo, Amount, O); \
83
55
  }
AArch64InstPrinter.c:printPostIncOperand_24
Line
Count
Source
80
790
  { \
81
790
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
790
    printPostIncOperand(MI, OpNo, Amount, O); \
83
790
  }
AArch64InstPrinter.c:printPostIncOperand_3
Line
Count
Source
80
112
  { \
81
112
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
112
    printPostIncOperand(MI, OpNo, Amount, O); \
83
112
  }
AArch64InstPrinter.c:printPostIncOperand_12
Line
Count
Source
80
41
  { \
81
41
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
41
    printPostIncOperand(MI, OpNo, Amount, O); \
83
41
  }
AArch64InstPrinter.c:printPostIncOperand_6
Line
Count
Source
80
86
  { \
81
86
    add_cs_detail(MI, CONCAT(AArch64_OP_GROUP_PostIncOperand, Amount), OpNo, Amount); \
82
86
    printPostIncOperand(MI, OpNo, Amount, O); \
83
86
  }
84
DEFINE_printPostIncOperand(64);
85
DEFINE_printPostIncOperand(32);
86
DEFINE_printPostIncOperand(16);
87
DEFINE_printPostIncOperand(8);
88
DEFINE_printPostIncOperand(1);
89
DEFINE_printPostIncOperand(4);
90
DEFINE_printPostIncOperand(2);
91
DEFINE_printPostIncOperand(48);
92
DEFINE_printPostIncOperand(24);
93
DEFINE_printPostIncOperand(3);
94
DEFINE_printPostIncOperand(12);
95
DEFINE_printPostIncOperand(6);
96
97
void printVRegOperand(MCInst *MI, unsigned OpNo, SStream *O);
98
void printSysCROperand(MCInst *MI, unsigned OpNo, SStream *O);
99
void printAddSubImm(MCInst *MI, unsigned OpNum, SStream *O);
100
#define DECLARE_printLogicalImm(T) \
101
  void CONCAT(printLogicalImm, T)(MCInst * MI, unsigned OpNum, SStream *O);
102
DECLARE_printLogicalImm(int64_t);
103
DECLARE_printLogicalImm(int32_t);
104
DECLARE_printLogicalImm(int8_t);
105
DECLARE_printLogicalImm(int16_t);
106
107
void printShifter(MCInst *MI, unsigned OpNum, SStream *O);
108
void printShiftedRegister(MCInst *MI, unsigned OpNum, SStream *O);
109
void printExtendedRegister(MCInst *MI, unsigned OpNum, SStream *O);
110
void printArithExtend(MCInst *MI, unsigned OpNum, SStream *O);
111
112
void printMemExtend(MCInst *MI, unsigned OpNum, SStream *O, char SrcRegKind,
113
          unsigned Width);
114
void printMemExtend(MCInst *MI, unsigned OpNum, SStream *O, char SrcRegKind,
115
          unsigned Width);
116
#define DEFINE_printMemExtend(SrcRegKind, Width) \
117
  static inline void CONCAT(printMemExtend, CONCAT(SrcRegKind, Width))( \
118
    MCInst * MI, unsigned OpNum, SStream *O) \
119
1.52k
  { \
120
1.52k
    add_cs_detail(MI, \
121
1.52k
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
1.52k
                 SrcRegKind), \
123
1.52k
              Width), \
124
1.52k
      OpNum, CHAR(SrcRegKind), Width); \
125
1.52k
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
1.52k
  }
Unexecuted instantiation: AArch64Module.c:printMemExtend_w_8
Unexecuted instantiation: AArch64Module.c:printMemExtend_x_8
Unexecuted instantiation: AArch64Module.c:printMemExtend_w_64
Unexecuted instantiation: AArch64Module.c:printMemExtend_x_64
Unexecuted instantiation: AArch64Module.c:printMemExtend_w_16
Unexecuted instantiation: AArch64Module.c:printMemExtend_x_16
Unexecuted instantiation: AArch64Module.c:printMemExtend_w_128
Unexecuted instantiation: AArch64Module.c:printMemExtend_x_128
Unexecuted instantiation: AArch64Module.c:printMemExtend_w_32
Unexecuted instantiation: AArch64Module.c:printMemExtend_x_32
AArch64InstPrinter.c:printMemExtend_w_8
Line
Count
Source
119
53
  { \
120
53
    add_cs_detail(MI, \
121
53
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
53
                 SrcRegKind), \
123
53
              Width), \
124
53
      OpNum, CHAR(SrcRegKind), Width); \
125
53
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
53
  }
AArch64InstPrinter.c:printMemExtend_x_8
Line
Count
Source
119
64
  { \
120
64
    add_cs_detail(MI, \
121
64
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
64
                 SrcRegKind), \
123
64
              Width), \
124
64
      OpNum, CHAR(SrcRegKind), Width); \
125
64
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
64
  }
AArch64InstPrinter.c:printMemExtend_w_64
Line
Count
Source
119
236
  { \
120
236
    add_cs_detail(MI, \
121
236
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
236
                 SrcRegKind), \
123
236
              Width), \
124
236
      OpNum, CHAR(SrcRegKind), Width); \
125
236
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
236
  }
AArch64InstPrinter.c:printMemExtend_x_64
Line
Count
Source
119
236
  { \
120
236
    add_cs_detail(MI, \
121
236
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
236
                 SrcRegKind), \
123
236
              Width), \
124
236
      OpNum, CHAR(SrcRegKind), Width); \
125
236
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
236
  }
AArch64InstPrinter.c:printMemExtend_w_16
Line
Count
Source
119
87
  { \
120
87
    add_cs_detail(MI, \
121
87
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
87
                 SrcRegKind), \
123
87
              Width), \
124
87
      OpNum, CHAR(SrcRegKind), Width); \
125
87
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
87
  }
AArch64InstPrinter.c:printMemExtend_x_16
Line
Count
Source
119
762
  { \
120
762
    add_cs_detail(MI, \
121
762
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
762
                 SrcRegKind), \
123
762
              Width), \
124
762
      OpNum, CHAR(SrcRegKind), Width); \
125
762
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
762
  }
AArch64InstPrinter.c:printMemExtend_w_128
Line
Count
Source
119
14
  { \
120
14
    add_cs_detail(MI, \
121
14
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
14
                 SrcRegKind), \
123
14
              Width), \
124
14
      OpNum, CHAR(SrcRegKind), Width); \
125
14
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
14
  }
AArch64InstPrinter.c:printMemExtend_x_128
Line
Count
Source
119
11
  { \
120
11
    add_cs_detail(MI, \
121
11
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
11
                 SrcRegKind), \
123
11
              Width), \
124
11
      OpNum, CHAR(SrcRegKind), Width); \
125
11
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
11
  }
AArch64InstPrinter.c:printMemExtend_w_32
Line
Count
Source
119
45
  { \
120
45
    add_cs_detail(MI, \
121
45
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
45
                 SrcRegKind), \
123
45
              Width), \
124
45
      OpNum, CHAR(SrcRegKind), Width); \
125
45
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
45
  }
AArch64InstPrinter.c:printMemExtend_x_32
Line
Count
Source
119
18
  { \
120
18
    add_cs_detail(MI, \
121
18
      CONCAT(CONCAT(AArch64_OP_GROUP_MemExtend, \
122
18
                 SrcRegKind), \
123
18
              Width), \
124
18
      OpNum, CHAR(SrcRegKind), Width); \
125
18
    printMemExtend(MI, OpNum, O, CHAR(SrcRegKind), Width); \
126
18
  }
127
DEFINE_printMemExtend(w, 8);
128
DEFINE_printMemExtend(x, 8);
129
DEFINE_printMemExtend(w, 64);
130
DEFINE_printMemExtend(x, 64);
131
DEFINE_printMemExtend(w, 16);
132
DEFINE_printMemExtend(x, 16);
133
DEFINE_printMemExtend(w, 128);
134
DEFINE_printMemExtend(x, 128);
135
DEFINE_printMemExtend(w, 32);
136
DEFINE_printMemExtend(x, 32);
137
138
#define DECLARE_printRegWithShiftExtend(SignedExtend, ExtWidth, SrcRegKind, \
139
                    Suffix) \
140
  void CONCAT( \
141
    printRegWithShiftExtend, \
142
    CONCAT(SignedExtend, CONCAT(ExtWidth, CONCAT(SrcRegKind, Suffix))))( \
143
    MCInst * MI, unsigned OpNum, SStream *O);
144
DECLARE_printRegWithShiftExtend(false, 8, x, d);
145
DECLARE_printRegWithShiftExtend(true, 8, w, d);
146
DECLARE_printRegWithShiftExtend(false, 8, w, d);
147
DECLARE_printRegWithShiftExtend(false, 8, x, 0);
148
DECLARE_printRegWithShiftExtend(true, 8, w, s);
149
DECLARE_printRegWithShiftExtend(false, 8, w, s);
150
DECLARE_printRegWithShiftExtend(false, 64, x, d);
151
DECLARE_printRegWithShiftExtend(true, 64, w, d);
152
DECLARE_printRegWithShiftExtend(false, 64, w, d);
153
DECLARE_printRegWithShiftExtend(false, 64, x, 0);
154
DECLARE_printRegWithShiftExtend(true, 64, w, s);
155
DECLARE_printRegWithShiftExtend(false, 64, w, s);
156
DECLARE_printRegWithShiftExtend(false, 16, x, d);
157
DECLARE_printRegWithShiftExtend(true, 16, w, d);
158
DECLARE_printRegWithShiftExtend(false, 16, w, d);
159
DECLARE_printRegWithShiftExtend(false, 16, x, 0);
160
DECLARE_printRegWithShiftExtend(true, 16, w, s);
161
DECLARE_printRegWithShiftExtend(false, 16, w, s);
162
DECLARE_printRegWithShiftExtend(false, 32, x, d);
163
DECLARE_printRegWithShiftExtend(true, 32, w, d);
164
DECLARE_printRegWithShiftExtend(false, 32, w, d);
165
DECLARE_printRegWithShiftExtend(false, 32, x, 0);
166
DECLARE_printRegWithShiftExtend(true, 32, w, s);
167
DECLARE_printRegWithShiftExtend(false, 32, w, s);
168
DECLARE_printRegWithShiftExtend(false, 8, x, s);
169
DECLARE_printRegWithShiftExtend(false, 16, x, s);
170
DECLARE_printRegWithShiftExtend(false, 32, x, s);
171
DECLARE_printRegWithShiftExtend(false, 64, x, s);
172
DECLARE_printRegWithShiftExtend(false, 128, x, 0);
173
174
void printCondCode(MCInst *MI, unsigned OpNum, SStream *O);
175
void printInverseCondCode(MCInst *MI, unsigned OpNum, SStream *O);
176
void printAlignedLabel(MCInst *MI, uint64_t Address, unsigned OpNum,
177
             SStream *O);
178
void printUImm12Offset(MCInst *MI, unsigned OpNum, unsigned Scale, SStream *O);
179
void printAMIndexedWB(MCInst *MI, unsigned OpNum, unsigned Scale, SStream *O);
180
#define DEFINE_printUImm12Offset(Scale) \
181
  static inline void CONCAT(printUImm12Offset, Scale)(MCInst * MI, unsigned OpNum, \
182
                      SStream *O) \
183
6.34k
  { \
184
6.34k
    add_cs_detail( \
185
6.34k
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
6.34k
      OpNum, Scale); \
187
6.34k
    printUImm12Offset(MI, OpNum, Scale, O); \
188
6.34k
  }
Unexecuted instantiation: AArch64Module.c:printUImm12Offset_1
Unexecuted instantiation: AArch64Module.c:printUImm12Offset_8
Unexecuted instantiation: AArch64Module.c:printUImm12Offset_2
Unexecuted instantiation: AArch64Module.c:printUImm12Offset_16
Unexecuted instantiation: AArch64Module.c:printUImm12Offset_4
AArch64InstPrinter.c:printUImm12Offset_1
Line
Count
Source
183
1.75k
  { \
184
1.75k
    add_cs_detail( \
185
1.75k
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
1.75k
      OpNum, Scale); \
187
1.75k
    printUImm12Offset(MI, OpNum, Scale, O); \
188
1.75k
  }
AArch64InstPrinter.c:printUImm12Offset_8
Line
Count
Source
183
1.04k
  { \
184
1.04k
    add_cs_detail( \
185
1.04k
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
1.04k
      OpNum, Scale); \
187
1.04k
    printUImm12Offset(MI, OpNum, Scale, O); \
188
1.04k
  }
AArch64InstPrinter.c:printUImm12Offset_2
Line
Count
Source
183
2.68k
  { \
184
2.68k
    add_cs_detail( \
185
2.68k
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
2.68k
      OpNum, Scale); \
187
2.68k
    printUImm12Offset(MI, OpNum, Scale, O); \
188
2.68k
  }
AArch64InstPrinter.c:printUImm12Offset_16
Line
Count
Source
183
155
  { \
184
155
    add_cs_detail( \
185
155
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
155
      OpNum, Scale); \
187
155
    printUImm12Offset(MI, OpNum, Scale, O); \
188
155
  }
AArch64InstPrinter.c:printUImm12Offset_4
Line
Count
Source
183
702
  { \
184
702
    add_cs_detail( \
185
702
      MI, CONCAT(AArch64_OP_GROUP_UImm12Offset, Scale), \
186
702
      OpNum, Scale); \
187
702
    printUImm12Offset(MI, OpNum, Scale, O); \
188
702
  }
189
DEFINE_printUImm12Offset(1);
190
DEFINE_printUImm12Offset(8);
191
DEFINE_printUImm12Offset(2);
192
DEFINE_printUImm12Offset(16);
193
DEFINE_printUImm12Offset(4);
194
195
void printAMNoIndex(MCInst *MI, unsigned OpNum, SStream *O);
196
#define DECLARE_printImmScale(Scale) \
197
  void CONCAT(printImmScale, Scale)(MCInst * MI, unsigned OpNum, SStream *O);
198
DECLARE_printImmScale(8);
199
DECLARE_printImmScale(2);
200
DECLARE_printImmScale(4);
201
DECLARE_printImmScale(16);
202
DECLARE_printImmScale(32);
203
DECLARE_printImmScale(3);
204
205
#define DECLARE_printImmRangeScale(Scale, Offset) \
206
  void CONCAT(printImmRangeScale, CONCAT(Scale, Offset))( \
207
    MCInst * MI, unsigned OpNum, SStream *O);
208
DECLARE_printImmRangeScale(2, 1);
209
DECLARE_printImmRangeScale(4, 3);
210
211
#define DECLARE_printPrefetchOp(IsSVEPrefetch) \
212
  void CONCAT(printPrefetchOp, IsSVEPrefetch)( \
213
    MCInst * MI, unsigned OpNum, SStream *O);
214
DECLARE_printPrefetchOp(true);
215
DECLARE_printPrefetchOp(false);
216
217
void printRPRFMOperand(MCInst *MI, unsigned OpNum, SStream *O);
218
void printPSBHintOp(MCInst *MI, unsigned OpNum, SStream *O);
219
void printBTIHintOp(MCInst *MI, unsigned OpNum, SStream *O);
220
void printVectorList(MCInst *MI, unsigned OpNum, SStream *O,
221
           const char *LayoutSuffix);
222
void printMatrixTileList(MCInst *MI, unsigned OpNum, SStream *O);
223
/// (i.e. attached to the instruction rather than the registers).
224
/// Print a list of vector registers where the type suffix is implicit
225
void printImplicitlyTypedVectorList(MCInst *MI, unsigned OpNum, SStream *O);
226
#define DECLARE_printTypedVectorList(NumLanes, LaneKind) \
227
  void CONCAT(printTypedVectorList, CONCAT(NumLanes, LaneKind))( \
228
    MCInst * MI, unsigned OpNum, SStream *O);
229
DECLARE_printTypedVectorList(0, b);
230
DECLARE_printTypedVectorList(0, d);
231
DECLARE_printTypedVectorList(0, h);
232
DECLARE_printTypedVectorList(0, s);
233
DECLARE_printTypedVectorList(0, q);
234
DECLARE_printTypedVectorList(16, b);
235
DECLARE_printTypedVectorList(1, d);
236
DECLARE_printTypedVectorList(2, d);
237
DECLARE_printTypedVectorList(2, s);
238
DECLARE_printTypedVectorList(4, h);
239
DECLARE_printTypedVectorList(4, s);
240
DECLARE_printTypedVectorList(8, b);
241
DECLARE_printTypedVectorList(8, h);
242
243
#define DECLARE_printVectorIndex(Scale) \
244
  void CONCAT(printVectorIndex, \
245
        Scale)(MCInst * MI, unsigned OpNum, SStream *O);
246
DECLARE_printVectorIndex(1);
247
DECLARE_printVectorIndex(8);
248
249
void printMatrixIndex(MCInst *MI, unsigned OpNum, SStream *O);
250
void printAdrLabel(MCInst *MI, uint64_t Address, unsigned OpNum, SStream *O);
251
void printAdrpLabel(MCInst *MI, uint64_t Address, unsigned OpNum, SStream *O);
252
void printBarrierOption(MCInst *MI, unsigned OpNum, SStream *O);
253
void printBarriernXSOption(MCInst *MI, unsigned OpNum, SStream *O);
254
void printMSRSystemRegister(MCInst *MI, unsigned OpNum, SStream *O);
255
void printMRSSystemRegister(MCInst *MI, unsigned OpNum, SStream *O);
256
void printSystemPStateField(MCInst *MI, unsigned OpNum, SStream *O);
257
void printSIMDType10Operand(MCInst *MI, unsigned OpNum, SStream *O);
258
#define DECLARE_printPredicateAsCounter(EltSize) \
259
  void CONCAT(printPredicateAsCounter, EltSize)(MCInst * MI, unsigned OpNum, \
260
                          SStream *O);
261
DECLARE_printPredicateAsCounter(8);
262
DECLARE_printPredicateAsCounter(64);
263
DECLARE_printPredicateAsCounter(16);
264
DECLARE_printPredicateAsCounter(32);
265
DECLARE_printPredicateAsCounter(0);
266
267
#define DECLARE_printGPRSeqPairsClassOperand(size) \
268
  void CONCAT(printGPRSeqPairsClassOperand, \
269
        size)(MCInst * MI, unsigned OpNum, SStream *O);
270
DECLARE_printGPRSeqPairsClassOperand(32);
271
DECLARE_printGPRSeqPairsClassOperand(64);
272
273
#define DECLARE_printImm8OptLsl(T) \
274
  void CONCAT(printImm8OptLsl, T)(MCInst * MI, unsigned OpNum, SStream *O);
275
DECLARE_printImm8OptLsl(int16_t);
276
DECLARE_printImm8OptLsl(int8_t);
277
DECLARE_printImm8OptLsl(int64_t);
278
DECLARE_printImm8OptLsl(int32_t);
279
DECLARE_printImm8OptLsl(uint16_t);
280
DECLARE_printImm8OptLsl(uint8_t);
281
DECLARE_printImm8OptLsl(uint64_t);
282
DECLARE_printImm8OptLsl(uint32_t);
283
284
#define DECLARE_printSVELogicalImm(T) \
285
  void CONCAT(printSVELogicalImm, T)(MCInst * MI, unsigned OpNum, SStream *O);
286
DECLARE_printSVELogicalImm(int16_t);
287
DECLARE_printSVELogicalImm(int32_t);
288
DECLARE_printSVELogicalImm(int64_t);
289
290
void printSVEPattern(MCInst *MI, unsigned OpNum, SStream *O);
291
void printSVEVecLenSpecifier(MCInst *MI, unsigned OpNum, SStream *O);
292
#define DECLARE_printMatrixTileVector(IsVertical) \
293
  void CONCAT(printMatrixTileVector, \
294
        IsVertical)(MCInst * MI, unsigned OpNum, SStream *O);
295
DECLARE_printMatrixTileVector(0);
296
DECLARE_printMatrixTileVector(1);
297
298
void printMatrixTile(MCInst *MI, unsigned OpNum, SStream *O);
299
#define DECLARE_printMatrix(EltSize) \
300
  void CONCAT(printMatrix, EltSize)(MCInst * MI, unsigned OpNum, SStream *O);
301
DECLARE_printMatrix(64);
302
DECLARE_printMatrix(32);
303
DECLARE_printMatrix(16);
304
DECLARE_printMatrix(0);
305
306
void printSVCROp(MCInst *MI, unsigned OpNum, SStream *O);
307
#define DECLARE_printSVERegOp(char) \
308
  void CONCAT(printSVERegOp, char)(MCInst * MI, unsigned OpNum, \
309
                     SStream *O);
310
DECLARE_printSVERegOp(b);
311
DECLARE_printSVERegOp(d);
312
DECLARE_printSVERegOp(h);
313
DECLARE_printSVERegOp(s);
314
DECLARE_printSVERegOp(0);
315
DECLARE_printSVERegOp(q);
316
317
void printGPR64as32(MCInst *MI, unsigned OpNum, SStream *O);
318
void printGPR64x8(MCInst *MI, unsigned OpNum, SStream *O);
319
void printSyspXzrPair(MCInst *MI, unsigned OpNum, SStream *O);
320
#define DECLARE_printZPRasFPR(Width) \
321
  void CONCAT(printZPRasFPR, Width)(MCInst * MI, unsigned OpNum, SStream *O);
322
DECLARE_printZPRasFPR(8);
323
DECLARE_printZPRasFPR(64);
324
DECLARE_printZPRasFPR(16);
325
DECLARE_printZPRasFPR(32);
326
DECLARE_printZPRasFPR(128);
327
328
#define DECLARE_printExactFPImm(ImmIs0, ImmIs1) \
329
  void CONCAT(printExactFPImm, CONCAT(ImmIs0, ImmIs1))( \
330
    MCInst * MI, unsigned OpNum, SStream *O);
331
DECLARE_printExactFPImm(AArch64ExactFPImm_half, AArch64ExactFPImm_one);
332
DECLARE_printExactFPImm(AArch64ExactFPImm_zero, AArch64ExactFPImm_one);
333
DECLARE_printExactFPImm(AArch64ExactFPImm_half, AArch64ExactFPImm_two);
334
335
;
336
337
// end namespace llvm
338
339
#endif // LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64INSTPRINTER_H