OLD | NEW |
1 //===- subzero/src/IceOperand.cpp - High-level operand implementation -----===// | 1 //===- subzero/src/IceOperand.cpp - High-level operand 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 /// \file | 10 /// \file |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 Str << "Inf"; | 636 Str << "Inf"; |
637 else | 637 else |
638 Str << W.getWeight(); | 638 Str << W.getWeight(); |
639 return Str; | 639 return Str; |
640 } | 640 } |
641 | 641 |
642 // =========== Immediate Randomization and Pooling routines ============== | 642 // =========== Immediate Randomization and Pooling routines ============== |
643 // Specialization of the template member function for ConstantInteger32 | 643 // Specialization of the template member function for ConstantInteger32 |
644 // TODO(stichnot): try to move this specialization into a target-specific file. | 644 // TODO(stichnot): try to move this specialization into a target-specific file. |
645 template <> bool ConstantInteger32::shouldBeRandomizedOrPooled() const { | 645 template <> bool ConstantInteger32::shouldBeRandomizedOrPooled() const { |
646 uint32_t Threshold = | 646 uint32_t Threshold = getFlags().getRandomizeAndPoolImmediatesThreshold(); |
647 GlobalContext::getFlags().getRandomizeAndPoolImmediatesThreshold(); | 647 if (getFlags().getRandomizeAndPoolImmediatesOption() == RPI_None) |
648 if (GlobalContext::getFlags().getRandomizeAndPoolImmediatesOption() == | |
649 RPI_None) | |
650 return false; | 648 return false; |
651 if (getType() != IceType_i32 && getType() != IceType_i16 && | 649 if (getType() != IceType_i32 && getType() != IceType_i16 && |
652 getType() != IceType_i8) | 650 getType() != IceType_i8) |
653 return false; | 651 return false; |
654 // The Following checks if the signed representation of Value is between | 652 // The Following checks if the signed representation of Value is between |
655 // -Threshold/2 and +Threshold/2 | 653 // -Threshold/2 and +Threshold/2 |
656 bool largerThanThreshold = Threshold / 2 + Value >= Threshold; | 654 bool largerThanThreshold = Threshold / 2 + Value >= Threshold; |
657 return largerThanThreshold; | 655 return largerThanThreshold; |
658 } | 656 } |
659 | 657 |
660 } // end of namespace Ice | 658 } // end of namespace Ice |
OLD | NEW |