LLVM 20.0.0git
X86InstPrinterCommon.cpp
Go to the documentation of this file.
1//===--- X86InstPrinterCommon.cpp - X86 assembly instruction printing -----===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file includes common code for rendering MCInst instances as Intel-style
10// and Intel-style assembly.
11//
12//===----------------------------------------------------------------------===//
13
15#include "X86BaseInfo.h"
16#include "llvm/MC/MCAsmInfo.h"
17#include "llvm/MC/MCExpr.h"
18#include "llvm/MC/MCInst.h"
19#include "llvm/MC/MCInstrDesc.h"
20#include "llvm/MC/MCInstrInfo.h"
24#include <cassert>
25#include <cstdint>
26
27using namespace llvm;
28
30 raw_ostream &O) {
31 int64_t Imm = MI->getOperand(Op).getImm();
32 unsigned Opc = MI->getOpcode();
33 bool IsCCMPOrCTEST = X86::isCCMPCC(Opc) || X86::isCTESTCC(Opc);
34
35 // clang-format off
36 switch (Imm) {
37 default: llvm_unreachable("Invalid condcode argument!");
38 case 0: O << "o"; break;
39 case 1: O << "no"; break;
40 case 2: O << "b"; break;
41 case 3: O << "ae"; break;
42 case 4: O << "e"; break;
43 case 5: O << "ne"; break;
44 case 6: O << "be"; break;
45 case 7: O << "a"; break;
46 case 8: O << "s"; break;
47 case 9: O << "ns"; break;
48 case 0xa: O << (IsCCMPOrCTEST ? "t" : "p"); break;
49 case 0xb: O << (IsCCMPOrCTEST ? "f" : "np"); break;
50 case 0xc: O << "l"; break;
51 case 0xd: O << "ge"; break;
52 case 0xe: O << "le"; break;
53 case 0xf: O << "g"; break;
54 }
55 // clang-format on
56}
57
59 raw_ostream &O) {
60 // +----+----+----+----+
61 // | OF | SF | ZF | CF |
62 // +----+----+----+----+
63 int64_t Imm = MI->getOperand(Op).getImm();
64 assert(Imm >= 0 && Imm < 16 && "Invalid condition flags");
65 O << "{dfv=";
66 std::string Flags;
67 if (Imm & 0x8)
68 Flags += "of,";
69 if (Imm & 0x4)
70 Flags += "sf,";
71 if (Imm & 0x2)
72 Flags += "zf,";
73 if (Imm & 0x1)
74 Flags += "cf,";
75 StringRef SimplifiedFlags = StringRef(Flags).rtrim(",");
76 O << SimplifiedFlags << "}";
77}
78
80 raw_ostream &O) {
81 int64_t Imm = MI->getOperand(Op).getImm();
82 switch (Imm) {
83 default: llvm_unreachable("Invalid ssecc/avxcc argument!");
84 case 0: O << "eq"; break;
85 case 1: O << "lt"; break;
86 case 2: O << "le"; break;
87 case 3: O << "unord"; break;
88 case 4: O << "neq"; break;
89 case 5: O << "nlt"; break;
90 case 6: O << "nle"; break;
91 case 7: O << "ord"; break;
92 case 8: O << "eq_uq"; break;
93 case 9: O << "nge"; break;
94 case 0xa: O << "ngt"; break;
95 case 0xb: O << "false"; break;
96 case 0xc: O << "neq_oq"; break;
97 case 0xd: O << "ge"; break;
98 case 0xe: O << "gt"; break;
99 case 0xf: O << "true"; break;
100 case 0x10: O << "eq_os"; break;
101 case 0x11: O << "lt_oq"; break;
102 case 0x12: O << "le_oq"; break;
103 case 0x13: O << "unord_s"; break;
104 case 0x14: O << "neq_us"; break;
105 case 0x15: O << "nlt_uq"; break;
106 case 0x16: O << "nle_uq"; break;
107 case 0x17: O << "ord_s"; break;
108 case 0x18: O << "eq_us"; break;
109 case 0x19: O << "nge_uq"; break;
110 case 0x1a: O << "ngt_uq"; break;
111 case 0x1b: O << "false_os"; break;
112 case 0x1c: O << "neq_os"; break;
113 case 0x1d: O << "ge_oq"; break;
114 case 0x1e: O << "gt_oq"; break;
115 case 0x1f: O << "true_us"; break;
116 }
117}
118
120 raw_ostream &OS) {
121 OS << "vpcom";
122
123 int64_t Imm = MI->getOperand(MI->getNumOperands() - 1).getImm();
124 switch (Imm) {
125 default: llvm_unreachable("Invalid vpcom argument!");
126 case 0: OS << "lt"; break;
127 case 1: OS << "le"; break;
128 case 2: OS << "gt"; break;
129 case 3: OS << "ge"; break;
130 case 4: OS << "eq"; break;
131 case 5: OS << "neq"; break;
132 case 6: OS << "false"; break;
133 case 7: OS << "true"; break;
134 }
135
136 switch (MI->getOpcode()) {
137 default: llvm_unreachable("Unexpected opcode!");
138 case X86::VPCOMBmi: case X86::VPCOMBri: OS << "b\t"; break;
139 case X86::VPCOMDmi: case X86::VPCOMDri: OS << "d\t"; break;
140 case X86::VPCOMQmi: case X86::VPCOMQri: OS << "q\t"; break;
141 case X86::VPCOMUBmi: case X86::VPCOMUBri: OS << "ub\t"; break;
142 case X86::VPCOMUDmi: case X86::VPCOMUDri: OS << "ud\t"; break;
143 case X86::VPCOMUQmi: case X86::VPCOMUQri: OS << "uq\t"; break;
144 case X86::VPCOMUWmi: case X86::VPCOMUWri: OS << "uw\t"; break;
145 case X86::VPCOMWmi: case X86::VPCOMWri: OS << "w\t"; break;
146 }
147}
148
150 raw_ostream &OS) {
151 OS << "vpcmp";
152
153 printSSEAVXCC(MI, MI->getNumOperands() - 1, OS);
154
155 switch (MI->getOpcode()) {
156 default: llvm_unreachable("Unexpected opcode!");
157 case X86::VPCMPBZ128rmi: case X86::VPCMPBZ128rri:
158 case X86::VPCMPBZ256rmi: case X86::VPCMPBZ256rri:
159 case X86::VPCMPBZrmi: case X86::VPCMPBZrri:
160 case X86::VPCMPBZ128rmik: case X86::VPCMPBZ128rrik:
161 case X86::VPCMPBZ256rmik: case X86::VPCMPBZ256rrik:
162 case X86::VPCMPBZrmik: case X86::VPCMPBZrrik:
163 OS << "b\t";
164 break;
165 case X86::VPCMPDZ128rmi: case X86::VPCMPDZ128rri:
166 case X86::VPCMPDZ256rmi: case X86::VPCMPDZ256rri:
167 case X86::VPCMPDZrmi: case X86::VPCMPDZrri:
168 case X86::VPCMPDZ128rmik: case X86::VPCMPDZ128rrik:
169 case X86::VPCMPDZ256rmik: case X86::VPCMPDZ256rrik:
170 case X86::VPCMPDZrmik: case X86::VPCMPDZrrik:
171 case X86::VPCMPDZ128rmib: case X86::VPCMPDZ128rmibk:
172 case X86::VPCMPDZ256rmib: case X86::VPCMPDZ256rmibk:
173 case X86::VPCMPDZrmib: case X86::VPCMPDZrmibk:
174 OS << "d\t";
175 break;
176 case X86::VPCMPQZ128rmi: case X86::VPCMPQZ128rri:
177 case X86::VPCMPQZ256rmi: case X86::VPCMPQZ256rri:
178 case X86::VPCMPQZrmi: case X86::VPCMPQZrri:
179 case X86::VPCMPQZ128rmik: case X86::VPCMPQZ128rrik:
180 case X86::VPCMPQZ256rmik: case X86::VPCMPQZ256rrik:
181 case X86::VPCMPQZrmik: case X86::VPCMPQZrrik:
182 case X86::VPCMPQZ128rmib: case X86::VPCMPQZ128rmibk:
183 case X86::VPCMPQZ256rmib: case X86::VPCMPQZ256rmibk:
184 case X86::VPCMPQZrmib: case X86::VPCMPQZrmibk:
185 OS << "q\t";
186 break;
187 case X86::VPCMPUBZ128rmi: case X86::VPCMPUBZ128rri:
188 case X86::VPCMPUBZ256rmi: case X86::VPCMPUBZ256rri:
189 case X86::VPCMPUBZrmi: case X86::VPCMPUBZrri:
190 case X86::VPCMPUBZ128rmik: case X86::VPCMPUBZ128rrik:
191 case X86::VPCMPUBZ256rmik: case X86::VPCMPUBZ256rrik:
192 case X86::VPCMPUBZrmik: case X86::VPCMPUBZrrik:
193 OS << "ub\t";
194 break;
195 case X86::VPCMPUDZ128rmi: case X86::VPCMPUDZ128rri:
196 case X86::VPCMPUDZ256rmi: case X86::VPCMPUDZ256rri:
197 case X86::VPCMPUDZrmi: case X86::VPCMPUDZrri:
198 case X86::VPCMPUDZ128rmik: case X86::VPCMPUDZ128rrik:
199 case X86::VPCMPUDZ256rmik: case X86::VPCMPUDZ256rrik:
200 case X86::VPCMPUDZrmik: case X86::VPCMPUDZrrik:
201 case X86::VPCMPUDZ128rmib: case X86::VPCMPUDZ128rmibk:
202 case X86::VPCMPUDZ256rmib: case X86::VPCMPUDZ256rmibk:
203 case X86::VPCMPUDZrmib: case X86::VPCMPUDZrmibk:
204 OS << "ud\t";
205 break;
206 case X86::VPCMPUQZ128rmi: case X86::VPCMPUQZ128rri:
207 case X86::VPCMPUQZ256rmi: case X86::VPCMPUQZ256rri:
208 case X86::VPCMPUQZrmi: case X86::VPCMPUQZrri:
209 case X86::VPCMPUQZ128rmik: case X86::VPCMPUQZ128rrik:
210 case X86::VPCMPUQZ256rmik: case X86::VPCMPUQZ256rrik:
211 case X86::VPCMPUQZrmik: case X86::VPCMPUQZrrik:
212 case X86::VPCMPUQZ128rmib: case X86::VPCMPUQZ128rmibk:
213 case X86::VPCMPUQZ256rmib: case X86::VPCMPUQZ256rmibk:
214 case X86::VPCMPUQZrmib: case X86::VPCMPUQZrmibk:
215 OS << "uq\t";
216 break;
217 case X86::VPCMPUWZ128rmi: case X86::VPCMPUWZ128rri:
218 case X86::VPCMPUWZ256rri: case X86::VPCMPUWZ256rmi:
219 case X86::VPCMPUWZrmi: case X86::VPCMPUWZrri:
220 case X86::VPCMPUWZ128rmik: case X86::VPCMPUWZ128rrik:
221 case X86::VPCMPUWZ256rrik: case X86::VPCMPUWZ256rmik:
222 case X86::VPCMPUWZrmik: case X86::VPCMPUWZrrik:
223 OS << "uw\t";
224 break;
225 case X86::VPCMPWZ128rmi: case X86::VPCMPWZ128rri:
226 case X86::VPCMPWZ256rmi: case X86::VPCMPWZ256rri:
227 case X86::VPCMPWZrmi: case X86::VPCMPWZrri:
228 case X86::VPCMPWZ128rmik: case X86::VPCMPWZ128rrik:
229 case X86::VPCMPWZ256rmik: case X86::VPCMPWZ256rrik:
230 case X86::VPCMPWZrmik: case X86::VPCMPWZrrik:
231 OS << "w\t";
232 break;
233 }
234}
235
237 raw_ostream &OS) {
238 OS << (IsVCmp ? "vcmp" : "cmp");
239
240 printSSEAVXCC(MI, MI->getNumOperands() - 1, OS);
241
242 switch (MI->getOpcode()) {
243 default: llvm_unreachable("Unexpected opcode!");
244 case X86::CMPPDrmi: case X86::CMPPDrri:
245 case X86::VCMPPDrmi: case X86::VCMPPDrri:
246 case X86::VCMPPDYrmi: case X86::VCMPPDYrri:
247 case X86::VCMPPDZ128rmi: case X86::VCMPPDZ128rri:
248 case X86::VCMPPDZ256rmi: case X86::VCMPPDZ256rri:
249 case X86::VCMPPDZrmi: case X86::VCMPPDZrri:
250 case X86::VCMPPDZ128rmik: case X86::VCMPPDZ128rrik:
251 case X86::VCMPPDZ256rmik: case X86::VCMPPDZ256rrik:
252 case X86::VCMPPDZrmik: case X86::VCMPPDZrrik:
253 case X86::VCMPPDZ128rmbi: case X86::VCMPPDZ128rmbik:
254 case X86::VCMPPDZ256rmbi: case X86::VCMPPDZ256rmbik:
255 case X86::VCMPPDZrmbi: case X86::VCMPPDZrmbik:
256 case X86::VCMPPDZrrib: case X86::VCMPPDZrribk:
257 OS << "pd\t";
258 break;
259 case X86::CMPPSrmi: case X86::CMPPSrri:
260 case X86::VCMPPSrmi: case X86::VCMPPSrri:
261 case X86::VCMPPSYrmi: case X86::VCMPPSYrri:
262 case X86::VCMPPSZ128rmi: case X86::VCMPPSZ128rri:
263 case X86::VCMPPSZ256rmi: case X86::VCMPPSZ256rri:
264 case X86::VCMPPSZrmi: case X86::VCMPPSZrri:
265 case X86::VCMPPSZ128rmik: case X86::VCMPPSZ128rrik:
266 case X86::VCMPPSZ256rmik: case X86::VCMPPSZ256rrik:
267 case X86::VCMPPSZrmik: case X86::VCMPPSZrrik:
268 case X86::VCMPPSZ128rmbi: case X86::VCMPPSZ128rmbik:
269 case X86::VCMPPSZ256rmbi: case X86::VCMPPSZ256rmbik:
270 case X86::VCMPPSZrmbi: case X86::VCMPPSZrmbik:
271 case X86::VCMPPSZrrib: case X86::VCMPPSZrribk:
272 OS << "ps\t";
273 break;
274 case X86::CMPSDrmi: case X86::CMPSDrri:
275 case X86::CMPSDrmi_Int: case X86::CMPSDrri_Int:
276 case X86::VCMPSDrmi: case X86::VCMPSDrri:
277 case X86::VCMPSDrmi_Int: case X86::VCMPSDrri_Int:
278 case X86::VCMPSDZrmi: case X86::VCMPSDZrri:
279 case X86::VCMPSDZrmi_Int: case X86::VCMPSDZrri_Int:
280 case X86::VCMPSDZrmi_Intk: case X86::VCMPSDZrri_Intk:
281 case X86::VCMPSDZrrib_Int: case X86::VCMPSDZrrib_Intk:
282 OS << "sd\t";
283 break;
284 case X86::CMPSSrmi: case X86::CMPSSrri:
285 case X86::CMPSSrmi_Int: case X86::CMPSSrri_Int:
286 case X86::VCMPSSrmi: case X86::VCMPSSrri:
287 case X86::VCMPSSrmi_Int: case X86::VCMPSSrri_Int:
288 case X86::VCMPSSZrmi: case X86::VCMPSSZrri:
289 case X86::VCMPSSZrmi_Int: case X86::VCMPSSZrri_Int:
290 case X86::VCMPSSZrmi_Intk: case X86::VCMPSSZrri_Intk:
291 case X86::VCMPSSZrrib_Int: case X86::VCMPSSZrrib_Intk:
292 OS << "ss\t";
293 break;
294 case X86::VCMPPHZ128rmi: case X86::VCMPPHZ128rri:
295 case X86::VCMPPHZ256rmi: case X86::VCMPPHZ256rri:
296 case X86::VCMPPHZrmi: case X86::VCMPPHZrri:
297 case X86::VCMPPHZ128rmik: case X86::VCMPPHZ128rrik:
298 case X86::VCMPPHZ256rmik: case X86::VCMPPHZ256rrik:
299 case X86::VCMPPHZrmik: case X86::VCMPPHZrrik:
300 case X86::VCMPPHZ128rmbi: case X86::VCMPPHZ128rmbik:
301 case X86::VCMPPHZ256rmbi: case X86::VCMPPHZ256rmbik:
302 case X86::VCMPPHZrmbi: case X86::VCMPPHZrmbik:
303 case X86::VCMPPHZrrib: case X86::VCMPPHZrribk:
304 OS << "ph\t";
305 break;
306 case X86::VCMPSHZrmi: case X86::VCMPSHZrri:
307 case X86::VCMPSHZrmi_Int: case X86::VCMPSHZrri_Int:
308 case X86::VCMPSHZrrib_Int: case X86::VCMPSHZrrib_Intk:
309 case X86::VCMPSHZrmi_Intk: case X86::VCMPSHZrri_Intk:
310 OS << "sh\t";
311 break;
312 }
313}
314
316 raw_ostream &O) {
317 int64_t Imm = MI->getOperand(Op).getImm();
318 switch (Imm) {
319 default:
320 llvm_unreachable("Invalid rounding control!");
322 O << "{rn-sae}";
323 break;
324 case X86::TO_NEG_INF:
325 O << "{rd-sae}";
326 break;
327 case X86::TO_POS_INF:
328 O << "{ru-sae}";
329 break;
330 case X86::TO_ZERO:
331 O << "{rz-sae}";
332 break;
333 }
334}
335
336/// value (e.g. for jumps and calls). In Intel-style these print slightly
337/// differently than normal immediates. For example, a $ is not emitted.
338///
339/// \p Address The address of the next instruction.
340/// \see MCInstPrinter::printInst
342 unsigned OpNo, raw_ostream &O) {
343 // Do not print the numberic target address when symbolizing.
345 return;
346
347 const MCOperand &Op = MI->getOperand(OpNo);
348 if (Op.isImm()) {
350 uint64_t Target = Address + Op.getImm();
351 if (MAI.getCodePointerSize() == 4)
352 Target &= 0xffffffff;
354 } else
355 markup(O, Markup::Immediate) << formatImm(Op.getImm());
356 } else {
357 assert(Op.isExpr() && "unknown pcrel immediate operand");
358 // If a symbolic branch target was added as a constant expression then print
359 // that address in hex.
360 const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr());
361 int64_t Address;
362 if (BranchTarget && BranchTarget->evaluateAsAbsolute(Address)) {
364 } else {
365 // Otherwise, just print the expression.
366 Op.getExpr()->print(O, &MAI);
367 }
368 }
369}
370
372 raw_ostream &O) {
373 if (MI->getOperand(OpNo).getReg()) {
374 printOperand(MI, OpNo, O);
375 O << ':';
376 }
377}
378
380 const MCSubtargetInfo &STI) {
381 const MCInstrDesc &Desc = MII.get(MI->getOpcode());
382 uint64_t TSFlags = Desc.TSFlags;
383 unsigned Flags = MI->getFlags();
384
385 if ((TSFlags & X86II::LOCK) || (Flags & X86::IP_HAS_LOCK))
386 O << "\tlock\t";
387
388 if ((TSFlags & X86II::NOTRACK) || (Flags & X86::IP_HAS_NOTRACK))
389 O << "\tnotrack\t";
390
391 if (Flags & X86::IP_HAS_REPEAT_NE)
392 O << "\trepne\t";
393 else if (Flags & X86::IP_HAS_REPEAT)
394 O << "\trep\t";
395
396 if (TSFlags & X86II::EVEX_NF && !X86::isCFCMOVCC(MI->getOpcode()))
397 O << "\t{nf}";
398
399 // These all require a pseudo prefix
400 if ((Flags & X86::IP_USE_VEX) ||
402 O << "\t{vex}";
403 else if (Flags & X86::IP_USE_VEX2)
404 O << "\t{vex2}";
405 else if (Flags & X86::IP_USE_VEX3)
406 O << "\t{vex3}";
407 else if ((Flags & X86::IP_USE_EVEX) ||
409 O << "\t{evex}";
410
411 if (Flags & X86::IP_USE_DISP8)
412 O << "\t{disp8}";
413 else if (Flags & X86::IP_USE_DISP32)
414 O << "\t{disp32}";
415
416 // Determine where the memory operand starts, if present
417 int MemoryOperand = X86II::getMemoryOperandNo(TSFlags);
418 if (MemoryOperand != -1)
419 MemoryOperand += X86II::getOperandBias(Desc);
420
421 // Address-Size override prefix
422 if (Flags & X86::IP_HAS_AD_SIZE &&
423 !X86_MC::needsAddressSizeOverride(*MI, STI, MemoryOperand, TSFlags)) {
424 if (STI.hasFeature(X86::Is16Bit) || STI.hasFeature(X86::Is64Bit))
425 O << "\taddr32\t";
426 else if (STI.hasFeature(X86::Is32Bit))
427 O << "\taddr16\t";
428 }
429}
430
431void X86InstPrinterCommon::printVKPair(const MCInst *MI, unsigned OpNo,
432 raw_ostream &OS) {
433 // In assembly listings, a pair is represented by one of its members, any
434 // of the two. Here, we pick k0, k2, k4, k6, but we could as well
435 // print K2_K3 as "k3". It would probably make a lot more sense, if
436 // the assembly would look something like:
437 // "vp2intersect %zmm5, %zmm7, {%k2, %k3}"
438 // but this can work too.
439 switch (MI->getOperand(OpNo).getReg()) {
440 case X86::K0_K1:
441 printRegName(OS, X86::K0);
442 return;
443 case X86::K2_K3:
444 printRegName(OS, X86::K2);
445 return;
446 case X86::K4_K5:
447 printRegName(OS, X86::K4);
448 return;
449 case X86::K6_K7:
450 printRegName(OS, X86::K6);
451 return;
452 }
453 llvm_unreachable("Unknown mask pair register name");
454}
IRTranslator LLVM IR MI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
This class represents an Operation in the Expression.
bool print(raw_ostream &OS, DIDumpOptions DumpOpts, const DWARFExpression *Expr, DWARFUnit *U) const
unsigned getCodePointerSize() const
Get the code pointer size in bytes.
Definition: MCAsmInfo.h:518
format_object< int64_t > formatHex(int64_t Value) const
const MCInstrInfo & MII
Definition: MCInstPrinter.h:52
bool SymbolizeOperands
If true, symbolize branch target and memory reference operands.
Definition: MCInstPrinter.h:77
virtual void printRegName(raw_ostream &OS, MCRegister Reg) const
Print the assembler register name.
WithMarkup markup(raw_ostream &OS, Markup M) const
const MCAsmInfo & MAI
Definition: MCInstPrinter.h:51
format_object< int64_t > formatImm(int64_t Value) const
Utility function to print immediates in decimal or hex.
bool PrintBranchImmAsAddress
If true, a branch immediate (e.g.
Definition: MCInstPrinter.h:74
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
Describe properties that are true of each instruction in the target description file.
Definition: MCInstrDesc.h:198
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Definition: MCInstrInfo.h:63
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:36
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
StringRef rtrim(char Char) const
Return string with consecutive Char characters starting from the right removed.
Definition: StringRef.h:788
Target - Wrapper for Target specific information.
void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &O)
void printPCRelImm(const MCInst *MI, uint64_t Address, unsigned OpNo, raw_ostream &O)
value (e.g.
void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O)
void printVPCOMMnemonic(const MCInst *MI, raw_ostream &OS)
void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printVKPair(const MCInst *MI, unsigned OpNo, raw_ostream &OS)
virtual void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O)=0
void printCondCode(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printCondFlags(const MCInst *MI, unsigned Op, raw_ostream &OS)
void printCMPMnemonic(const MCInst *MI, bool IsVCmp, raw_ostream &OS)
void printInstFlags(const MCInst *MI, raw_ostream &O, const MCSubtargetInfo &STI)
void printVPCMPMnemonic(const MCInst *MI, raw_ostream &OS)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
int getMemoryOperandNo(uint64_t TSFlags)
Definition: X86BaseInfo.h:1011
unsigned getOperandBias(const MCInstrDesc &Desc)
Compute whether all of the def operands are repeated in the uses and therefore should be skipped.
Definition: X86BaseInfo.h:968
@ ExplicitEVEXPrefix
For instructions that are promoted to EVEX space for EGPR.
Definition: X86BaseInfo.h:868
@ ExplicitVEXPrefix
For instructions that use VEX encoding only when {vex}, {vex2} or {vex3} is present.
Definition: X86BaseInfo.h:866
@ ExplicitOpPrefixMask
Definition: X86BaseInfo.h:869
bool needsAddressSizeOverride(const MCInst &MI, const MCSubtargetInfo &STI, int MemoryOperand, uint64_t TSFlags)
Returns true if this instruction needs an Address-Size override prefix.
@ TO_NEAREST_INT
Definition: X86BaseInfo.h:42
@ IP_HAS_NOTRACK
Definition: X86BaseInfo.h:58
@ IP_USE_DISP8
Definition: X86BaseInfo.h:65
@ IP_HAS_AD_SIZE
Definition: X86BaseInfo.h:54
@ IP_HAS_REPEAT
Definition: X86BaseInfo.h:56
@ IP_USE_DISP32
Definition: X86BaseInfo.h:66
@ IP_HAS_REPEAT_NE
Definition: X86BaseInfo.h:55
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Description of the encoding of one expression Op.