summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/ScaledNumberTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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. llvm-svn: 236326
* 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 llvm-svn: 236232
* Fix typo in comment. NFC.Diego Novillo2015-04-301-1/+1
| | | | llvm-svn: 236227
* [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. llvm-svn: 225974
* Remove unused typedef. GCC warns about this.Benjamin Kramer2014-07-011-3/+0
| | | | llvm-svn: 212105
* Support: Return ScaledNumbers::MaxScale from getQuotient()Duncan P. N. Exon Smith2014-06-241-4/+4
| | | | | | Return MaxScale now that it's available. llvm-svn: 211559
* Support: Extract ScaledNumbers::getSum() and getDifference()Duncan P. N. Exon Smith2014-06-231-0/+150
| | | | llvm-svn: 211553
* Support: Return scale from ScaledNumbers::matchScales()Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | | | This will be convenient when extracting `ScaledNumbers::getSum()`. llvm-svn: 211552
* Support: Extract ScaledNumbers::matchScale()Duncan P. N. Exon Smith2014-06-231-0/+64
| | | | llvm-svn: 211531
* Cleanup r211507Duncan P. N. Exon Smith2014-06-231-1/+1
| | | | llvm-svn: 211521
* Support: Extract ScaledNumbers::compare()Duncan P. N. Exon Smith2014-06-231-0/+37
| | | | llvm-svn: 211507
* Support: ScaledNumber: Fix inconsistent test namesDuncan P. N. Exon Smith2014-06-201-6/+6
| | | | llvm-svn: 211414
* Support: Write ScaledNumbers::getLg{,Floor,Ceiling}()Duncan P. N. Exon Smith2014-06-201-0/+94
| | | | llvm-svn: 211413
* Support: Write ScaledNumber::getQuotient() and getProduct()Duncan P. N. Exon Smith2014-06-201-0/+112
| | | | llvm-svn: 211409
* Support: Mark end of namespacesDuncan P. N. Exon Smith2014-06-201-1/+2
| | | | | | This convinces clang-format to leave a newline. llvm-svn: 211406
* Support: Clean up getRounded() testsDuncan P. N. Exon Smith2014-06-201-14/+12
| | | | llvm-svn: 211337
* Support: Write ScaledNumbers::getAdjusted()Duncan P. N. Exon Smith2014-06-201-0/+23
| | | | llvm-svn: 211336
* 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. llvm-svn: 211333
OpenPOWER on IntegriCloud