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

Unified Diff: src/IceInstARM32.cpp

Issue 1397043003: Fix emission of move immediate for ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up header file for IceAssemblerARM. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/mov-imm.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 b45d2f1ea28872708913803fb94d37e8f1a6f232..7e510ca600406c781e338f5310998597b29dde25 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -592,6 +592,29 @@ void InstARM32Mov::emitSingleDestSingleSource(const Cfg *Func) const {
}
}
+void InstARM32Mov::emitIASSingleDestSingleSource(const Cfg *Func) const {
+ ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ Variable *Dest = getDest();
+ Operand *Src0 = getSrc(0);
+ // Note: Loop is used so that we can short circuit using break.
+ do {
+ if (Dest->hasReg()) {
+ Type DestTy = Dest->getType();
+ const bool DestIsVector = isVectorType(DestTy);
+ const bool DestIsScalarFP = isScalarFloatingType(DestTy);
+ const bool CoreVFPMove = isMoveBetweenCoreAndVFPRegisters(Dest, Src0);
+ if (DestIsVector || DestIsScalarFP || CoreVFPMove)
+ break;
+ if (const auto *FlexImm = llvm::dyn_cast<OperandARM32FlexImm>(Src0)) {
+ Asm->mov(static_cast<RegARM32::GPRRegister>(Dest->getRegNum()),
+ *FlexImm, getPredicate());
+ return;
+ }
+ }
+ } while (0);
+ llvm_unreachable("not yet implemented");
+}
+
void InstARM32Mov::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
@@ -612,7 +635,13 @@ void InstARM32Mov::emit(const Cfg *Func) const {
void InstARM32Mov::emitIAS(const Cfg *Func) const {
assert(getSrcSize() == 1);
(void)Func;
- llvm_unreachable("Not yet implemented");
+ assert(!(isMultiDest() && isMultiSource()) && "Invalid vmov type.");
+ if (isMultiDest())
+ llvm_unreachable("Not yet implemented");
+ if (isMultiSource())
+ llvm_unreachable("Not yet implemented");
+ // Must be single source/dest.
+ emitIASSingleDestSingleSource(Func);
}
void InstARM32Mov::dump(const Cfg *Func) const {
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/mov-imm.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698