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

Side by Side Diff: src/IceInstARM32.cpp

Issue 1430713003: Add mul instruction to ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add i64 multiplication example. Created 5 years, 1 month 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/IceInstARM32.cpp - ARM32 instruction implementation ----===// 1 //===- subzero/src/IceInstARM32.cpp - ARM32 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 Found = true; 337 Found = true;
338 } 338 }
339 return Found; 339 return Found;
340 } 340 }
341 341
342 template <InstARM32::InstKindARM32 K> 342 template <InstARM32::InstKindARM32 K>
343 void InstARM32ThreeAddrGPR<K>::emitIAS(const Cfg *Func) const { 343 void InstARM32ThreeAddrGPR<K>::emitIAS(const Cfg *Func) const {
344 emitUsingTextFixup(Func); 344 emitUsingTextFixup(Func);
345 } 345 }
346 346
347 template <> 347 template <> void InstARM32Adc::emitIAS(const Cfg *Func) const {
348 void InstARM32ThreeAddrGPR<InstARM32::Adc>::emitIAS(const Cfg *Func) const {
349 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 348 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
350 Asm->adc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); 349 Asm->adc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
351 if (Asm->needsTextFixup()) 350 if (Asm->needsTextFixup())
352 emitUsingTextFixup(Func); 351 emitUsingTextFixup(Func);
353 } 352 }
354 353
355 template <> 354 template <> void InstARM32Add::emitIAS(const Cfg *Func) const {
356 void InstARM32ThreeAddrGPR<InstARM32::Add>::emitIAS(const Cfg *Func) const {
357 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 355 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
358 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); 356 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
359 if (Asm->needsTextFixup()) 357 if (Asm->needsTextFixup())
360 emitUsingTextFixup(Func); 358 emitUsingTextFixup(Func);
361 } 359 }
362 360
363 template <> 361 template <> void InstARM32Mul::emitIAS(const Cfg *Func) const {
364 void InstARM32ThreeAddrGPR<InstARM32::Sbc>::emitIAS(const Cfg *Func) const { 362 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
363 Asm->mul(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
364 if (Asm->needsTextFixup())
365 emitUsingTextFixup(Func);
366 }
367
368 template <> void InstARM32Sbc::emitIAS(const Cfg *Func) const {
365 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 369 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
366 Asm->sbc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); 370 Asm->sbc(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
367 if (Asm->needsTextFixup()) 371 if (Asm->needsTextFixup())
368 emitUsingTextFixup(Func); 372 emitUsingTextFixup(Func);
369 } 373 }
370 374
371 template <> 375 template <> void InstARM32Sub::emitIAS(const Cfg *Func) const {
372 void InstARM32ThreeAddrGPR<InstARM32::Sub>::emitIAS(const Cfg *Func) const {
373 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); 376 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
374 Asm->sub(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate()); 377 Asm->sub(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
375 if (Asm->needsTextFixup()) 378 if (Asm->needsTextFixup())
376 emitUsingTextFixup(Func); 379 emitUsingTextFixup(Func);
377 } 380 }
378 381
379 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) 382 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget)
380 : InstARM32(Func, InstARM32::Call, 1, Dest) { 383 : InstARM32(Func, InstARM32::Call, 1, Dest) {
381 HasSideEffects = true; 384 HasSideEffects = true;
382 addSource(CallTarget); 385 addSource(CallTarget);
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 template class InstARM32ThreeAddrGPR<InstARM32::Udiv>; 1459 template class InstARM32ThreeAddrGPR<InstARM32::Udiv>;
1457 1460
1458 template class InstARM32ThreeAddrFP<InstARM32::Vadd>; 1461 template class InstARM32ThreeAddrFP<InstARM32::Vadd>;
1459 template class InstARM32ThreeAddrFP<InstARM32::Vdiv>; 1462 template class InstARM32ThreeAddrFP<InstARM32::Vdiv>;
1460 template class InstARM32ThreeAddrFP<InstARM32::Vmul>; 1463 template class InstARM32ThreeAddrFP<InstARM32::Vmul>;
1461 template class InstARM32ThreeAddrFP<InstARM32::Vsub>; 1464 template class InstARM32ThreeAddrFP<InstARM32::Vsub>;
1462 1465
1463 template class InstARM32TwoAddrGPR<InstARM32::Movt>; 1466 template class InstARM32TwoAddrGPR<InstARM32::Movt>;
1464 1467
1465 } // end of namespace Ice 1468 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698