1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

308 Commits

Author SHA1 Message Date
Eli Friedman
d18dd0a7b0 Handle '.' correctly in hex float literal parsing.
There were a couple of different loops that were not handling
'.' correctly in APFloat::convertFromHexadecimalString; these mistakes
could lead to assertion failures and incorrect rounding for overlong
hex float literals.

Fixes PR16643.

llvm-svn: 186539
2013-07-17 22:17:29 +00:00
Benjamin Kramer
5d304115ca Sync SmallBitVector with BitVector. Add unit tests for the missing methods.
llvm-svn: 186123
2013-07-11 21:59:16 +00:00
Michael Gottesman
b399188af0 [APFloat] Ensure that we can properly parse strings that do not have null terminators.
rdar://14323230

llvm-svn: 185397
2013-07-01 23:54:08 +00:00
Michael Gottesman
6fb80a527d [APFloat] Added unittest for APFloat.divide that checks special cases, result categories, and result statuses.
llvm-svn: 185050
2013-06-27 00:42:00 +00:00
Michael Gottesman
e83cdadda7 Removed two logging printf statements from the APFloat tests... = /.
llvm-svn: 185045
2013-06-27 00:00:45 +00:00
Michael Gottesman
34f626681a [APFloat] Added unittest for APFloat.multiply that checks special cases, result categories, and result status.
llvm-svn: 185044
2013-06-26 23:55:26 +00:00
Michael Gottesman
78c7b539c6 [APFloat] Added unittest for APFloat.subtract that checks special cases, result categories, and result status.
llvm-svn: 185043
2013-06-26 23:55:23 +00:00
Michael Gottesman
e1dcbcd7a2 [APFloat] Removed debugging cruft that snuck in.
llvm-svn: 184974
2013-06-26 17:59:36 +00:00
Michael Gottesman
85c75137ce [APFloat] Removed trailing whitespace from unittests.
llvm-svn: 184715
2013-06-24 09:58:09 +00:00
Michael Gottesman
69c24d2254 [APFloat] Added a large unittest for APFloat.add that checks that special values are computed correctly.
llvm-svn: 184714
2013-06-24 09:58:07 +00:00
Michael Gottesman
5982da1002 [APFloat] Rename isIEEENormal => isNormal and remove old isNormal method.
The old isNormal is already functionally replaced by the method isFiniteNonZero
in r184350 and all references to said method were replaced in LLVM/clang in
r184356/134366.

llvm-svn: 184449
2013-06-20 18:34:38 +00:00
Michael Gottesman
c03c0f1f1b [APFloat] Fix typo in test so we actually test if we handle denormals.
llvm-svn: 184447
2013-06-20 18:25:16 +00:00
Michael Gottesman
7af8cd5aad [APFloat] Changed APFloat::isNormal => APFloat::isFiniteNonZero for all tests in unittests.
I forgot to to do this in r184356. The only references were in APFloatTest.cpp.

llvm-svn: 184366
2013-06-19 21:53:45 +00:00
Michael Gottesman
c82a0b3e6d [APFloat] Added isFiniteNonZero predicate.
This is the first patch in a series of patches to rename isNormal =>
isFiniteNonZero and isIEEENormal => isNormal. In order to prevent careless
errors on my part the overall plan is:

1. Add the isFiniteNonZero predicate with tests. I can do this in a method
independent of isNormal. (This step is this patch).
2. Convert all references to isNormal with isFiniteNonZero. My plan is to
comment out isNormal locally and continually convert isNormal references =>
isFiniteNonZero until llvm/clang compiles.
3. Remove old isNormal and rename isIEEENormal to isNormal.
4. Look through all of said references from patch 2 and see if we can simplify
them by using the new isNormal.

llvm-svn: 184350
2013-06-19 21:00:17 +00:00
Benjamin Kramer
2fbc7287e4 BitVector: Do the right thing in all() when Size is a multiple of BITWORD_SIZE.
llvm-svn: 183525
2013-06-07 15:14:31 +00:00
Benjamin Kramer
5f752c703f Optimize BitVector::all().
llvm-svn: 183521
2013-06-07 14:14:38 +00:00
Michael Gottesman
b152f55b6e IEEE-754R 5.7.2 General Operations is* operations (except for isCanonical).
Specifically the following work was done:

