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

Side by Side Diff: src/IceInstARM32.cpp

Issue 1407613002: Add "add immediate" instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix issues in patch set 2. Created 5 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/IceInstARM32.h ('k') | tests_lit/assembler/arm32/add.ll » ('j') | 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/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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 TargetFalse = NewNode; 311 TargetFalse = NewNode;
312 Found = true; 312 Found = true;
313 } 313 }
314 if (TargetTrue == OldNode) { 314 if (TargetTrue == OldNode) {
315 TargetTrue = NewNode; 315 TargetTrue = NewNode;
316 Found = true; 316 Found = true;
317 } 317 }
318 return Found; 318 return Found;
319 } 319 }
320 320
321 template <InstARM32::InstKindARM32 K>
322 void InstARM32ThreeAddrGPR<K>::emitIAS(const Cfg *Func) const {
323 (void)Func;
324 UnimplementedError(Func->getContext()->getFlags());
325 }
326
327 template <>
328 void InstARM32ThreeAddrGPR<InstARM32::Add>::emitIAS(const Cfg *Func) const {
329 ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
330 Asm->add(getDest(), getSrc(0), getSrc(1), SetFlags, getPredicate());
331 }
332
321 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget) 333 InstARM32Call::InstARM32Call(Cfg *Func, Variable *Dest, Operand *CallTarget)
322 : InstARM32(Func, InstARM32::Call, 1, Dest) { 334 : InstARM32(Func, InstARM32::Call, 1, Dest) {
323 HasSideEffects = true; 335 HasSideEffects = true;
324 addSource(CallTarget); 336 addSource(CallTarget);
325 } 337 }
326 338
327 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target) 339 InstARM32Label::InstARM32Label(Cfg *Func, TargetARM32 *Target)
328 : InstARM32(Func, InstARM32::Label, 0, nullptr), 340 : InstARM32(Func, InstARM32::Label, 0, nullptr),
329 Number(Target->makeNextLabelNumber()) {} 341 Number(Target->makeNextLabelNumber()) {}
330 342
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 Operand *Src0 = getSrc(0); 610 Operand *Src0 = getSrc(0);
599 // Note: Loop is used so that we can short circuit using break. 611 // Note: Loop is used so that we can short circuit using break.
600 do { 612 do {
601 if (Dest->hasReg()) { 613 if (Dest->hasReg()) {
602 Type DestTy = Dest->getType(); 614 Type DestTy = Dest->getType();
603 const bool DestIsVector = isVectorType(DestTy); 615 const bool DestIsVector = isVectorType(DestTy);
604 const bool DestIsScalarFP = isScalarFloatingType(DestTy); 616 const bool DestIsScalarFP = isScalarFloatingType(DestTy);
605 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); 617 const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0);
606 if (DestIsVector || DestIsScalarFP || CoreVFPMove) 618 if (DestIsVector || DestIsScalarFP || CoreVFPMove)
607 break; 619 break;
608 if (const auto *FlexImm = llvm::dyn_cast<OperandARM32FlexImm>(Src0)) { 620 Asm->mov(Dest, Src0, getPredicate());
609 Asm->mov(static_cast<RegARM32::GPRRegister>(Dest->getRegNum()), 621 return;
610 *FlexImm, getPredicate());
611 return;
612 }
613 } 622 }
614 } while (0); 623 } while (0);
615 llvm_unreachable("not yet implemented"); 624 llvm_unreachable("not yet implemented");
616 } 625 }
617 626
618 void InstARM32Mov::emit(const Cfg *Func) const { 627 void InstARM32Mov::emit(const Cfg *Func) const {
619 if (!BuildDefs::dump()) 628 if (!BuildDefs::dump())
620 return; 629 return;
621 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type."); 630 assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type.");
622 if (isMultiDest()) { 631 if (isMultiDest()) {
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1416 Reg->dump(Str); 1425 Reg->dump(Str);
1417 if (getShiftOp() != kNoShift) { 1426 if (getShiftOp() != kNoShift) {
1418 Str << ", " << InstARM32ShiftAttributes[getShiftOp()].EmitString << " "; 1427 Str << ", " << InstARM32ShiftAttributes[getShiftOp()].EmitString << " ";
1419 if (Func) 1428 if (Func)
1420 getShiftAmt()->dump(Func); 1429 getShiftAmt()->dump(Func);
1421 else 1430 else
1422 getShiftAmt()->dump(Str); 1431 getShiftAmt()->dump(Str);
1423 } 1432 }
1424 } 1433 }
1425 1434
1435 // Force instantition of template classes
1436 template class InstARM32ThreeAddrGPR<InstARM32::Adc>;
1437 template class InstARM32ThreeAddrGPR<InstARM32::Add>;
1438 template class InstARM32ThreeAddrGPR<InstARM32::And>;
1439 template class InstARM32ThreeAddrGPR<InstARM32::Asr>;
1440 template class InstARM32ThreeAddrGPR<InstARM32::Bic>;
1441 template class InstARM32ThreeAddrGPR<InstARM32::Eor>;
1442 template class InstARM32ThreeAddrGPR<InstARM32::Lsl>;
1443 template class InstARM32ThreeAddrGPR<InstARM32::Lsr>;
1444 template class InstARM32ThreeAddrGPR<InstARM32::Mul>;
1445 template class InstARM32ThreeAddrGPR<InstARM32::Orr>;
1446 template class InstARM32ThreeAddrGPR<InstARM32::Rsb>;
1447 template class InstARM32ThreeAddrGPR<InstARM32::Sbc>;
1448 template class InstARM32ThreeAddrGPR<InstARM32::Sdiv>;
1449 template class InstARM32ThreeAddrGPR<InstARM32::Sub>;
1450 template class InstARM32ThreeAddrGPR<InstARM32::Udiv>;
1451 template class InstARM32ThreeAddrFP<InstARM32::Vadd>;
1452 template class InstARM32ThreeAddrFP<InstARM32::Vdiv>;
1453 template class InstARM32ThreeAddrFP<InstARM32::Vmul>;
1454 template class InstARM32ThreeAddrFP<InstARM32::Vsub>;
1455
1426 } // end of namespace Ice 1456 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/add.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698