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

Unified Diff: src/IceAssemblerARM32.cpp

Issue 1426513004: Fix ARM emit() methods to count instructions generated. (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
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.cpp
diff --git a/src/IceAssemblerARM32.cpp b/src/IceAssemblerARM32.cpp
index 135e1b94dfcac5b582661747841a413e2e76433e..756b0a69ba2a17427569caecc8867cca9e5f4d94 100644
--- a/src/IceAssemblerARM32.cpp
+++ b/src/IceAssemblerARM32.cpp
@@ -270,9 +270,8 @@ namespace ARM32 {
size_t MoveRelocatableFixup::emit(GlobalContext *Ctx,
const Assembler &Asm) const {
- static constexpr const size_t FixupSize = sizeof(IValueT);
if (!BuildDefs::dump())
- return FixupSize;
+ return InstARM32::InstSize;
Ostream &Str = Ctx->getStrEmit();
IValueT Inst = Asm.load<IValueT>(position());
Str << "\tmov" << (kind() == llvm::ELF::R_ARM_MOVW_ABS_NC ? "w" : "t") << "\t"
@@ -280,7 +279,7 @@ size_t MoveRelocatableFixup::emit(GlobalContext *Ctx,
<< ", #:" << (kind() == llvm::ELF::R_ARM_MOVW_ABS_NC ? "lower" : "upper")
<< "16:" << symbol(Ctx) << "\t@ .word "
<< llvm::format_hex_no_prefix(Inst, 8) << "\n";
- return FixupSize;
+ return InstARM32::InstSize;
}
MoveRelocatableFixup *AssemblerARM32::createMoveFixup(bool IsMovW,
@@ -360,11 +359,12 @@ void AssemblerARM32::bind(Label *L) {
}
void AssemblerARM32::emitTextInst(const std::string &Text, SizeT InstSize) {
- AssemblerBuffer::EnsureCapacity ensured(&Buffer);
AssemblerFixup *F = createTextFixup(Text, InstSize);
emitFixup(F);
- for (SizeT I = 0; I < InstSize; ++I)
+ for (SizeT I = 0; I < InstSize; ++I) {
+ AssemblerBuffer::EnsureCapacity ensured(&Buffer);
Buffer.emit<char>(0);
+ }
}
void AssemblerARM32::emitType01(CondARM32::Cond Cond, IValueT Type,
@@ -393,10 +393,9 @@ void AssemblerARM32::emitType01(IValueT Opcode, const Operand *OpRd,
emitType01(Opcode, Rd, Rn, OpSrc1, SetFlags, Cond, RuleChecks);
}
-void AssemblerARM32::emitType01(IValueT Opcode, IValueT Rd,
- IValueT Rn, const Operand *OpSrc1,
- bool SetFlags, CondARM32::Cond Cond,
- Type01Checks RuleChecks) {
+void AssemblerARM32::emitType01(IValueT Opcode, IValueT Rd, IValueT Rn,
+ const Operand *OpSrc1, bool SetFlags,
+ CondARM32::Cond Cond, Type01Checks RuleChecks) {
switch (RuleChecks) {
case NoChecks:
break;
« no previous file with comments | « src/IceAssemblerARM32.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698