1. If the operation was not implemented, I implemented it.

2. If the operation was already implemented, I just moved its location
in the APFloat header into the IEEE-754R 5.7.2 section. If the name was
incorrect, I put in a comment giving the true IEEE-754R name.

Also unittests have been added for all of the functions which did not
already have a unittest.

llvm-svn: 183179
2013-06-04 03:46:25 +00:00
Benjamin Kramer
36e2996805 Try to avoid "integer literal too big" warnings from older GCCs.
llvm-svn: 183081
2013-06-01 22:29:41 +00:00
Michael Gottesman
cad66f5206 [APFloat] Added a unittest for APFloat::getZero.
llvm-svn: 183028
2013-05-31 18:43:34 +00:00
Michael Gottesman
2adb2144bb Implement IEEE-754R 2008 nextUp/nextDown functions in the guise of the function APFloat::next(bool nextDown).
rdar://13852078

llvm-svn: 182945
2013-05-30 18:07:13 +00:00
Michael Gottesman
bff1b48095 Added a unittest for APFloat::getSmallestNormalized.
llvm-svn: 182897
2013-05-30 00:18:47 +00:00
Michael Gottesman
09f3ab01b8 Added code to the unittest for APFloat::getSmallest to double check that we consider the result to be denormal.
I additionally changed certain checks to use EXPECT_FALSE instead of a boolean
complement with EXPECT_TRUE.

llvm-svn: 182896
2013-05-30 00:18:44 +00:00
Michael Gottesman
7fceea7dae Add a unittest for APFloat::getSmallest.
llvm-svn: 182894
2013-05-29 23:58:29 +00:00
Michael Gottesman
2a51955f08 [APInt] Implement tcDecrement as a counterpart to tcIncrement. This is for use in APFloat IEEE-754R 2008 nextUp/nextDown function.
rdar://13852078

llvm-svn: 182801
2013-05-28 19:50:20 +00:00
Shuxin Yang
e016d80534 Fix a bug that APFloat::fusedMultiplyAdd() mistakenly evaluate "14.5f * -14.5f + 225.0f" to 225.0f.
llvm-svn: 181715
2013-05-13 18:03:12 +00:00
Jean-Luc Duprat
7776961622 SmallVector and SmallPtrSet allocations now power-of-two aligned.
This time tested on both OSX and Linux.

llvm-svn: 178377
2013-03-29 22:07:12 +00:00
Rafael Espindola
e78555387c Revert "Fix allocations of SmallVector and SmallPtrSet so they are more prone to"
This reverts commit 617330909f0c26a3f2ab8601a029b9bdca48aa61.

It broke the bots:

/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:150: PushPopTest
/home/clangbuild2/clang-ppc64-2/llvm.src/unittests/ADT/SmallVectorTest.cpp:118: Failure
Value of: v[i].getValue()
  Actual: 0
Expected: value
Which is: 2

llvm-svn: 178334
2013-03-29 07:11:21 +00:00
Jean-Luc Duprat
0ba254f23f Fix allocations of SmallVector and SmallPtrSet so they are more prone to
being power-of-two sized.

llvm-svn: 178332
2013-03-29 05:45:22 +00:00
David Blaikie
b39f6eaf73 Only include move-related Optional<T> tests when rvalue references are available.
llvm-svn: 175730
2013-02-21 07:58:45 +00:00
David Blaikie
117a44bd1a Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

llvm-svn: 175729
2013-02-21 07:55:39 +00:00
Benjamin Kramer
a2f37d8d3b Move the SplatByte helper to APInt and generalize it a bit.
llvm-svn: 175621
2013-02-20 13:00:06 +00:00
David Blaikie
05260669b1 Rename llvm::Optional<T>::Reset to 'reset' as per LLVM naming conventions.
Code review feedback on r175580 from Jordan Rose.

llvm-svn: 175595
2013-02-20 06:25:36 +00:00
David Blaikie
cbe2e7eb6b Allow llvm::Optional to work with types without default constructors.
This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

