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

Unified Diff: src/IceInstARM32.h

Issue 1449263003: Subzero. ARM32. Introduces the ShAmtImm Operand. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: 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 | « no previous file | src/IceInstARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstARM32.h
diff --git a/src/IceInstARM32.h b/src/IceInstARM32.h
index f0240a13514e2a8773f3f2f5bf1d3cd89e90d3c7..41ca5080568053ba2215af7f47b734476a5132ee 100644
--- a/src/IceInstARM32.h
+++ b/src/IceInstARM32.h
@@ -38,6 +38,7 @@ public:
enum OperandKindARM32 {
k__Start = Operand::kTarget,
kMem,
+ kShAmtImm,
kFlexStart,
kFlexImm = kFlexStart,
kFlexFpImm,
@@ -152,6 +153,36 @@ private:
AddrMode Mode;
};
+/// OperandARM32ShAmtImm represents an Immediate that is used in one of the
+/// shift-by-immediate instructions (lsl, lsr, and asr), and shift-by-immediate
+/// shifted registers.
+class OperandARM32ShAmtImm : public OperandARM32 {
+ OperandARM32ShAmtImm() = delete;
+ OperandARM32ShAmtImm(const OperandARM32ShAmtImm &) = delete;
+ OperandARM32ShAmtImm &operator=(const OperandARM32ShAmtImm &) = delete;
+
+public:
+ static OperandARM32ShAmtImm *create(Cfg *Func, ConstantInteger32 *ShAmt) {
+ return new (Func->allocate<OperandARM32ShAmtImm>())
+ OperandARM32ShAmtImm(ShAmt);
+ }
+
+ static bool classof(const Operand *Operand) {
+ return Operand->getKind() == static_cast<OperandKind>(kShAmtImm);
+ }
+
+ void emit(const Cfg *Func) const override;
+ using OperandARM32::dump;
+ void dump(const Cfg *Func, Ostream &Str) const override;
+
+ uint32_t getShAmtImm() const { return ShAmt->getValue(); }
+
+private:
+ explicit OperandARM32ShAmtImm(ConstantInteger32 *SA);
+
+ const ConstantInteger32 *const ShAmt;
+};
+
/// OperandARM32Flex represent the "flexible second operand" for data-processing
/// instructions. It can be a rotatable 8-bit constant, or a register with an
/// optional shift operand. The shift amount can even be a third register.
« no previous file with comments | « no previous file | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698