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

Side by Side Diff: src/IceInstMIPS32.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/IceInstMIPS32.h ('k') | no next file » | 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/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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const { 905 template <> void InstMIPS32Div_d::emitIAS(const Cfg *Func) const {
906 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 906 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
907 Asm->div_d(getDest(), getSrc(0), getSrc(1)); 907 Asm->div_d(getDest(), getSrc(0), getSrc(1));
908 } 908 }
909 909
910 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const { 910 template <> void InstMIPS32Div_s::emitIAS(const Cfg *Func) const {
911 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 911 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
912 Asm->div_s(getDest(), getSrc(0), getSrc(1)); 912 Asm->div_s(getDest(), getSrc(0), getSrc(1));
913 } 913 }
914 914
915 template <> void InstMIPS32Divu::emitIAS(const Cfg *Func) const {
916 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
917 Asm->divu(getDest(), getSrc(0));
918 }
919
915 template <> void InstMIPS32Lui::emitIAS(const Cfg *Func) const { 920 template <> void InstMIPS32Lui::emitIAS(const Cfg *Func) const {
916 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 921 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
917 auto *C32 = llvm::dyn_cast<ConstantInteger32>(getSrc(0)); 922 auto *C32 = llvm::dyn_cast<ConstantInteger32>(getSrc(0));
918 uint16_t Imm = static_cast<uint16_t>(C32->getValue()); 923 uint16_t Imm = static_cast<uint16_t>(C32->getValue());
919 Asm->lui(getDest(), Imm); 924 Asm->lui(getDest(), Imm);
920 } 925 }
921 926
922 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const { 927 template <> void InstMIPS32Lw::emitIAS(const Cfg *Func) const {
923 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 928 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
924 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0)); 929 auto *Mem = llvm::dyn_cast<OperandMIPS32Mem>(getSrc(0));
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 Asm->xor_(getDest(), getSrc(0), getSrc(1)); 1197 Asm->xor_(getDest(), getSrc(0), getSrc(1));
1193 } 1198 }
1194 1199
1195 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { 1200 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const {
1196 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 1201 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
1197 Asm->xori(getDest(), getSrc(0), Imm); 1202 Asm->xori(getDest(), getSrc(0), Imm);
1198 } 1203 }
1199 1204
1200 } // end of namespace MIPS32 1205 } // end of namespace MIPS32
1201 } // end of namespace Ice 1206 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698