summaryrefslogtreecommitdiffstats
path: root/unittests/Support/ScaledNumberTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Cosmetic. Added braces to address gcc warning: suggest explicit braces to ↵Galina Kistanova2017-05-201-2/+4
| | | | | | avoid ambiguous 'else' [-Wdangling-else]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303471 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix infinite recursion in ScaledNumber::toInt.Diego Novillo2015-05-011-0/+5
| | | | | | | | | Patch from dexonsmith. The call to toInt() was calling compareTo() which in some cases would call back to toInt(), creating an infinite loop. Fixed by simplifying the logic in compareTo() to avoid the co-recursion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236326 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix private constructor for ScaledNumber.Diego Novillo2015-04-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | Summary: The private constructor for ScaledNumber was using uint64_t instead of DigitsT. This was preventing instantiations of ScaledNumber with anything other than uint64_t types. In implementing the tests, I ran into another issue. Operators >>= and <<= did not have variants for accepting other ScaledNumber as the shift argument. This is expected by the SCALED_NUMBER_BOP. It makes no sense to allow shifting a ScaledNumber by another ScaledNumber, so the patch includes two new templates for shifting ScaledNumbers. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9350 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236232 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment. NFC.Diego Novillo2015-04-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236227 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+0
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225974 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused typedef. GCC warns about this.Benjamin Kramer2014-07-011-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212105 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Return ScaledNumbers::MaxScale from getQuotient()Duncan P. N. Exon Smith2014-06-241-4/+4
| | | | | | Return MaxScale now that it's available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211559 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::getSum() and getDifference()Duncan P. N. Exon Smith2014-06-231-0/+150
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211553 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Return scale from ScaledNumbers::matchScales()Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | | | This will be convenient when extracting `ScaledNumbers::getSum()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211552 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::matchScale()Duncan P. N. Exon Smith2014-06-231-0/+64
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211531 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup r211507Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211521 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Extract ScaledNumbers::compare()Duncan P. N. Exon Smith2014-06-231-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211507 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: ScaledNumber: Fix inconsistent test namesDuncan P. N. Exon Smith2014-06-201-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211414 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getLg{,Floor,Ceiling}()Duncan P. N. Exon Smith2014-06-201-0/+94
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211413 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumber::getQuotient() and getProduct()Duncan P. N. Exon Smith2014-06-201-0/+112
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211409 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Mark end of namespacesDuncan P. N. Exon Smith2014-06-201-1/+2
| | | | | | This convinces clang-format to leave a newline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211406 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Clean up getRounded() testsDuncan P. N. Exon Smith2014-06-201-14/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211337 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getAdjusted()Duncan P. N. Exon Smith2014-06-201-0/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211336 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Write ScaledNumbers::getRounded()Duncan P. N. Exon Smith2014-06-201-0/+60
Start extracting helper functions out of -block-freq's `UnsignedFloat` into `Support/ScaledNumber.h` with the eventual goal of moving and renaming the class to `ScaledNumber`. The bike shed about names is still being painted, but I'm going with this for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211333 91177308-0d34-0410-b5e6-96231b3b80d8