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

Unified Diff: src/IceInstARM32.cpp

Issue 1452293003: Add BL (immediate) and BLX (register) to ARM assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 5 years, 1 month 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 465d81d892378eed956afc351d5804e92d7786f1..4c4a01d09ab06fbda5a4114a9936bbb5ea249662 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -1005,6 +1005,26 @@ void InstARM32Call::emit(const Cfg *Func) const {
Func->getTarget()->resetStackAdjustment();
}
+void InstARM32Call::emitIAS(const Cfg *Func) const {
+ assert(getSrcSize() == 1);
+ auto *Asm = Func->getAssembler<ARM32::AssemblerARM32>();
+ if (llvm::isa<ConstantInteger32>(getCallTarget())) {
+ // 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 =
+ llvm::dyn_cast<ConstantRelocatable>(getCallTarget())) {
+ // Calls only have 24-bits, but the linker should insert veneers to extend
+ // the range if needed.
+ Asm->bl(CallTarget);
+ } else {
+ Asm->blx(getCallTarget());
+ }
+ if (Asm->needsTextFixup())
+ return emitUsingTextFixup(Func);
+ Func->getTarget()->resetStackAdjustment();
+}
+
void InstARM32Call::dump(const Cfg *Func) const {
if (!BuildDefs::dump())
return;

Powered by Google App Engine
This is Rietveld 408576698