LLVM: lib/Target/VE/MCTargetDesc/VEInstPrinter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

14#include "VE.h"

22

23using namespace llvm;

24

25#define DEBUG_TYPE "ve-asmprinter"

26

27#define GET_INSTRUCTION_NAME

28#define PRINT_ALIAS_INSTR

29#include "VEGenAsmWriter.inc"

30

32

33 unsigned AltIdx = VE::AsmName;

34

35 if (MRI.getRegClass(VE::MISCRegClassID).contains(Reg))

36 AltIdx = VE::NoRegAltName;

38}

39

47

50 const MCOperand &MO = MI->getOperand(OpNum);

51

54 return;

55 }

56

58

59 int32_t TruncatedImm = static_cast<int32_t>(MO.getImm());

60 O << TruncatedImm;

61 return;

62 }

63

64 assert(MO.isExpr() && "Unknown operand kind in printOperand");

66}

67

71 if (MI->getOperand(OpNum + 2).isImm() &&

72 MI->getOperand(OpNum + 2).getImm() == 0) {

73

74 } else {

76 }

77 if (MI->getOperand(OpNum + 1).isImm() &&

78 MI->getOperand(OpNum + 1).getImm() == 0 &&

79 MI->getOperand(OpNum).isImm() && MI->getOperand(OpNum).getImm() == 0) {

80 if (MI->getOperand(OpNum + 2).isImm() &&

81 MI->getOperand(OpNum + 2).getImm() == 0) {

82 O << "0";

83 } else {

84

85 }

86 } else {

87 O << "(";

88 if (MI->getOperand(OpNum + 1).isImm() &&

89 MI->getOperand(OpNum + 1).getImm() == 0) {

90

91 } else {

93 }

94 if (MI->getOperand(OpNum).isImm() && MI->getOperand(OpNum).getImm() == 0) {

95

96 } else {

97 O << ", ";

99 }

100 O << ")";

101 }

102}

103

107 if (MI->getOperand(OpNum + 1).isImm() &&

108 MI->getOperand(OpNum + 1).getImm() == 0) {

109

110 } else {

112 }

113 if (MI->getOperand(OpNum).isImm() && MI->getOperand(OpNum).getImm() == 0) {

114 if (MI->getOperand(OpNum + 1).isImm() &&

115 MI->getOperand(OpNum + 1).getImm() == 0) {

116 O << "0";

117 } else {

118

119 }

120 } else {

121 O << "(, ";

123 O << ")";

124 }

125}

126

130 if (MI->getOperand(OpNum + 1).isImm() &&

131 MI->getOperand(OpNum + 1).getImm() == 0) {

132

133 } else {

135 }

136 if (MI->getOperand(OpNum).isImm() && MI->getOperand(OpNum).getImm() == 0) {

137 if (MI->getOperand(OpNum + 1).isImm() &&

138 MI->getOperand(OpNum + 1).getImm() == 0) {

139 O << "0";

140 } else {

141

142 }

143 } else {

144 O << "(";

146 O << ")";

147 }

148}

149

153 if (MI->getOperand(OpNum + 1).isImm() &&

154 MI->getOperand(OpNum + 1).getImm() == 0) {

155

156 } else {

158 }

159 O << "(";

160 if (MI->getOperand(OpNum).isReg())

162 O << ")";

163}

164

168 int MImm = (int)MI->getOperand(OpNum).getImm() & 0x7f;

169 if (MImm > 63)

170 O << "(" << MImm - 64 << ")0";

171 else

172 O << "(" << MImm << ")1";

173}

174

177 int CC = (int)MI->getOperand(OpNum).getImm();

179}

180

183 int RD = (int)MI->getOperand(OpNum).getImm();

185}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

const MCRegisterInfo & MRI

void printAnnotation(raw_ostream &OS, StringRef Annot)

Utility function for printing annotations.

Instances of this class represent a single low-level machine instruction.

Instances of this class represent operands of the MCInst class.

MCRegister getReg() const

Returns the register number.

const MCExpr * getExpr() const

Wrapper class representing physical registers. Should be passed by value.

Generic base class for all target subtargets.

StringRef - Represent a constant reference to a string, i.e.

void printMemASOperandHM(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:150

void printMImmOperand(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:165

void printRegName(raw_ostream &OS, MCRegister Reg) override

Print the assembler register name.

Definition VEInstPrinter.cpp:31

bool printAliasInstr(const MCInst *, uint64_t Address, const MCSubtargetInfo &, raw_ostream &)

void printOperand(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:48

void printMemASOperandASX(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:104

void printRDOperand(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:181

void printMemASOperandRRM(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:127

void printCCOperand(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:175

void printMemASXOperand(const MCInst *MI, int OpNum, const MCSubtargetInfo &STI, raw_ostream &OS)

Definition VEInstPrinter.cpp:68

static const char * getRegisterName(MCRegister Reg, unsigned AltIdx=VE::NoRegAltName)

void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &OS) override

Print the specified MCInst to the specified raw_ostream.

Definition VEInstPrinter.cpp:40

void printInstruction(const MCInst *, uint64_t, const MCSubtargetInfo &, raw_ostream &)

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

static const char * VECondCodeToString(VECC::CondCode CC)

static const char * VERDToString(VERD::RoundingMode R)