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

Side by Side Diff: src/IceAssemblerMIPS32.cpp

Issue 2354293002: Subzero, MIPS32: Intrinsic call Ctlz for i32 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing review comments Created 4 years, 3 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
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 emitCOP1Fcmp(Opcode, DoublePrecision, OpFs, OpFt, OperandMIPS32FCC::FCC0, 462 emitCOP1Fcmp(Opcode, DoublePrecision, OpFs, OpFt, OperandMIPS32FCC::FCC0,
463 "c.un.d"); 463 "c.un.d");
464 } 464 }
465 465
466 void AssemblerMIPS32::c_un_s(const Operand *OpFs, const Operand *OpFt) { 466 void AssemblerMIPS32::c_un_s(const Operand *OpFs, const Operand *OpFt) {
467 static constexpr IValueT Opcode = 0x44000031; 467 static constexpr IValueT Opcode = 0x44000031;
468 emitCOP1Fcmp(Opcode, SinglePrecision, OpFs, OpFt, OperandMIPS32FCC::FCC0, 468 emitCOP1Fcmp(Opcode, SinglePrecision, OpFs, OpFt, OperandMIPS32FCC::FCC0,
469 "c.un.s"); 469 "c.un.s");
470 } 470 }
471 471
472 void AssemblerMIPS32::clz(const Operand *OpRd, const Operand *OpRs) {
473 IValueT Opcode = 0x70000020;
474 const IValueT Rd = encodeGPRegister(OpRd, "Rd", "clz");
475 const IValueT Rs = encodeGPRegister(OpRs, "Rs", "clz");
476 Opcode |= Rd << 11;
477 Opcode |= Rd << 16;
478 Opcode |= Rs << 21;
479 emitInst(Opcode);
480 }
481
472 void AssemblerMIPS32::cvt_d_l(const Operand *OpFd, const Operand *OpFs) { 482 void AssemblerMIPS32::cvt_d_l(const Operand *OpFd, const Operand *OpFs) {
473 static constexpr IValueT Opcode = 0x44000021; 483 static constexpr IValueT Opcode = 0x44000021;
474 emitCOP1FmtFsFd(Opcode, Long, OpFd, OpFs, "cvt.d.l"); 484 emitCOP1FmtFsFd(Opcode, Long, OpFd, OpFs, "cvt.d.l");
475 } 485 }
476 486
477 void AssemblerMIPS32::cvt_d_s(const Operand *OpFd, const Operand *OpFs) { 487 void AssemblerMIPS32::cvt_d_s(const Operand *OpFd, const Operand *OpFs) {
478 static constexpr IValueT Opcode = 0x44000021; 488 static constexpr IValueT Opcode = 0x44000021;
479 emitCOP1FmtFsFd(Opcode, SinglePrecision, OpFd, OpFs, "cvt.d.s"); 489 emitCOP1FmtFsFd(Opcode, SinglePrecision, OpFd, OpFs, "cvt.d.s");
480 } 490 }
481 491
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 Cc = OpFCC->getFCC(); 615 Cc = OpFCC->getFCC();
606 } 616 }
607 const IValueT InstEncodingFalse = 0; 617 const IValueT InstEncodingFalse = 0;
608 Opcode |= Rd << 11; 618 Opcode |= Rd << 11;
609 Opcode |= InstEncodingFalse << 16; 619 Opcode |= InstEncodingFalse << 16;
610 Opcode |= Cc << 18; 620 Opcode |= Cc << 18;
611 Opcode |= Rs << 21; 621 Opcode |= Rs << 21;
612 emitInst(Opcode); 622 emitInst(Opcode);
613 } 623 }
614 624
625 void AssemblerMIPS32::movn(const Operand *OpRd, const Operand *OpRs,
626 const Operand *OpRt) {
627 static constexpr IValueT Opcode = 0x44000013;
628 emitRdRsRt(Opcode, OpRd, OpRs, OpRt, "movn");
629 }
630
615 void AssemblerMIPS32::movn_d(const Operand *OpFd, const Operand *OpFs, 631 void AssemblerMIPS32::movn_d(const Operand *OpFd, const Operand *OpFs,
616 const Operand *OpFt) { 632 const Operand *OpFt) {
617 static constexpr IValueT Opcode = 0x44000013; 633 static constexpr IValueT Opcode = 0x44000013;
618 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movn.d"); 634 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movn.d");
619 } 635 }
620 636
621 void AssemblerMIPS32::movn_s(const Operand *OpFd, const Operand *OpFs, 637 void AssemblerMIPS32::movn_s(const Operand *OpFd, const Operand *OpFs,
622 const Operand *OpFt) { 638 const Operand *OpFt) {
623 static constexpr IValueT Opcode = 0x44000013; 639 static constexpr IValueT Opcode = 0x44000013;
624 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movn.s"); 640 emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movn.s");
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 emitBr(Cond, OpRs, OpRtNone, Dest); 913 emitBr(Cond, OpRs, OpRtNone, Dest);
898 return; 914 return;
899 } 915 }
900 const IOffsetT Position = Buffer.size(); 916 const IOffsetT Position = Buffer.size();
901 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition()); 917 emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition());
902 TargetLabel->linkTo(*this, Position); 918 TargetLabel->linkTo(*this, Position);
903 } 919 }
904 920
905 } // end of namespace MIPS32 921 } // end of namespace MIPS32
906 } // end of namespace Ice 922 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceAssemblerMIPS32.h ('k') | src/IceInstMIPS32.h » ('j') | src/IceTargetLoweringMIPS32.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698