| OLD | NEW |
| 1 //===- subzero/src/IceAssemblerMIPS32.cpp - MIPS32 Assembler --------------===// | 1 //===- subzero/src/IceAssemblerMIPS32.cpp - MIPS32 Assembler --------------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 emitFixup(createMIPS32Fixup(RelocOp::RO_Jal, Target)); | 643 emitFixup(createMIPS32Fixup(RelocOp::RO_Jal, Target)); |
| 644 emitInst(Opcode); | 644 emitInst(Opcode); |
| 645 nop(); | 645 nop(); |
| 646 } | 646 } |
| 647 | 647 |
| 648 void AssemblerMIPS32::jalr(const Operand *OpRs, const Operand *OpRd) { | 648 void AssemblerMIPS32::jalr(const Operand *OpRs, const Operand *OpRd) { |
| 649 IValueT Opcode = 0x00000009; | 649 IValueT Opcode = 0x00000009; |
| 650 const IValueT Rs = encodeGPRegister(OpRs, "Rs", "jalr"); | 650 const IValueT Rs = encodeGPRegister(OpRs, "Rs", "jalr"); |
| 651 const IValueT Rd = | 651 const IValueT Rd = |
| 652 (OpRd == nullptr) ? 31 : encodeGPRegister(OpRd, "Rd", "jalr"); | 652 (OpRd == nullptr) ? 31 : encodeGPRegister(OpRd, "Rd", "jalr"); |
| 653 Opcode |= Rd << 16; | 653 Opcode |= Rd << 11; |
| 654 Opcode |= Rs << 21; | 654 Opcode |= Rs << 21; |
| 655 emitInst(Opcode); | 655 emitInst(Opcode); |
| 656 nop(); | 656 nop(); |
| 657 } | 657 } |
| 658 | 658 |
| 659 void AssemblerMIPS32::lui(const Operand *OpRt, const Operand *OpImm, | 659 void AssemblerMIPS32::lui(const Operand *OpRt, const Operand *OpImm, |
| 660 const RelocOp Reloc) { | 660 const RelocOp Reloc) { |
| 661 IValueT Opcode = 0x3C000000; | 661 IValueT Opcode = 0x3C000000; |
| 662 const IValueT Rt = encodeGPRegister(OpRt, "Rt", "lui"); | 662 const IValueT Rt = encodeGPRegister(OpRt, "Rt", "lui"); |
| 663 IValueT Imm16 = 0; | 663 IValueT Imm16 = 0; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1251 emitBr(Cond, OpRs, OpRtNone, Dest); | 1251 emitBr(Cond, OpRs, OpRtNone, Dest); |
| 1252 return; | 1252 return; |
| 1253 } | 1253 } |
| 1254 const IOffsetT Position = Buffer.size(); | 1254 const IOffsetT Position = Buffer.size(); |
| 1255 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition()); | 1255 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition()); |
| 1256 TargetLabel->linkTo(*this, Position); | 1256 TargetLabel->linkTo(*this, Position); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 } // end of namespace MIPS32 | 1259 } // end of namespace MIPS32 |
| 1260 } // end of namespace Ice | 1260 } // end of namespace Ice |
| OLD | NEW |