llvm-svn: 175580
2013-02-20 00:26:04 +00:00
Douglas Gregor
567c8d3dc3 Remove my bogus MapVector::erase() with a narrower ::pop_back(), and add a unit test.
llvm-svn: 175538
2013-02-19 18:26:07 +00:00
Meador Inge
58a7392486 ADT: Correct APInt::getActiveWords for zero values
PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
2013-02-07 18:36:50 +00:00
Michael Gottesman
0b23f2000b Added a unit test for r173983 that verifies that Target.isiOS() works correctly.
As a bonus I put in some extra checks to make sure that we are identifying the
machine word of various Mac OS X/iOS targets appropriately.

llvm-svn: 173994
2013-01-30 23:48:13 +00:00
Dmitri Gribenko
b7967d1481 Add file to CMakeLists (file added in r173505)
llvm-svn: 173513
2013-01-25 22:29:23 +00:00
Nick Lewycky
4c1f132b0c Add an insert() method to MapVector. Adds the first MapVector unit test.
llvm-svn: 173505
2013-01-25 22:11:02 +00:00
Benjamin Kramer
429ac6dc9a APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.
Fixes PR15054.

llvm-svn: 173459
2013-01-25 17:01:00 +00:00
NAKAMURA Takumi
48e4712d87 ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang on stage2, take two. [-Wsign-compare]
llvm-svn: 173144
2013-01-22 10:39:31 +00:00
NAKAMURA Takumi
7a2be44b4e ADT/SparseMultiSetTest.cpp: Try to appease cygwin-clang (libstdc++-4.5) on stage2. [-Wsign-compare]
llvm-svn: 173127
2013-01-22 05:30:15 +00:00
Michael Ilseman
ff647f94ab Introduce a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.
A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.

llvm-svn: 173064
2013-01-21 18:18:53 +00:00
Shuxin Yang
0640c4a0dc Implement APFloat::isDenormal()
llvm-svn: 171764
2013-01-07 18:59:35 +00:00
Jakob Stoklund Olesen
499d789d2b Add an iplist::clearAndLeakNodesUnsafely() function.
The iplist::clear() function can be quite expensive because it traverses
the entire list, calling deleteNode() and removeNodeFromList() on each
element. If node destruction and deallocation can be handled some other
way, clearAndLeakNodesUnsafely() can be used to jettison all nodes
without bringing them into cache.

The function name is meant to be ominous.

llvm-svn: 171540
2013-01-04 22:35:42 +00:00
Chandler Carruth
03fda8f594 Sort a few more #include lines in tools/... unittests/... and utils/...
llvm-svn: 171363
2013-01-02 10:26:28 +00:00
Jakob Stoklund Olesen
223ce5e130 Add an assertion for a likely ilist::splice() contract violation.
The single-element ilist::splice() function supports a noop move:

  List.splice(I, List, I);

The corresponding std::list function doesn't allow that, so add a unit
test to document that behavior.

This also means that

  List.splice(I, List, F);

is somewhat surprisingly not equivalent to

  List.splice(I, List, F, next(F));

This patch adds an assertion to catch the illegal case I == F above.
Alternatively, we could make I == F a legal noop, but that would make
ilist differ even more from std::list.

llvm-svn: 170443
2012-12-18 19:28:37 +00:00
Chandler Carruth
f413c260cc Sort the #include lines for unittest/...
llvm-svn: 169250
2012-12-04 10:23:08 +00:00
Chandler Carruth
5286042938 Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.
Rationale:
1) This was the name in the comment block. ;]
2) It matches Clang's __has_feature naming convention.
3) It matches other compiler-feature-test conventions.

Sorry for the noise. =]

I've also switch the comment block to use a \brief tag and not duplicate
the name.

llvm-svn: 168996
2012-11-30 11:45:22 +00:00
Benjamin Kramer
9647e19de7 Drop the limitation to IEEE floating point types from the fdiv of pow2 -> fmul transform.
This is safe for x87 long doubles and ppc double doubles too.

llvm-svn: 167582
2012-11-08 13:58:10 +00:00
Ulrich Weigand
c504e37126 Implement arithmetic on APFloat with PPCDoubleDouble semantics by
treating it as if it were an IEEE floating-point type with 106-bit
mantissa.

This makes compile-time arithmetic on "long double" for PowerPC
in clang (in particular parsing of floating point constants)
work, and fixes all "long double" related failures in the test
suite.

llvm-svn: 166951
2012-10-29 18:09:01 +00:00