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

Unified Diff: src/IceInstARM32.cpp

Issue 1596613002: Clean up handling of ARM IR instruction "mov". (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/vmov-cast.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index a1605828e3eae08637d8615c6632cd633303a5de..9bc1fd56f822f92446020e4dfffaf84808f1e83b 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 constants into registers.
+ 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());
}
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/vmov-cast.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698