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

Unified Diff: src/IceOperand.h

Issue 476323004: Start adding an integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: make fixups part of address Created 6 years, 3 months 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/IceMemoryRegion.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 7e7c4f02add3b73cec81a159063ec28b48b01961..42c3b65b13eeb716d2ebaa9f95aa585e5f5e2723 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -27,7 +27,8 @@ class Operand {
public:
enum OperandKind {
kConst_Base,
- kConstInteger,
+ kConstInteger32,
+ kConstInteger64,
kConstFloat,
kConstDouble,
kConstRelocatable,
@@ -142,16 +143,23 @@ private:
const T Value;
};
-typedef ConstantPrimitive<uint64_t, Operand::kConstInteger> ConstantInteger;
+typedef ConstantPrimitive<uint32_t, Operand::kConstInteger32> ConstantInteger32;
+typedef ConstantPrimitive<uint64_t, Operand::kConstInteger64> ConstantInteger64;
typedef ConstantPrimitive<float, Operand::kConstFloat> ConstantFloat;
typedef ConstantPrimitive<double, Operand::kConstDouble> ConstantDouble;
-template <> inline void ConstantInteger::dump(GlobalContext *Ctx) const {
+template <> inline void ConstantInteger32::dump(GlobalContext *Ctx) const {
Ostream &Str = Ctx->getStrDump();
if (getType() == IceType_i1)
Str << (getValue() ? "true" : "false");
else
- Str << static_cast<int64_t>(getValue());
+ Str << static_cast<int32_t>(getValue());
+}
+
+template <> inline void ConstantInteger64::dump(GlobalContext *Ctx) const {
+ assert(getType() == IceType_i64);
+ Ostream &Str = Ctx->getStrDump();
+ Str << static_cast<int64_t>(getValue());
}
// RelocatableTuple bundles the parameters that are used to
« no previous file with comments | « src/IceMemoryRegion.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698