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

Side by Side Diff: src/IceInstMIPS32.cpp

Issue 2364093002: Subzero, MIPS32: Intrinsic calls Ctlz and Cttz for i64 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Bitcast added 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
OLDNEW
1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===// 1 //===- subzero/src/IceInstMips32.cpp - Mips32 instruction implementation --===//
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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const { 893 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const {
894 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 894 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
895 Asm->div_d(getDest(), getSrc(0), getSrc(1)); 895 Asm->div_d(getDest(), getSrc(0), getSrc(1));
896 } 896 }
897 897
898 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const { 898 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const {
899 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 899 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
900 Asm->div_s(getDest(), getSrc(0), getSrc(1)); 900 Asm->div_s(getDest(), getSrc(0), getSrc(1));
901 } 901 }
902 902
903 template <> void InstMIPS32Lui::emitIAS(const Cfg *Func) const {
904 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
905 auto *C32 = llvm::dyn_cast<ConstantInteger32>(getSrc(0));
906 uint16_t Imm = static_cast<uint16_t>(C32->getValue());
907 Asm->lui(getDest(), Imm);
908 }
909
903 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const { 910 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const {
904 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 911 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
905 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); 912 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0));
906 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset()); 913 ConstantInteger32 *Offset = llvm::cast<ConstantInteger32>(Mem->getOffset());
907 uint32_t Imm = static_cast<uint32_t>(Offset->getValue()); 914 uint32_t Imm = static_cast<uint32_t>(Offset->getValue());
908 Asm->lw(getDest(), Mem->getBase(), Imm); 915 Asm->lw(getDest(), Mem->getBase(), Imm);
909 } 916 }
910 917
911 template <> void InstMIPS32Mfc1::emitIAS(const Cfg *Func) const { 918 template <> void InstMIPS32Mfc1::emitIAS(const Cfg *Func) const {
912 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 919 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 Asm->xor_(getDest(), getSrc(0), getSrc(1)); 1129 Asm->xor_(getDest(), getSrc(0), getSrc(1));
1123 } 1130 }
1124 1131
1125 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { 1132 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const {
1126 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 1133 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
1127 Asm->xori(getDest(), getSrc(0), Imm); 1134 Asm->xori(getDest(), getSrc(0), Imm);
1128 } 1135 }
1129 1136
1130 } // end of namespace MIPS32 1137 } // end of namespace MIPS32
1131 } // end of namespace Ice 1138 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698