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

Side by Side Diff: src/IceInstMIPS32.cpp

Issue 2404803002: [Subzero][MIPS32] Implement bitcast operation for both 32-bit and 64-bit operands (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
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
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 276 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
277 Asm->bindLocalLabel(this, Number); 277 Asm->bindLocalLabel(this, Number);
278 } 278 }
279 279
280 InstMIPS32Call::InstMIPS32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) 280 InstMIPS32Call::InstMIPS32Call(Cfg *Func, Variable *Dest, Operand *CallTarget)
281 : InstMIPS32(Func, InstMIPS32::Call, 1, Dest) { 281 : InstMIPS32(Func, InstMIPS32::Call, 1, Dest) {
282 HasSideEffects = true; 282 HasSideEffects = true;
283 addSource(CallTarget); 283 addSource(CallTarget);
284 } 284 }
285 285
286 InstMIPS32Mov::InstMIPS32Mov(Cfg *Func, Variable *Dest, Operand *Src) 286 InstMIPS32Mov::InstMIPS32Mov(Cfg *Func, Variable *Dest, Operand *Src,
287 Operand *Src2)
287 : InstMIPS32(Func, InstMIPS32::Mov, 2, Dest) { 288 : InstMIPS32(Func, InstMIPS32::Mov, 2, Dest) {
288 auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest); 289 auto *Dest64 = llvm::dyn_cast<Variable64On32>(Dest);
289 auto *Src64 = llvm::dyn_cast<Variable64On32>(Src); 290 auto *Src64 = llvm::dyn_cast<Variable64On32>(Src);
290 291
291 assert(Dest64 == nullptr || Src64 == nullptr); 292 assert(Dest64 == nullptr || Src64 == nullptr);
292 293
294 if (Dest->getType() == IceType_f64 && Src2 != nullptr) {
295 addSource(Src);
296 addSource(Src2);
297 return;
298 }
299
293 if (Dest64 != nullptr) { 300 if (Dest64 != nullptr) {
294 // this-> is needed below because there is a parameter named Dest. 301 // this-> is needed below because there is a parameter named Dest.
295 this->Dest = Dest64->getLo(); 302 this->Dest = Dest64->getLo();
296 DestHi = Dest64->getHi(); 303 DestHi = Dest64->getHi();
297 } 304 }
298 305
299 if (Src64 == nullptr) { 306 if (Src64 == nullptr) {
300 addSource(Src); 307 addSource(Src);
301 } else { 308 } else {
302 addSource(Src64->getLo()); 309 addSource(Src64->getLo());
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1207 Asm->xor_(getDest(), getSrc(0), getSrc(1)); 1214 Asm->xor_(getDest(), getSrc(0), getSrc(1));
1208 } 1215 }
1209 1216
1210 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const { 1217 template <> void InstMIPS32Xori::emitIAS(const Cfg *Func) const {
1211 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>(); 1218 auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
1212 Asm->xori(getDest(), getSrc(0), Imm); 1219 Asm->xori(getDest(), getSrc(0), Imm);
1213 } 1220 }
1214 1221
1215 } // end of namespace MIPS32 1222 } // end of namespace MIPS32
1216 } // end of namespace Ice 1223 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698