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

Unified Diff: src/IceInstARM32.cpp

Issue 1424863005: Handle MOV (immediate) and MOVT to load ARM global addresses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix movw and movt 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
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 7f04c199340cd9e70f3d17f6b530ce45e9b4df8a..750b3f17aaa0a26e26d570477ea63bdbd7e28c51 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -797,7 +797,7 @@ void InstARM32Call::emit(const Cfg *Func) const {
// This shouldn't happen (typically have to copy the full 32-bits to a
// register and do an indirect jump).
llvm::report_fatal_error("ARM32Call to ConstantInteger32");
- } else if (const auto CallTarget =
+ } else if (const auto *CallTarget =
llvm::dyn_cast<ConstantRelocatable>(getCallTarget())) {
// Calls only have 24-bits, but the linker should insert veneers to extend
// the range if needed.
@@ -889,6 +889,11 @@ void InstARM32TwoAddrGPR<K>::emitIAS(const Cfg *Func) const {
emitUsingTextFixup(Func);
}
+template <InstARM32::InstKindARM32 K, bool Nws>
+void InstARM32UnaryopGPR<K, Nws>::emitIAS(const Cfg *Func) const {
+ emitUsingTextFixup(Func);
+}
+
template <> void InstARM32Movw::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
@@ -906,6 +911,14 @@ template <> void InstARM32Movw::emit(const Cfg *Func) const {
}
}
+template <> void InstARM32Movw::emitIAS(const Cfg *Func) const {
+ assert(getSrcSize() == 1);
+ ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ Asm->movw(getDest(), getSrc(0), getPredicate());
+ if (Asm->needsTextFixup())
+ emitUsingTextFixup(Func);
+}
+
template <> void InstARM32Movt::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
@@ -924,6 +937,14 @@ template <> void InstARM32Movt::emit(const Cfg *Func) const {
}
}
+template <> void InstARM32Movt::emitIAS(const Cfg *Func) const {
+ assert(getSrcSize() == 2);
+ ARM32::AssemblerARM32 *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ Asm->movt(getDest(), getSrc(1), getPredicate());
+ if (Asm->needsTextFixup())
+ emitUsingTextFixup(Func);
+}
+
void InstARM32Pop::emit(const Cfg *Func) const {
// TODO(jpp): Improve FP register save/restore.
if (!BuildDefs::dump())
@@ -1462,4 +1483,13 @@ template class InstARM32ThreeAddrFP<InstARM32::Vsub>;
template class InstARM32TwoAddrGPR<InstARM32::Movt>;
+template class InstARM32UnaryopGPR<InstARM32::Movw, false>;
+template class InstARM32UnaryopGPR<InstARM32::Clz, false>;
+template class InstARM32UnaryopGPR<InstARM32::Mvn, false>;
+template class InstARM32UnaryopGPR<InstARM32::Rbit, false>;
+template class InstARM32UnaryopGPR<InstARM32::Rev, false>;
+template class InstARM32UnaryopGPR<InstARM32::Sxt, true>;
+template class InstARM32UnaryopGPR<InstARM32::Uxt, true>;
+template class InstARM32UnaryopFP<InstARM32::Vsqrt>;
+
} // end of namespace Ice
« src/IceAssemblerARM32.cpp ('K') | « src/IceInstARM32.h ('k') | src/IceRegistersARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698