Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 1 | //===-- PPCMCCodeEmitter.cpp - Convert PPC code to machine code -----------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file implements the PPCMCCodeEmitter class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #define DEBUG_TYPE "mccodeemitter" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 15 | #include "MCTargetDesc/PPCMCTargetDesc.h" |
Evan Cheng | 61d4a20 | 2011-07-25 19:53:23 +0000 | [diff] [blame] | 16 | #include "MCTargetDesc/PPCFixupKinds.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 17 | #include "llvm/ADT/Statistic.h" |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 18 | #include "llvm/MC/MCCodeEmitter.h" |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 19 | #include "llvm/MC/MCContext.h" |
Bill Schmidt | c56f1d3 | 2012-12-11 20:30:11 +0000 | [diff] [blame] | 20 | #include "llvm/MC/MCExpr.h" |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 21 | #include "llvm/MC/MCInst.h" |
Adhemerval Zanella | f2aceda | 2012-10-25 12:27:42 +0000 | [diff] [blame] | 22 | #include "llvm/MC/MCInstrInfo.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 23 | #include "llvm/MC/MCSubtargetInfo.h" |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 24 | #include "llvm/Support/ErrorHandling.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 25 | #include "llvm/Support/raw_ostream.h" |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 26 | using namespace llvm; |
| 27 | |
| 28 | STATISTIC(MCNumEmitted, "Number of MC instructions emitted"); |
| 29 | |
| 30 | namespace { |
| 31 | class PPCMCCodeEmitter : public MCCodeEmitter { |
Craig Topper | a60c0f1 | 2012-09-15 17:09:36 +0000 | [diff] [blame] | 32 | PPCMCCodeEmitter(const PPCMCCodeEmitter &) LLVM_DELETED_FUNCTION; |
| 33 | void operator=(const PPCMCCodeEmitter &) LLVM_DELETED_FUNCTION; |
| 34 | |
Adhemerval Zanella | f2aceda | 2012-10-25 12:27:42 +0000 | [diff] [blame] | 35 | const MCSubtargetInfo &STI; |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 36 | const MCContext &CTX; |
Adhemerval Zanella | f2aceda | 2012-10-25 12:27:42 +0000 | [diff] [blame] | 37 | Triple TT; |
| 38 | |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 39 | public: |
Evan Cheng | c5e6d2f | 2011-07-11 03:57:24 +0000 | [diff] [blame] | 40 | PPCMCCodeEmitter(const MCInstrInfo &mcii, const MCSubtargetInfo &sti, |
Adhemerval Zanella | f2aceda | 2012-10-25 12:27:42 +0000 | [diff] [blame] | 41 | MCContext &ctx) |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 42 | : STI(sti), CTX(ctx), TT(STI.getTargetTriple()) { |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | ~PPCMCCodeEmitter() {} |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 46 | |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 47 | unsigned getDirectBrEncoding(const MCInst &MI, unsigned OpNo, |
| 48 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 49 | unsigned getCondBrEncoding(const MCInst &MI, unsigned OpNo, |
| 50 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 51 | unsigned getHA16Encoding(const MCInst &MI, unsigned OpNo, |
| 52 | SmallVectorImpl<MCFixup> &Fixups) const; |
| 53 | unsigned getLO16Encoding(const MCInst &MI, unsigned OpNo, |
| 54 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | efacb9e | 2010-11-15 08:22:03 +0000 | [diff] [blame] | 55 | unsigned getMemRIEncoding(const MCInst &MI, unsigned OpNo, |
| 56 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 57 | unsigned getMemRIXEncoding(const MCInst &MI, unsigned OpNo, |
| 58 | SmallVectorImpl<MCFixup> &Fixups) const; |
Bill Schmidt | ca4a0c9 | 2012-12-04 16:18:08 +0000 | [diff] [blame] | 59 | unsigned getTLSRegEncoding(const MCInst &MI, unsigned OpNo, |
| 60 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 61 | unsigned get_crbitm_encoding(const MCInst &MI, unsigned OpNo, |
| 62 | SmallVectorImpl<MCFixup> &Fixups) const; |
| 63 | |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 64 | /// getMachineOpValue - Return binary encoding of operand. If the machine |
| 65 | /// operand requires relocation, record the relocation and return zero. |
| 66 | unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO, |
| 67 | SmallVectorImpl<MCFixup> &Fixups) const; |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 68 | |
| 69 | // getBinaryCodeForInstr - TableGen'erated function for getting the |
| 70 | // binary encoding for an instruction. |
Owen Anderson | d845d9d | 2012-01-24 18:37:29 +0000 | [diff] [blame] | 71 | uint64_t getBinaryCodeForInstr(const MCInst &MI, |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 72 | SmallVectorImpl<MCFixup> &Fixups) const; |
| 73 | void EncodeInstruction(const MCInst &MI, raw_ostream &OS, |
| 74 | SmallVectorImpl<MCFixup> &Fixups) const { |
Adhemerval Zanella | 1be10dc | 2012-10-25 14:29:13 +0000 | [diff] [blame] | 75 | uint64_t Bits = getBinaryCodeForInstr(MI, Fixups); |
| 76 | |
Ulrich Weigand | f62e83f | 2013-03-22 15:24:13 +0000 | [diff] [blame] | 77 | // BL8_NOP etc. all have a size of 8 because of the following 'nop'. |
Adhemerval Zanella | 1be10dc | 2012-10-25 14:29:13 +0000 | [diff] [blame] | 78 | unsigned Size = 4; // FIXME: Have Desc.getSize() return the correct value! |
| 79 | unsigned Opcode = MI.getOpcode(); |
Ulrich Weigand | f62e83f | 2013-03-22 15:24:13 +0000 | [diff] [blame] | 80 | if (Opcode == PPC::BL8_NOP || Opcode == PPC::BLA8_NOP || |
| 81 | Opcode == PPC::BL8_NOP_TLSGD || Opcode == PPC::BL8_NOP_TLSLD) |
Adhemerval Zanella | 1be10dc | 2012-10-25 14:29:13 +0000 | [diff] [blame] | 82 | Size = 8; |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 83 | |
| 84 | // Output the constant in big endian byte order. |
Adhemerval Zanella | 1be10dc | 2012-10-25 14:29:13 +0000 | [diff] [blame] | 85 | int ShiftValue = (Size * 8) - 8; |
| 86 | for (unsigned i = 0; i != Size; ++i) { |
| 87 | OS << (char)(Bits >> ShiftValue); |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 88 | Bits <<= 8; |
| 89 | } |
| 90 | |
| 91 | ++MCNumEmitted; // Keep track of the # of mi's emitted. |
| 92 | } |
| 93 | |
| 94 | }; |
| 95 | |
| 96 | } // end anonymous namespace |
| 97 | |
Evan Cheng | c5e6d2f | 2011-07-11 03:57:24 +0000 | [diff] [blame] | 98 | MCCodeEmitter *llvm::createPPCMCCodeEmitter(const MCInstrInfo &MCII, |
Jim Grosbach | c3b0427 | 2012-05-15 17:35:52 +0000 | [diff] [blame] | 99 | const MCRegisterInfo &MRI, |
Evan Cheng | c5e6d2f | 2011-07-11 03:57:24 +0000 | [diff] [blame] | 100 | const MCSubtargetInfo &STI, |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 101 | MCContext &Ctx) { |
Evan Cheng | c5e6d2f | 2011-07-11 03:57:24 +0000 | [diff] [blame] | 102 | return new PPCMCCodeEmitter(MCII, STI, Ctx); |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | unsigned PPCMCCodeEmitter:: |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 106 | getDirectBrEncoding(const MCInst &MI, unsigned OpNo, |
| 107 | SmallVectorImpl<MCFixup> &Fixups) const { |
Chris Lattner | 79fa371 | 2010-11-15 05:57:53 +0000 | [diff] [blame] | 108 | const MCOperand &MO = MI.getOperand(OpNo); |
| 109 | if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); |
| 110 | |
| 111 | // Add a fixup for the branch target. |
| 112 | Fixups.push_back(MCFixup::Create(0, MO.getExpr(), |
| 113 | (MCFixupKind)PPC::fixup_ppc_br24)); |
Bill Schmidt | c56f1d3 | 2012-12-11 20:30:11 +0000 | [diff] [blame] | 114 | |
| 115 | // For special TLS calls, add another fixup for the symbol. Apparently |
Ulrich Weigand | f62e83f | 2013-03-22 15:24:13 +0000 | [diff] [blame] | 116 | // BL8_NOP, BL8_NOP_TLSGD, and BL8_NOP_TLSLD are sufficiently |
Bill Schmidt | 24b8dd6 | 2012-12-12 19:29:35 +0000 | [diff] [blame] | 117 | // similar that TblGen will not generate a separate case for the latter |
| 118 | // two, so this is the only way to get the extra fixup generated. |
| 119 | unsigned Opcode = MI.getOpcode(); |
Ulrich Weigand | f62e83f | 2013-03-22 15:24:13 +0000 | [diff] [blame] | 120 | if (Opcode == PPC::BL8_NOP_TLSGD || Opcode == PPC::BL8_NOP_TLSLD) { |
Bill Schmidt | c56f1d3 | 2012-12-11 20:30:11 +0000 | [diff] [blame] | 121 | const MCOperand &MO2 = MI.getOperand(OpNo+1); |
| 122 | Fixups.push_back(MCFixup::Create(0, MO2.getExpr(), |
Bill Schmidt | 24b8dd6 | 2012-12-12 19:29:35 +0000 | [diff] [blame] | 123 | (MCFixupKind)PPC::fixup_ppc_nofixup)); |
Bill Schmidt | c56f1d3 | 2012-12-11 20:30:11 +0000 | [diff] [blame] | 124 | } |
Chris Lattner | 79fa371 | 2010-11-15 05:57:53 +0000 | [diff] [blame] | 125 | return 0; |
| 126 | } |
| 127 | |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 128 | unsigned PPCMCCodeEmitter::getCondBrEncoding(const MCInst &MI, unsigned OpNo, |
| 129 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 130 | const MCOperand &MO = MI.getOperand(OpNo); |
| 131 | if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); |
| 132 | |
Chris Lattner | 85e3768 | 2010-11-15 06:12:22 +0000 | [diff] [blame] | 133 | // Add a fixup for the branch target. |
| 134 | Fixups.push_back(MCFixup::Create(0, MO.getExpr(), |
| 135 | (MCFixupKind)PPC::fixup_ppc_brcond14)); |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 136 | return 0; |
| 137 | } |
| 138 | |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 139 | unsigned PPCMCCodeEmitter::getHA16Encoding(const MCInst &MI, unsigned OpNo, |
| 140 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 141 | const MCOperand &MO = MI.getOperand(OpNo); |
| 142 | if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); |
| 143 | |
| 144 | // Add a fixup for the branch target. |
Ulrich Weigand | 2fb140e | 2013-05-15 15:07:06 +0000 | [diff] [blame] | 145 | Fixups.push_back(MCFixup::Create(2, MO.getExpr(), |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 146 | (MCFixupKind)PPC::fixup_ppc_ha16)); |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | unsigned PPCMCCodeEmitter::getLO16Encoding(const MCInst &MI, unsigned OpNo, |
| 151 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 152 | const MCOperand &MO = MI.getOperand(OpNo); |
| 153 | if (MO.isReg() || MO.isImm()) return getMachineOpValue(MI, MO, Fixups); |
| 154 | |
| 155 | // Add a fixup for the branch target. |
Ulrich Weigand | 2fb140e | 2013-05-15 15:07:06 +0000 | [diff] [blame] | 156 | Fixups.push_back(MCFixup::Create(2, MO.getExpr(), |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 157 | (MCFixupKind)PPC::fixup_ppc_lo16)); |
| 158 | return 0; |
| 159 | } |
| 160 | |
Chris Lattner | efacb9e | 2010-11-15 08:22:03 +0000 | [diff] [blame] | 161 | unsigned PPCMCCodeEmitter::getMemRIEncoding(const MCInst &MI, unsigned OpNo, |
| 162 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 163 | // Encode (imm, reg) as a memri, which has the low 16-bits as the |
| 164 | // displacement and the next 5 bits as the register #. |
| 165 | assert(MI.getOperand(OpNo+1).isReg()); |
| 166 | unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo+1), Fixups) << 16; |
| 167 | |
| 168 | const MCOperand &MO = MI.getOperand(OpNo); |
| 169 | if (MO.isImm()) |
| 170 | return (getMachineOpValue(MI, MO, Fixups) & 0xFFFF) | RegBits; |
| 171 | |
| 172 | // Add a fixup for the displacement field. |
Ulrich Weigand | 2fb140e | 2013-05-15 15:07:06 +0000 | [diff] [blame] | 173 | Fixups.push_back(MCFixup::Create(2, MO.getExpr(), |
Ulrich Weigand | 3e18601 | 2013-03-26 10:56:47 +0000 | [diff] [blame] | 174 | (MCFixupKind)PPC::fixup_ppc_lo16)); |
Chris Lattner | efacb9e | 2010-11-15 08:22:03 +0000 | [diff] [blame] | 175 | return RegBits; |
| 176 | } |
| 177 | |
| 178 | |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 179 | unsigned PPCMCCodeEmitter::getMemRIXEncoding(const MCInst &MI, unsigned OpNo, |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 180 | SmallVectorImpl<MCFixup> &Fixups) const { |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 181 | // Encode (imm, reg) as a memrix, which has the low 14-bits as the |
| 182 | // displacement and the next 5 bits as the register #. |
Chris Lattner | efacb9e | 2010-11-15 08:22:03 +0000 | [diff] [blame] | 183 | assert(MI.getOperand(OpNo+1).isReg()); |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 184 | unsigned RegBits = getMachineOpValue(MI, MI.getOperand(OpNo+1), Fixups) << 14; |
| 185 | |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 186 | const MCOperand &MO = MI.getOperand(OpNo); |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 187 | if (MO.isImm()) |
Ulrich Weigand | 9d980cb | 2013-05-16 17:58:02 +0000 | [diff] [blame^] | 188 | return ((getMachineOpValue(MI, MO, Fixups) >> 2) & 0x3FFF) | RegBits; |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 189 | |
Ulrich Weigand | 3e18601 | 2013-03-26 10:56:47 +0000 | [diff] [blame] | 190 | // Add a fixup for the displacement field. |
Ulrich Weigand | 2fb140e | 2013-05-15 15:07:06 +0000 | [diff] [blame] | 191 | Fixups.push_back(MCFixup::Create(2, MO.getExpr(), |
Ulrich Weigand | 3e18601 | 2013-03-26 10:56:47 +0000 | [diff] [blame] | 192 | (MCFixupKind)PPC::fixup_ppc_lo16_ds)); |
Chris Lattner | 8f4444d | 2010-11-15 08:02:41 +0000 | [diff] [blame] | 193 | return RegBits; |
Chris Lattner | 6566112 | 2010-11-15 06:33:39 +0000 | [diff] [blame] | 194 | } |
| 195 | |
Chris Lattner | 0e3461e | 2010-11-15 06:09:35 +0000 | [diff] [blame] | 196 | |
Bill Schmidt | ca4a0c9 | 2012-12-04 16:18:08 +0000 | [diff] [blame] | 197 | unsigned PPCMCCodeEmitter::getTLSRegEncoding(const MCInst &MI, unsigned OpNo, |
| 198 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 199 | const MCOperand &MO = MI.getOperand(OpNo); |
| 200 | if (MO.isReg()) return getMachineOpValue(MI, MO, Fixups); |
| 201 | |
| 202 | // Add a fixup for the TLS register, which simply provides a relocation |
| 203 | // hint to the linker that this statement is part of a relocation sequence. |
| 204 | // Return the thread-pointer register's encoding. |
| 205 | Fixups.push_back(MCFixup::Create(0, MO.getExpr(), |
| 206 | (MCFixupKind)PPC::fixup_ppc_tlsreg)); |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 207 | return CTX.getRegisterInfo().getEncodingValue(PPC::X13); |
Bill Schmidt | ca4a0c9 | 2012-12-04 16:18:08 +0000 | [diff] [blame] | 208 | } |
| 209 | |
Chris Lattner | 79fa371 | 2010-11-15 05:57:53 +0000 | [diff] [blame] | 210 | unsigned PPCMCCodeEmitter:: |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 211 | get_crbitm_encoding(const MCInst &MI, unsigned OpNo, |
| 212 | SmallVectorImpl<MCFixup> &Fixups) const { |
| 213 | const MCOperand &MO = MI.getOperand(OpNo); |
Adhemerval Zanella | 22b9fd2 | 2012-10-08 18:25:11 +0000 | [diff] [blame] | 214 | assert((MI.getOpcode() == PPC::MTCRF || |
| 215 | MI.getOpcode() == PPC::MFOCRF || |
| 216 | MI.getOpcode() == PPC::MTCRF8) && |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 217 | (MO.getReg() >= PPC::CR0 && MO.getReg() <= PPC::CR7)); |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 218 | return 0x80 >> CTX.getRegisterInfo().getEncodingValue(MO.getReg()); |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | |
| 222 | unsigned PPCMCCodeEmitter:: |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 223 | getMachineOpValue(const MCInst &MI, const MCOperand &MO, |
| 224 | SmallVectorImpl<MCFixup> &Fixups) const { |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 225 | if (MO.isReg()) { |
Chris Lattner | 7b25d6f | 2010-11-16 00:57:32 +0000 | [diff] [blame] | 226 | // MTCRF/MFOCRF should go through get_crbitm_encoding for the CR operand. |
| 227 | // The GPR operand should come through here though. |
Chris Lattner | 73716a6 | 2010-11-16 00:55:51 +0000 | [diff] [blame] | 228 | assert((MI.getOpcode() != PPC::MTCRF && MI.getOpcode() != PPC::MFOCRF) || |
| 229 | MO.getReg() < PPC::CR0 || MO.getReg() > PPC::CR7); |
Hal Finkel | feea653 | 2013-03-26 20:08:20 +0000 | [diff] [blame] | 230 | return CTX.getRegisterInfo().getEncodingValue(MO.getReg()); |
Chris Lattner | d6a07cc | 2010-11-15 05:19:25 +0000 | [diff] [blame] | 231 | } |
Chris Lattner | c877d8f | 2010-11-15 04:51:55 +0000 | [diff] [blame] | 232 | |
Chris Lattner | efacb9e | 2010-11-15 08:22:03 +0000 | [diff] [blame] | 233 | assert(MO.isImm() && |
| 234 | "Relocation required in an instruction that we cannot encode!"); |
| 235 | return MO.getImm(); |
Chris Lattner | 9ec375c | 2010-11-15 04:16:32 +0000 | [diff] [blame] | 236 | } |
| 237 | |
| 238 | |
| 239 | #include "PPCGenMCCodeEmitter.inc" |