Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/IceAssemblerMIPS32.cpp

Issue 2377733002: Subzero, MIPS32: DIVU instruction encoding (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceAssemblerMIPS32.h ('k') | src/IceInstMIPS32.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 static constexpr IValueT Opcode = 0x44000003; 530 static constexpr IValueT Opcode = 0x44000003;
531 emitCOP1FmtFtFsFd(Opcode, DoublePrecision, OpFd, OpFs, OpFt, "div.d"); 531 emitCOP1FmtFtFsFd(Opcode, DoublePrecision, OpFd, OpFs, OpFt, "div.d");
532 } 532 }
533 533
534 void AssemblerMIPS32::div_s(const Operand *OpFd, const Operand *OpFs, 534 void AssemblerMIPS32::div_s(const Operand *OpFd, const Operand *OpFs,
535 const Operand *OpFt) { 535 const Operand *OpFt) {
536 static constexpr IValueT Opcode = 0x44000003; 536 static constexpr IValueT Opcode = 0x44000003;
537 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "div.s"); 537 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "div.s");
538 } 538 }
539 539
540 void AssemblerMIPS32::divu(const Operand *OpRs, const Operand *OpRt) {
541 static constexpr IValueT Opcode = 0x0000001B;
542 emitRsRt(Opcode, OpRs, OpRt, "divu");
543 }
544
540 void AssemblerMIPS32::lui(const Operand *OpRt, const uint16_t Imm) { 545 void AssemblerMIPS32::lui(const Operand *OpRt, const uint16_t Imm) {
541 IValueT Opcode = 0x3C000000; 546 IValueT Opcode = 0x3C000000;
542 const IValueT Rt = encodeGPRegister(OpRt, "Rt", "lui"); 547 const IValueT Rt = encodeGPRegister(OpRt, "Rt", "lui");
543 Opcode |= Rt << 16; 548 Opcode |= Rt << 16;
544 Opcode |= Imm; 549 Opcode |= Imm;
545 emitInst(Opcode); 550 emitInst(Opcode);
546 } 551 }
547 552
548 void AssemblerMIPS32::lw(const Operand *OpRt, const Operand *OpBase, 553 void AssemblerMIPS32::lw(const Operand *OpRt, const Operand *OpBase,
549 const uint32_t Offset) { 554 const uint32_t Offset) {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 emitBr(Cond, OpRs, OpRtNone, Dest); 1008 emitBr(Cond, OpRs, OpRtNone, Dest);
1004 return; 1009 return;
1005 } 1010 }
1006 const IOffsetT Position = Buffer.size(); 1011 const IOffsetT Position = Buffer.size();
1007 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition()); 1012 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition());
1008 TargetLabel->linkTo(*this, Position); 1013 TargetLabel->linkTo(*this, Position);
1009 } 1014 }
1010 1015
1011 } // end of namespace MIPS32 1016 } // end of namespace MIPS32
1012 } // end of namespace Ice 1017 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerMIPS32.h ('k') | src/IceInstMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698