| OLD | NEW |
| 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// | 1 //===- subzero/src/IceInstX8632.cpp - X86-32 instruction implementation ---===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file implements the InstX8632 and OperandX8632 classes, | 10 // This file implements the InstX8632 and OperandX8632 classes, |
| (...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 if (Shift > 0) | 1376 if (Shift > 0) |
| 1377 Str << (1u << Shift) << "*"; | 1377 Str << (1u << Shift) << "*"; |
| 1378 Index->emit(Func); | 1378 Index->emit(Func); |
| 1379 Dumped = true; | 1379 Dumped = true; |
| 1380 } | 1380 } |
| 1381 // Pretty-print the Offset. | 1381 // Pretty-print the Offset. |
| 1382 bool OffsetIsZero = false; | 1382 bool OffsetIsZero = false; |
| 1383 bool OffsetIsNegative = false; | 1383 bool OffsetIsNegative = false; |
| 1384 if (Offset == NULL) { | 1384 if (Offset == NULL) { |
| 1385 OffsetIsZero = true; | 1385 OffsetIsZero = true; |
| 1386 } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) { | 1386 } else if (ConstantInteger32 *CI = |
| 1387 llvm::dyn_cast<ConstantInteger32>(Offset)) { |
| 1387 OffsetIsZero = (CI->getValue() == 0); | 1388 OffsetIsZero = (CI->getValue() == 0); |
| 1388 OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0); | 1389 OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0); |
| 1390 } else { |
| 1391 assert(llvm::isa<ConstantRelocatable>(Offset)); |
| 1389 } | 1392 } |
| 1390 if (Dumped) { | 1393 if (Dumped) { |
| 1391 if (!OffsetIsZero) { // Suppress if Offset is known to be 0 | 1394 if (!OffsetIsZero) { // Suppress if Offset is known to be 0 |
| 1392 if (!OffsetIsNegative) // Suppress if Offset is known to be negative | 1395 if (!OffsetIsNegative) // Suppress if Offset is known to be negative |
| 1393 Str << "+"; | 1396 Str << "+"; |
| 1394 Offset->emit(Func); | 1397 Offset->emit(Func); |
| 1395 } | 1398 } |
| 1396 } else { | 1399 } else { |
| 1397 // There is only the offset. | 1400 // There is only the offset. |
| 1398 Offset->emit(Func); | 1401 Offset->emit(Func); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1423 Index->dump(Func); | 1426 Index->dump(Func); |
| 1424 else | 1427 else |
| 1425 Index->dump(Str); | 1428 Index->dump(Str); |
| 1426 Dumped = true; | 1429 Dumped = true; |
| 1427 } | 1430 } |
| 1428 // Pretty-print the Offset. | 1431 // Pretty-print the Offset. |
| 1429 bool OffsetIsZero = false; | 1432 bool OffsetIsZero = false; |
| 1430 bool OffsetIsNegative = false; | 1433 bool OffsetIsNegative = false; |
| 1431 if (Offset == NULL) { | 1434 if (Offset == NULL) { |
| 1432 OffsetIsZero = true; | 1435 OffsetIsZero = true; |
| 1433 } else if (ConstantInteger *CI = llvm::dyn_cast<ConstantInteger>(Offset)) { | 1436 } else if (ConstantInteger32 *CI = |
| 1437 llvm::dyn_cast<ConstantInteger32>(Offset)) { |
| 1434 OffsetIsZero = (CI->getValue() == 0); | 1438 OffsetIsZero = (CI->getValue() == 0); |
| 1435 OffsetIsNegative = (static_cast<int64_t>(CI->getValue()) < 0); | 1439 OffsetIsNegative = (static_cast<int32_t>(CI->getValue()) < 0); |
| 1440 } else { |
| 1441 assert(llvm::isa<ConstantRelocatable>(Offset)); |
| 1436 } | 1442 } |
| 1437 if (Dumped) { | 1443 if (Dumped) { |
| 1438 if (!OffsetIsZero) { // Suppress if Offset is known to be 0 | 1444 if (!OffsetIsZero) { // Suppress if Offset is known to be 0 |
| 1439 if (!OffsetIsNegative) // Suppress if Offset is known to be negative | 1445 if (!OffsetIsNegative) // Suppress if Offset is known to be negative |
| 1440 Str << "+"; | 1446 Str << "+"; |
| 1441 Offset->dump(Func, Str); | 1447 Offset->dump(Func, Str); |
| 1442 } | 1448 } |
| 1443 } else { | 1449 } else { |
| 1444 // There is only the offset. | 1450 // There is only the offset. |
| 1445 Offset->dump(Func, Str); | 1451 Offset->dump(Func, Str); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 } | 1488 } |
| 1483 Str << "("; | 1489 Str << "("; |
| 1484 if (Func) | 1490 if (Func) |
| 1485 Var->dump(Func); | 1491 Var->dump(Func); |
| 1486 else | 1492 else |
| 1487 Var->dump(Str); | 1493 Var->dump(Str); |
| 1488 Str << ")"; | 1494 Str << ")"; |
| 1489 } | 1495 } |
| 1490 | 1496 |
| 1491 } // end of namespace Ice | 1497 } // end of namespace Ice |
| OLD | NEW |