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

Unified Diff: src/IceInstARM32.cpp

Issue 1511653002: Fix problems with sandboxing and the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit. 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 | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/sandboxing.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 5cc0a15ea30039e5deabc56b6f70bca3eced7aec..5e79128aafd7ebac93e223c93e3a268cbe8bdb8c 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -1286,12 +1286,6 @@ void InstARM32Pop::emitIAS(const Cfg *Func) const {
// Note: Can only apply pop register if single register is not sp.
assert((RegARM32::Encoded_Reg_sp != LastDest->getRegNum()) &&
"Effects of pop register SP is undefined!");
- // TODO(kschimpf) ARM sandbox does not allow the single register form of
- // pop, and the popList form expects multiple registers. Convert this
- // assert to a conditional check once it has been shown that popList
- // works.
- assert(!Func->getContext()->getFlags().getUseSandboxing() &&
- "pop register not in ARM sandbox!");
Asm->pop(LastDest, CondARM32::AL);
break;
default:
@@ -1392,12 +1386,6 @@ void InstARM32Push::emitIAS(const Cfg *Func) const {
// Note: Can only apply push register if single register is not sp.
assert((RegARM32::Encoded_Reg_sp != LastSrc->getRegNum()) &&
"Effects of push register SP is undefined!");
- // TODO(kschimpf) ARM sandbox does not allow the single register form of
- // push, and the pushList form expects multiple registers. Convert this
- // assert to a conditional check once it has been shown that pushList
- // works.
- assert(!Func->getContext()->getFlags().getUseSandboxing() &&
- "push register not in ARM sandbox!");
Asm->push(LastSrc, CondARM32::AL);
break;
}
@@ -1796,6 +1784,21 @@ void OperandARM32ShAmtImm::dump(const Cfg *, Ostream &Str) const {
ShAmt->dump(Str);
}
+OperandARM32FlexImm *OperandARM32FlexImm::create(Cfg *Func, Type Ty,
+ uint32_t Imm,
+ uint32_t RotateAmt) {
+ // The assembler wants the smallest rotation. Rotate if needed. Note: Imm is
+ // an 8-bit value.
+ assert(Utils::IsUint(8, Imm) &&
+ "Flex immediates can only be defined on 8-bit immediates");
+ while ((Imm & 0x03) == 0 && RotateAmt > 0) {
+ --RotateAmt;
+ Imm = Imm >> 2;
+ }
+ return new (Func->allocate<OperandARM32FlexImm>())
+ OperandARM32FlexImm(Func, Ty, Imm, RotateAmt);
+}
+
void OperandARM32FlexImm::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
« no previous file with comments | « src/IceInstARM32.h ('k') | tests_lit/assembler/arm32/sandboxing.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698