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

Unified Diff: src/IceAssemblerARM32.h

Issue 1519873003: Add trap (an UDF instruction) to the ARM integrated Assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Clean up modeling of trap instruction. Created 5 years 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 | « no previous file | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerARM32.h
diff --git a/src/IceAssemblerARM32.h b/src/IceAssemblerARM32.h
index 08619b4632e4b44f9ae49268fbc8d9329949fe42..6625b0d52e78de2716194b3d19c8dab024721a04 100644
--- a/src/IceAssemblerARM32.h
+++ b/src/IceAssemblerARM32.h
@@ -114,12 +114,10 @@ public:
void alignFunction() override {
const SizeT Align = 1 << getBundleAlignLog2Bytes();
SizeT BytesNeeded = Utils::OffsetToAlignment(Buffer.getPosition(), Align);
- constexpr IValueT UndefinedInst = 0xe7fedef0; // udf #60896
constexpr SizeT InstSize = sizeof(IValueT);
assert(BytesNeeded % InstARM32::InstSize == 0);
while (BytesNeeded > 0) {
- AssemblerBuffer::EnsureCapacity ensured(&Buffer);
- emitInst(UndefinedInst);
+ trap();
BytesNeeded -= InstSize;
}
}
@@ -128,12 +126,7 @@ public:
const char *getAlignDirective() const override { return ".p2alignl"; }
- llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override {
- // Use a particular UDF encoding -- TRAPNaCl in LLVM: 0xE7FEDEF0
- // http://llvm.org/viewvc/llvm-project?view=revision&revision=173943
- static const uint8_t Padding[] = {0xE7, 0xFE, 0xDE, 0xF0};
- return llvm::ArrayRef<uint8_t>(Padding, 4);
- }
+ llvm::ArrayRef<uint8_t> getNonExecBundlePadding() const override;
void padWithNop(intptr_t Padding) override;
@@ -307,6 +300,8 @@ public:
// Implements sxtb/sxth depending on type of OpSrc0.
void sxt(const Operand *OpRd, const Operand *OpSrc0, CondARM32::Cond Cond);
+ void trap();
+
void tst(const Operand *OpRn, const Operand *OpSrc1, CondARM32::Cond Cond);
void udiv(const Operand *OpRd, const Operand *OpRn, const Operand *OpSrc1,
« no previous file with comments | « no previous file | src/IceAssemblerARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698