Chromium Code Reviews| Index: src/IceInstARM32.cpp |
| diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp |
| index a1605828e3eae08637d8615c6632cd633303a5de..58bcf49ab8441a6e61d7b09e59a927293d56d929 100644 |
| --- a/src/IceInstARM32.cpp |
| +++ b/src/IceInstARM32.cpp |
| @@ -1116,6 +1116,30 @@ void InstARM32Mov::emitSingleDestSingleSource(const Cfg *Func) const { |
| Src0->emit(Func); |
| } |
| +void InstARM32Mov::emitIASCoreVFPMove(const Cfg *Func) const { |
| + auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| + Operand *Src0 = getSrc(0); |
| + if (!llvm::isa<Variable>(Src0)) |
| + // TODO(kschimpf) Handle moving contants into registers. |
|
Jim Stichnoth
2016/01/19 21:14:57
constants
Karl
2016/01/21 16:05:47
Done.
|
| + return Asm->setNeedsTextFixup(); |
| + |
| + // Move register to register. |
| + Variable *Dest = getDest(); |
| + switch (Dest->getType()) { |
| + default: |
| + // TODO(kschimpf): Fill this out more. |
| + return Asm->setNeedsTextFixup(); |
| + case IceType_f32: |
| + switch (Src0->getType()) { |
| + default: |
| + // TODO(kschimpf): Fill this out more? |
| + return Asm->setNeedsTextFixup(); |
| + case IceType_i32: |
| + return Asm->vmovsr(Dest, Src0, getPredicate()); |
| + } |
| + } |
| +} |
| + |
| void InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const { |
| auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>(); |
| Variable *Dest = getDest(); |
| @@ -1129,12 +1153,16 @@ void InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const { |
| llvm::report_fatal_error("mov can't load."); |
| } |
| + if (isMoveBetweenCoreAndVFPRegisters(Dest, Src0)) |
| + return emitIASCoreVFPMove(Func); |
| + |
| const Type DestTy = Dest->getType(); |
| - const bool DestIsVector = isVectorType(DestTy); |
| - const bool DestIsScalarFP = isScalarFloatingType(DestTy); |
| - const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0); |
| - if (DestIsVector || DestIsScalarFP || CoreVFPMove) |
| + if (isScalarFloatingType(DestTy)) |
| + return Asm->setNeedsTextFixup(); |
| + |
| + if (isVectorType(DestTy)) |
| return Asm->setNeedsTextFixup(); |
| + |
| return Asm->mov(Dest, Src0, getPredicate()); |
| } |