1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/unittests/ADT
Craig Topper e1fe9f0a92 [APInt] Add support for dividing or remainder by a uint64_t or int64_t.
Summary:
This patch adds udiv/sdiv/urem/srem/udivrem/sdivrem methods that can divide by a uint64_t. This makes division consistent with all the other arithmetic operations.

This modifies the interface of the divide helper method to work on raw arrays instead of APInts. This way we can pass the uint64_t in for the RHS without wrapping it in an APInt. This required moving all the Quotient and Remainder allocation handling up to the callers. For udiv/urem this was as simple as just creating the Quotient/Remainder with the right size when they were declared. For udivrem we have to rely on reallocate not changing the contents of the variable LHS or RHS is aliased with the Quotient or Remainder APInts. We also have to zero the upper bits of Remainder and Quotient that divide doesn't write to if lhsWords/rhsWords is smaller than the width.

I've update the toString method to use the new udivrem.

Reviewers: hans, dblaikie, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33310

llvm-svn: 303431
2017-05-19 16:43:54 +00:00
..
APFloatTest.cpp [AsmWriter/APFloat] FP constant printing: Avoid usage of locale dependent snprinf 2017-04-21 02:52:17 +00:00
APIntTest.cpp [APInt] Add support for dividing or remainder by a uint64_t or int64_t. 2017-05-19 16:43:54 +00:00
APSIntTest.cpp
ArrayRefTest.cpp
BitmaskEnumTest.cpp
BitVectorTest.cpp [BitVector] Add find_[first,last]_[set,unset]_in. 2017-05-17 15:49:45 +00:00
BreadthFirstIteratorTest.cpp [ADT] Add a generic breadth-first-search graph iterator. 2017-04-06 17:03:04 +00:00
BumpPtrListTest.cpp
CMakeLists.txt [ADT] Add a generic breadth-first-search graph iterator. 2017-04-06 17:03:04 +00:00
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp Add support for DenseMap/DenseSet count and find using const pointers 2017-03-10 00:25:26 +00:00
DenseSetTest.cpp Add support for DenseMap/DenseSet count and find using const pointers 2017-03-10 00:25:26 +00:00
DepthFirstIteratorTest.cpp
FoldingSet.cpp
FunctionRefTest.cpp
HashingTest.cpp
IListBaseTest.cpp
IListIteratorTest.cpp Fix some missing negations in the traits checking from r294349 2017-02-07 21:31:03 +00:00
IListNodeBaseTest.cpp
IListNodeTest.cpp
IListSentinelTest.cpp
IListTest.cpp
ImmutableMapTest.cpp
ImmutableSetTest.cpp
IntEqClassesTest.cpp
IntervalMapTest.cpp
IntrusiveRefCntPtrTest.cpp [ADT] Attempt to fix GCC warning in IntrusiveRefCntPtrTest. 2017-01-04 22:49:55 +00:00
IteratorTest.cpp ADT: Add range helpers for pointer_ and pointee_iterator 2017-03-27 12:56:12 +00:00
MakeUniqueTest.cpp
MapVectorTest.cpp
OptionalTest.cpp
PackedVectorTest.cpp
PointerEmbeddedIntTest.cpp
PointerIntPairTest.cpp
PointerSumTypeTest.cpp
PointerUnionTest.cpp
PostOrderIteratorTest.cpp
PriorityWorklistTest.cpp [ADT] Speculative attempt to fix build bot issues with r290952. 2017-01-04 11:40:18 +00:00
RangeAdapterTest.cpp
ReverseIterationTest.cpp
SCCIteratorTest.cpp
ScopeExitTest.cpp
SequenceTest.cpp
SetVectorTest.cpp
SimpleIListTest.cpp
SmallPtrSetTest.cpp ADT: Fix SmallPtrSet iterators in reverse mode 2017-03-07 21:56:32 +00:00
SmallStringTest.cpp
SmallVectorTest.cpp
SparseBitVectorTest.cpp [ADT] Add SparseBitVector::find_last(). 2017-01-17 23:09:21 +00:00
SparseMultiSetTest.cpp
SparseSetTest.cpp
STLExtrasTest.cpp Fix sign compare warning in unit test by using an explicit unsigned literal suffix 2017-03-13 21:46:12 +00:00
StringExtrasTest.cpp [StringExtras] Add a fromHex to complement toHex. 2017-04-25 20:21:35 +00:00
StringMapTest.cpp Spelling mistakes in comments. NFCI. 2017-03-31 10:59:37 +00:00
StringRefTest.cpp Add more test cases for StringRef::edit_distance 2017-04-14 08:34:32 +00:00
StringSwitchTest.cpp
TestGraph.h
TinyPtrVectorTest.cpp Remove uses of deprecated std::random_shuffle in the LLVM code base. Reviewed as https://reviews.llvm.org/D29780. 2017-02-16 14:37:03 +00:00
TripleTest.cpp Add SUSE vendor 2017-04-24 11:18:29 +00:00
TwineTest.cpp
VariadicFunctionTest.cpp