Chromium Code Reviews

Unified Diff: src/IceInstX8632.cpp

Issue 569033002: Split ConstantInteger into ConstantInteger32 and ConstantInteger64. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstX8632.cpp
diff --git a/src/IceInstX8632.cpp b/src/IceInstX8632.cpp
index 06804f3bb8be7d442f2e06cd9a29415675055b1f..a61805e2d96b53ef73566c28fed2224a20b69de4 100644
--- a/src/IceInstX8632.cpp
+++ b/src/IceInstX8632.cpp
@@ -1383,9 +1383,12 @@ void OperandX8632Mem::emit(const Cfg *Func) const {
bool OffsetIsNegative = false;
if (Offset == NULL) {
OffsetIsZero = true;
- } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) {
+ } else if (ConstantInteger32 *CI =
+ llvm::dyn_cast<ConstantInteger32>(Offset)) {
OffsetIsZero = (CI->getValue() == 0);
- OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0);
+ OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0);
+ } else {
+ assert(llvm::isa<ConstantRelocatable>(Offset));
}
if (Dumped) {
if (!OffsetIsZero) { // Suppress if Offset is known to be 0
@@ -1430,9 +1433,12 @@ void OperandX8632Mem::dump(const Cfg *Func, Ostream &Str) const {
bool OffsetIsNegative = false;
if (Offset == NULL) {
OffsetIsZero = true;
- } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) {
+ } else if (ConstantInteger32 *CI =
+ llvm::dyn_cast<ConstantInteger32>(Offset)) {
OffsetIsZero = (CI->getValue() == 0);
- OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0);
+ OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0);
+ } else {
+ assert(llvm::isa<ConstantRelocatable>(Offset));
}
if (Dumped) {
if (!OffsetIsZero) { // Suppress if Offset is known to be 0
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine