LLVM  15.0.0git
SystemZTargetStreamer.h
Go to the documentation of this file.
1 //=- SystemZTargetStreamer.h - SystemZ Target Streamer ----------*- C++ -*-===//
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 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETSTREAMER_H
10 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETSTREAMER_H
11 
12 #include "llvm/ADT/StringRef.h"
13 #include "llvm/MC/MCInst.h"
14 #include "llvm/MC/MCStreamer.h"
15 
16 namespace llvm {
17 
19 public:
21 
22  typedef std::pair<MCInst, const MCSubtargetInfo *> MCInstSTIPair;
23  struct CmpMCInst {
24  bool operator()(const MCInstSTIPair &MCI_STI_A,
25  const MCInstSTIPair &MCI_STI_B) const {
26  if (MCI_STI_A.second != MCI_STI_B.second)
27  return uintptr_t(MCI_STI_A.second) < uintptr_t(MCI_STI_B.second);
28  const MCInst &A = MCI_STI_A.first;
29  const MCInst &B = MCI_STI_B.first;
30  assert(A.getNumOperands() == B.getNumOperands() &&
31  A.getNumOperands() == 5 && A.getOperand(2).getImm() == 1 &&
32  B.getOperand(2).getImm() == 1 && "Unexpected EXRL target MCInst");
33  if (A.getOpcode() != B.getOpcode())
34  return A.getOpcode() < B.getOpcode();
35  if (A.getOperand(0).getReg() != B.getOperand(0).getReg())
36  return A.getOperand(0).getReg() < B.getOperand(0).getReg();
37  if (A.getOperand(1).getImm() != B.getOperand(1).getImm())
38  return A.getOperand(1).getImm() < B.getOperand(1).getImm();
39  if (A.getOperand(3).getReg() != B.getOperand(3).getReg())
40  return A.getOperand(3).getReg() < B.getOperand(3).getReg();
41  if (A.getOperand(4).getImm() != B.getOperand(4).getImm())
42  return A.getOperand(4).getImm() < B.getOperand(4).getImm();
43  return false;
44  }
45  };
46  typedef std::map<MCInstSTIPair, MCSymbol *, CmpMCInst> EXRLT2SymMap;
48 
49  void emitConstantPools() override;
50 
51  virtual void emitMachine(StringRef CPU) = 0;
52 };
53 
54 } // end namespace llvm
55 
56 #endif // LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZTARGETSTREAMER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
StringRef.h
llvm::SystemZTargetStreamer
Definition: SystemZTargetStreamer.h:18
llvm::SystemZTargetStreamer::emitMachine
virtual void emitMachine(StringRef CPU)=0
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:212
llvm::SystemZTargetStreamer::emitConstantPools
void emitConstantPools() override
Definition: SystemZMCTargetDesc.cpp:191
MCInst.h
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::MCTargetStreamer
Target specific streamer interface.
Definition: MCStreamer.h:93
llvm::SystemZTargetStreamer::MCInstSTIPair
std::pair< MCInst, const MCSubtargetInfo * > MCInstSTIPair
Definition: SystemZTargetStreamer.h:22
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::SystemZTargetStreamer::CmpMCInst::operator()
bool operator()(const MCInstSTIPair &MCI_STI_A, const MCInstSTIPair &MCI_STI_B) const
Definition: SystemZTargetStreamer.h:24
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::SystemZTargetStreamer::EXRLTargets2Sym
EXRLT2SymMap EXRLTargets2Sym
Definition: SystemZTargetStreamer.h:47
llvm::SystemZTargetStreamer::EXRLT2SymMap
std::map< MCInstSTIPair, MCSymbol *, CmpMCInst > EXRLT2SymMap
Definition: SystemZTargetStreamer.h:46
MCStreamer.h
llvm::SystemZTargetStreamer::CmpMCInst
Definition: SystemZTargetStreamer.h:23
llvm::SystemZTargetStreamer::SystemZTargetStreamer
SystemZTargetStreamer(MCStreamer &S)
Definition: SystemZTargetStreamer.h:20