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

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: Clean up small issues raised in last patch. 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
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index fbe7636b061b21b8fa0dfec36520d8e2ff9ac010..d038cad9daf97c7a100cbf4e7158fa25d3262a72 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -1278,12 +1278,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:
@@ -1384,12 +1378,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;
}
@@ -1788,6 +1776,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;

Powered by Google App Engine
This is Rietveld 408576698