9eb6b4d91b83448ec818089754c74bbdcf7dfd7a |
|
08-Oct-2011 |
Eli Friedman <eli.friedman@gmail.com> |
Fix APInt::operator*= so that it computes the correct result for large integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f34fa6f34e52ff86ec3caf601c1cb18e3f60da50 |
|
20-Sep-2011 |
Douglas Gregor <dgregor@apple.com> |
U is good enough git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f83f0f8246457bf7951bc95dd74ec67cf524b845 |
|
20-Sep-2011 |
Douglas Gregor <dgregor@apple.com> |
Eliminate sign-comparison warnings in APInt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
586a55a29089c6128f843cd331fed210c480ed0a |
|
19-Sep-2011 |
Benjamin Kramer <benny.kra@googlemail.com> |
Silence -Wsign-compare warnings from GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
dcd999624159842886d4be21efcc3ba0e61bab99 |
|
14-Sep-2011 |
Douglas Gregor <dgregor@apple.com> |
Add APInt support for converting to/from hexatridecimal strings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
3ba292dbc2acee2d1052fb7ffe332e2164147b47 |
|
18-Jul-2011 |
Jeffrey Yasskin <jyasskin@google.com> |
Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
cf886188fb04d9521db39fe5213df1295673f51e |
|
15-Jun-2011 |
Ted Kremenek <kremenek@apple.com> |
add option for literal formatting to APInt::toString() toString() now takes an optional bool argument that, depending on the radix, adds the appropriate prefix to the integer's string representation that makes it into a meaningful C literal, e.g.: hexademical: '-f' becomes '-0xf' octal: '77' becomes '077' binary: '110' becomes '0b110' Patch by nobled@dreamwidth.org! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
c4cb237ca61bc382de4f89c2464564eabbfb8d8e |
|
22-May-2011 |
Chris Lattner <sabre@nondot.org> |
fix a bug for hosts without round, PR8893. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
7a2bdde0a0eebcd2125055e0eacaca040f0b766c |
|
15-Apr-2011 |
Chris Lattner <sabre@nondot.org> |
Fix a ton of comment typos found by codespell. Patch by Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
6208610fd602ebdb18bb793152899573d0b2b7ab |
|
27-Mar-2011 |
Frits van Bommel <fvbommel@gmail.com> |
Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
d9103df51b858cf051a1650ac7eb33d416e9ac41 |
|
17-Mar-2011 |
Benjamin Kramer <benny.kra@googlemail.com> |
Add an argument to APInt's magic udiv calculation to specify the number of bits that are known zero in the divided number. This will come in handy soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
8d7285d0e5eb5937a6682e884b883516377e903d |
|
21-Feb-2011 |
Cameron Zwarich <zwarich@apple.com> |
The signed version of our "magic number" computation for the integer approximation of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
40f8f6264d5af2c38e797e0dc59827cd231e8ff7 |
|
07-Dec-2010 |
Jay Foad <jay.foad@gmail.com> |
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
fd6d53fbad9d3f48da4910ebba12d9d2a3c24bd8 |
|
04-Dec-2010 |
Benjamin Kramer <benny.kra@googlemail.com> |
APInt: microoptimize a few methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
7a874ddda037349184fbeb22838cc11a1a9bb78f |
|
01-Dec-2010 |
Jay Foad <jay.foad@gmail.com> |
PR5207: Rename overloaded APInt methods set(), clear(), flip() to setAllBits(), setBit(unsigned), etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a99793c5ea24dd3839f4925b89b1f6acfcb24604 |
|
30-Nov-2010 |
Jay Foad <jay.foad@gmail.com> |
PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
078d967e0a7e6dd78ac9eb28a1d50fd9319b88d1 |
|
18-Nov-2010 |
Dan Gohman <gohman@apple.com> |
Bounds-check APInt's operator[]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a5bbde8efd9710e5daecee69ff48722e637a35b7 |
|
14-Oct-2010 |
Chris Lattner <sabre@nondot.org> |
fix a bug I introduced, no idea how this didn't repro right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
eafc5cb80d58cb9447623a557be4d4f55f42fbc3 |
|
14-Oct-2010 |
Chris Lattner <sabre@nondot.org> |
add uadd_ov/usub_ov to apint, consolidate constant folding logic to use the new APInt methods. Among other things this implements rdar://8501501 - llvm.smul.with.overflow.i32 should constant fold which comes from "clang -ftrapv", originally brought to my attention from PR8221. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
0a0a585e6bfc112cb8346b17edecb76969fb5532 |
|
14-Oct-2010 |
Chris Lattner <sabre@nondot.org> |
constify these methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f2ddc64c8701e432cc220f26c48d596cc0f30a97 |
|
14-Oct-2010 |
Chris Lattner <sabre@nondot.org> |
add a few operations for signed operations that also return an overflow flag. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5083912dd79249a8954fd3e1e381a0cd7c624fbd |
|
18-Aug-2010 |
Chris Lattner <sabre@nondot.org> |
stomp some more undefined behavior, PR7775. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
38e59891ee4417a9be2f8146ce0ba3269e38ac21 |
|
15-Jul-2010 |
Benjamin Kramer <benny.kra@googlemail.com> |
Don't pass StringRef by reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4c297c9153899a41c541474187a3e3a8dbf8a794 |
|
15-May-2010 |
Chris Lattner <sabre@nondot.org> |
improve portability to systems that don't have round, patch by Evzen Muller! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
67eadb397a9baf56ff6c227ffefa7c3cff86ae4b |
|
27-Mar-2010 |
Chris Lattner <sabre@nondot.org> |
improve portability to minix, patch by Kees van Reeuwijk for PR6704 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
16e02097d283159c240996185a8b20f4ea46ccfc |
|
24-Mar-2010 |
Dan Gohman <gohman@apple.com> |
Fix minor style issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e12b73816b50bbe2cc54b8005d86c95413b4f465 |
|
28-Feb-2010 |
John McCall <rjmccall@apple.com> |
Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width payloads. APFloat's internal folding routines always make QNaNs now, instead of sometimes making QNaNs and sometimes SNaNs depending on the type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f451cb870efcf9e0302d25ed05f4cac6bb494e42 |
|
10-Feb-2010 |
Dan Gohman <gohman@apple.com> |
Fix "the the" and similar typos. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
281d051921be84e2f790dd567958cd200b28e2dd |
|
03-Feb-2010 |
John McCall <rjmccall@apple.com> |
Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits as undefined. Fixes an assertion in APFloat::toString noticed by Dale. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
465abed3880ee22981f7e9364159818079e46970 |
|
05-Jan-2010 |
David Greene <greened@obbligato.org> |
Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
d73bf5987a0855e677fcefba74334c6a85b0b326 |
|
24-Dec-2009 |
John McCall <rjmccall@apple.com> |
Set Remainder before Quotient in case Quotient and LHS alias. The new order should be immune to such problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a279bc3da55691784064cb47200a1c584408b8ab |
|
20-Sep-2009 |
Daniel Dunbar <daniel@zuster.org> |
Tabs -> spaces, and remove trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
b7c5bdf843419e4222770475c27932c4c8e5c303 |
|
06-Sep-2009 |
Duncan Sands <baldrick@free.fr> |
Remove some unused variables and methods warned about by icc (#177, partial). Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
91021d339004ff5a64c3c9614cff8966899c0c99 |
|
24-Aug-2009 |
Chris Lattner <sabre@nondot.org> |
remove the dead std::ostream APInt inserter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
56c39eb232bea1fbf8e5d8ffee36168f43285208 |
|
21-Aug-2009 |
Erick Tryzelaar <idadesub@users.sourceforge.net> |
Clean up the APInt function getDigit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e250f2a5ee2a794e531b159c270b63f5e70dfc27 |
|
21-Aug-2009 |
Eric Christopher <echristo@apple.com> |
Update error messages for '+'. Fix grammar and make the two negative checks resemble each other. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
d37eda8c1d152780914fd71eee7d36fff407e1a1 |
|
21-Aug-2009 |
Eric Christopher <echristo@apple.com> |
Fix trailing whitespace and 80-col violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ae8f78d4de403965603ed2b61898d820db2449f9 |
|
21-Aug-2009 |
Erick Tryzelaar <idadesub@users.sourceforge.net> |
Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
bb97531a5a13c9d5b2f04b3b714037b1eff7e9a9 |
|
21-Aug-2009 |
Erick Tryzelaar <idadesub@users.sourceforge.net> |
Allow '+' to appear in APInt strings, and add more unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
dddfd34e32ff081409e5a1c95b991a898d63dff2 |
|
19-Aug-2009 |
Daniel Dunbar <daniel@zuster.org> |
Switch to SmallString::str from SmallString::c_str, and remove SmallString::c_str. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
689ad6ef3fd2e89394f1e8860dfebfe56b73c3da |
|
13-Aug-2009 |
Daniel Dunbar <daniel@zuster.org> |
Convert APint::{fromString,APInt,getBitsNeeded} to use StringRef. - Patch by Erick Tryzelaar, with some edits (and a bug fix) from me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4e97a0f0cb1b1b266d2653e44eb31374f2685c2b |
|
12-Aug-2009 |
Dale Johannesen <dalej@apple.com> |
Add attempted idiotproofing comment per review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
39c177d8b7b03d5a851a3adf5ae816da1211c49e |
|
12-Aug-2009 |
Dale Johannesen <dalej@apple.com> |
Fix a nondeterministic bug in APInt::roundToDouble; when !isSingleWord() but getActiveBits() is small, we were using the pointer value instead of the low word of the integer value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
c23197a26f34f559ea9797de51e187087c039c42 |
|
14-Jul-2009 |
Torok Edwin <edwintorok@gmail.com> |
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable. This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a53902b2588adacee53c0145df840b0ad15ac0a3 |
|
13-Jul-2009 |
Daniel Dunbar <daniel@zuster.org> |
Switch to raw_ostream. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
c25e7581b9b8088910da31702d4ca21c4734c6d7 |
|
11-Jul-2009 |
Torok Edwin <edwintorok@gmail.com> |
assert(0) -> LLVM_UNREACHABLE. Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
38a253ddf786b83dba14d980d269f7bb5c2252ea |
|
30-Jun-2009 |
Dan Gohman <gohman@apple.com> |
Reapply 74494, this time removing the conflicting definition of operator<< in APIntTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
527b6e62926673eb66e03f1250904a74a77667ae |
|
30-Jun-2009 |
Bill Wendling <isanbard@gmail.com> |
Temporarily revert r74494. It was causing failures in the unit tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
670031666cf4dea0d122a0df2ec1d18822c225e4 |
|
30-Jun-2009 |
Dan Gohman <gohman@apple.com> |
Define an operator<< for APInt to be used with std::ostream. This will allow it to be used in unittests that use gtest's EXPECT_EQ. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
cf69a743b7d1babcb87eb73a630d057a89c0527a |
|
22-May-2009 |
Evan Cheng <evan.cheng@apple.com> |
80 column violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f3dc0c048a807d1de4b8738af92f5aaeb34786d4 |
|
14-May-2009 |
Mike Stump <mrs@apple.com> |
Fix whitespacing (space after switch). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4e5ea553d055512b0b8aa098e363ae17bafda957 |
|
30-Apr-2009 |
Jay Foad <jay.foad@gmail.com> |
Move helper functions for optimizing division by constant into the APInt class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
38300e91f5ff2d427d98f81fb25df8cc2800d985 |
|
25-Apr-2009 |
Chris Lattner <sabre@nondot.org> |
Fix PR4040: APInt's string constructor is too strict patch by Jeff Yasskin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
de551f91d8816632a76a065084caab9fab6aacff |
|
01-Apr-2009 |
Dan Gohman <gohman@apple.com> |
Use CHAR_BIT instead of hard-coding 8 in several places where it is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
bf5836b075a7fdd680e7c43134237bdef65643cf |
|
19-Mar-2009 |
Duncan Sands <baldrick@free.fr> |
Fix comment typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
d52ec65b6ded621578642f9275adbd49de7519e1 |
|
13-Mar-2009 |
Stuart Hastings <stuart@apple.com> |
Fix a hashing bug in APInt. A certain pathological testcase (too large for the testsuite) took over six minutes to compile on my Mac. The patched LLVM-GCC compiles that testcase in three seconds (GCC takes less than one second). This hash function is more complex (about 35 instructions on x86) than what Chris wanted, but I expect it will be well-behaved with arbitrary inputs. Thank you to everyone who responded to my previous request for advice. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
2d0f1c57c3f95e43a8b18bfe8481d90b665d5efe |
|
27-Jan-2009 |
Torok Edwin <edwintorok@gmail.com> |
APInt's countLeadingOnes() was broken for negative i128 values, causing assertion failures in getSExtValue(). Fix it by making highWordBits actually contain what its name says, and add some more unit-tests for APInt. This fixes PR3419. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
455e9abf362a20bcfde9170fbec86b79ca0c40d5 |
|
21-Jan-2009 |
Chris Lattner <sabre@nondot.org> |
Remove uses of uint32_t in favor of 'unsigned' for better compatibility with cygwin. Patch by Jay Foad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4bd47877859b19c7a12cd10eff03533b329740e1 |
|
19-Jan-2009 |
Nick Lewycky <nicholas@mxc.ca> |
Fix typo, sentence fragment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
119c30b95545c223b7111a4a03100470387f76fc |
|
12-Oct-2008 |
Chris Lattner <sabre@nondot.org> |
rearrange some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
944fac71e082cc2664cc71b4d3f6c72bab7143fb |
|
24-Aug-2008 |
Chris Lattner <sabre@nondot.org> |
Switch the asmprinter (.ll) and all the stuff it requires over to use raw_ostream instead of std::ostream. Among other goodness, this speeds up llvm-dis of kc++ with a release build from 0.85s to 0.49s (88% faster). Other interesting changes: 1) This makes Value::print be non-virtual. 2) AP[S]Int and ConstantRange can no longer print to ostream directly, use raw_ostream instead. 3) This fixes a bug in raw_os_ostream where it didn't flush itself when destroyed. 4) This adds a new SDNode::print method, instead of only allowing "dump". A lot of APIs have both std::ostream and raw_ostream versions, it would be useful to go through and systematically anihilate the std::ostream versions. This passes dejagnu, but there may be minor fallout, plz let me know if so and I'll fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
98f8ccfad06c8928d899f506731987f951b2ebe4 |
|
20-Aug-2008 |
Chris Lattner <sabre@nondot.org> |
Move the fast-path (<=i64) cases of various APInt methods inline and the slow-path cases out of line. This speeds up instcombine a bit in real world cases. Patch contributed by m-s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
eace52f12db8feff2742ad1e2a330c837ff7f824 |
|
20-Aug-2008 |
Dan Gohman <gohman@apple.com> |
It's not necessary to check if a value is null before delete[]. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
fad86b003a839cef40ec8ce8408322f4913368ca |
|
17-Aug-2008 |
Chris Lattner <sabre@nondot.org> |
Rework the routines that convert AP[S]Int into a string. Now, instead of returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9f17eb0b79717d479e462f0284442adbeae903ef |
|
17-Aug-2008 |
Chris Lattner <sabre@nondot.org> |
remove a dead APInt ctor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
de0f2382e4aa99c921216574ce97f09c3d145d0f |
|
20-Jul-2008 |
Wojciech Matyjewicz <wmatyjewicz@fastmail.fm> |
Fix PR2088. Use modulo linear equation solver to compute loop iteration count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
300c6c5167d2869d1568d783d0e3e48bf4b03a6c |
|
23-Jun-2008 |
Wojciech Matyjewicz <wmatyjewicz@fastmail.fm> |
First step to fix PR2088. Implement routine to compute the multiplicative inverse of a given number. Modify udivrem to allow input and output pairs of arguments to overlap. Patch is based on the work by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
95df6b3603e228cea714be21997fec82cb03011e |
|
22-Jun-2008 |
Dan Gohman <gohman@apple.com> |
Avoid creating a redundant zero APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
bfde7d6b9ea58a59edf61a5f93b2a86e5a9dae37 |
|
05-Jun-2008 |
Zhou Sheng <zhousheng00@gmail.com> |
As comments said, for negative value, the arithmetic over-shift-right should return -1. So here it should be signed-extended, when bitwidth larger than 64. test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
48e8c80e1791adb7a07b8fd6e27edcdfbb756950 |
|
02-May-2008 |
Evan Cheng <evan.cheng@apple.com> |
Suppress -Wshorten-64-to-32 warnings for 64-bit hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
3bd659ba20c235caabb0df6f93888d898197afb0 |
|
10-Apr-2008 |
Dan Gohman <gohman@apple.com> |
Make several symbols static. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
cfbb2f074da2842e42956d3b4c21e91b37f36f06 |
|
25-Mar-2008 |
Dan Gohman <gohman@apple.com> |
A quick nm audit turned up several fixed tables and objects that were marked read-write. Use const so that they can be allocated in a read-only segment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f7a91e68a8566c265ed6f4ab827d53a5c0c690ee |
|
16-Mar-2008 |
Bill Wendling <isanbard@gmail.com> |
Add assert for non-hexadecimal radixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a8de38f3516c0f9587c27d782b85f78cbbe281e8 |
|
07-Mar-2008 |
Evan Cheng <evan.cheng@apple.com> |
Fix a typo. It's causing consumer-typeset to miscompile. Perhaps more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
cf609575ef6e47cd5ce775af175c67a3b621120e |
|
29-Feb-2008 |
Dan Gohman <gohman@apple.com> |
Add support to APInt for shift and rotate operations with APInt instead of uint32_t for the shift/rotate count operand type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a795aca96aca81ddeb4cd9628138926dd9fa612c |
|
19-Feb-2008 |
Ted Kremenek <kremenek@apple.com> |
Fixed bug in APInt::Profile() where the BitWidth field was not included in the profile of the APSInt object. This caused unexpected Profile collisions where none should have occurred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5a0e7b41c1b6cb2d9b4d877996c09f0ad7235572 |
|
14-Feb-2008 |
Dan Gohman <gohman@apple.com> |
Fix a warning about comparison between signed and unsigned, being consistent with the rest of the APInt implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
42dd77f20702d5ca1e0f3882ad74e7a02fc9589c |
|
13-Feb-2008 |
Dan Gohman <gohman@apple.com> |
Add countTrailingOnes member functions to APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e420debd26300cbeb6af2722e3342132b2be1b3c |
|
19-Jan-2008 |
Ted Kremenek <kremenek@apple.com> |
Added FoldingSet style 'profiling' support for APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4ee451de366474b9c228b4e5fa573795a715216d |
|
29-Dec-2007 |
Chris Lattner <sabre@nondot.org> |
Remove attribution from file headers, per discussion on llvmdev. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
97d37260df83eaac0f8876087ad2c53f07d6efc9 |
|
24-Dec-2007 |
Anton Korobeynikov <asl@math.spbu.ru> |
Cygwin defines uint32_t as unsigned long. Unbreak call to std::min in this case git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9af1887537cf7064c8d842bde739fbd1fec4d166 |
|
11-Dec-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Don't have APInt.cpp depend upon DerivedTypes.h. This helps with splitting the Support libraries separately into their own module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9e513acd3145036bd06b5e0f5bcc83a3e5c08854 |
|
23-Nov-2007 |
Chris Lattner <sabre@nondot.org> |
Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5e557123ad3779e540fc795e083bad6be5a1c764 |
|
23-Nov-2007 |
Chris Lattner <sabre@nondot.org> |
Fix APInt::countTrailingZeros to return BitWidth if the input is zero instead of returning some random large number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
1e8390d8d6219a2f0a9b8c5592ee0c33c256d03d |
|
12-Oct-2007 |
Neil Booth <neil@daikokuya.co.uk> |
Don't attempt to mask no bits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
68e53ad6cb0a9d64d256f9dcef70331cd72d795e |
|
08-Oct-2007 |
Neil Booth <neil@daikokuya.co.uk> |
Add a new function tcExtract for extracting a bignum from an arbitrary range of bits embedded in the middle of another bignum. This kind of operation is desirable in many cases of software floating point, e.g. converting bignum integers to floating point numbers of fixed precision (you want to extract the precision most significant bits). Elsewhere, add an assertion, and exit the shift functions early if the shift count is zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
055c0b3a8f640a939bc6ff33338714fc05e79802 |
|
06-Oct-2007 |
Neil Booth <neil@daikokuya.co.uk> |
Fix and clarify some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
978661d05301a9bcd1222c048affef679da5ac43 |
|
06-Oct-2007 |
Neil Booth <neil@daikokuya.co.uk> |
Generalize tcFullMultiply so that the operands can be of differing part widths. Also, return the number of parts actually required to hold the result's value. Remove an over-cautious condition from rounding of float->hex conversion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
910993e8dc49a25d9da3b53de4a82568c14e91cc |
|
22-Sep-2007 |
Dale Johannesen <dalej@apple.com> |
Change APFloat::convertFromInteger to take the incoming bit width instead of number of words allocated, which makes it actually work for int->APF conversions. Adjust callers. Add const to one of the APInt constructors to prevent surprising match when called with const argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
8feb1f4467425d23ed74cce61e49f18a51a63421 |
|
18-Sep-2007 |
Devang Patel <dpatel@apple.com> |
Do not hide APInt::dump() inside #ifndef NDEBUG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9e3d3abd937c9bb79d56d25ec0e0724c7cbba67c |
|
15-Sep-2007 |
Dale Johannesen <dalej@apple.com> |
Remove the assumption that FP's are either float or double from some of the many places in the optimizers it appears, and do something reasonable with x86 long double. Make APInt::dump() public, remove newline, use it to dump ConstantSDNode's. Allow APFloats in FoldingSet. Expand X86 backend handling of long doubles (conversions to/from int, mostly). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9132a2b81842b0e2b77703fab3e6fe7467f859bb |
|
23-Aug-2007 |
Chris Lattner <sabre@nondot.org> |
rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned() Add an APSInt::toString() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
b39cdde41d3c91d1fd48a038e63b78122607bb10 |
|
21-Aug-2007 |
Chris Lattner <sabre@nondot.org> |
initial checkin of Neil's APFloat work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
fe8e14a6c99261cfe9238c35761083cb4c99cc6a |
|
16-Aug-2007 |
Chris Lattner <sabre@nondot.org> |
This adds a bunch of static functions that implement unsigned two's complement bignum arithmetic. They could be used to implement much of APInt, but the idea is they are enough to implement APFloat as well, which the current APInt interface is not suited for. Patch by Neil Booth! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
20a4c23bcc958cbc3ce9775b440d205ac0944db8 |
|
19-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix an assertion introduced by my last change to the toString method. We can't use getZExtValue() to extract the low order bits for each digit. Instead, we need to access the low order word directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
fb0709a180e55325f8b13754df4c9d9671b7b285 |
|
17-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Get rid of leading zeros in the output of toString. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
02ae8b78ff311144bc915a96889db66f46eca208 |
|
17-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
For lshr by 0 bits, just return *this as a short cut. This also prevents undefined behavior when the width > 64 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
6551dcdd8a6a28e060a9d6562a381220597dcae3 |
|
16-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix a bug in the "fromString" method where radix 2,8 and 16 values were not being generated correctly because the shl operator does not mutate its object but returns a new value. Also, make the distinction between radix 16 and the others more clear. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
69944e85aa63d5a067692f6e680b6939fe7d4131 |
|
14-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make the results for the rotate functions correct when rotateAmt == 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
19dc32a2d422ac0aafd047514e3e5e727796696e |
|
14-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Add some things needed by the llvm-gcc version supporting bit accurate integer types: 1. Functions to compute div/rem at the same time. 2. Further assurance that an APInt with 0 bitwidth cannot be constructed. 3. Left and right rotate operations. 4. An exactLogBase2 function which requires an exact power of two or it returns -1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
92c728350011c7d7df29d42166ad3436f1285249 |
|
12-May-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix shl to produce the correct result when the bitwidth is > 64 and the shift amount is 0. Previously this code would do a lshr by the bit width which can lead to incorrect results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a5ae15ecb7f3447377121df5cf6598da9545c0c4 |
|
03-May-2007 |
Chris Lattner <sabre@nondot.org> |
silence some annoying gcc 4.3 warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
0468ab302537912264f61066fe8b780e52c7f5ef |
|
14-Apr-2007 |
Reid Spencer <rspencer@reidspencer.com> |
We want the number of bits needed, not the power of 2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35977 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
57ae4f5f01b6f8edf678d77ab935f3662993065d |
|
13-Apr-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
2cd43e402a7805a9a7b45defa4f2ed1cb7e17d68 |
|
11-Apr-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix an approximate calculation in an assertion not to give false negatives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
6dbe233959eed02971f3075e0c48234238ff6fa3 |
|
21-Mar-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
Fix a bug in getAllOnesValue() which broke some test cases for bitwidth > 64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35232 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
09dfd8e19dc4bb0e53966a0531880d42182a1f9f |
|
20-Mar-2007 |
Jeff Cohen <jeffc@jolt-lang.org> |
Fix (and simplify) 48-bit byte swap. Get pos/neg infinity the correct way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
adf2a206ecc11cc6427cc0aa19d366089c8b747f |
|
19-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix coding standards violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
3a341375487e4a296821edbcebafd289d55d119b |
|
19-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Implement extension of sign bits for negative values in the uint64_t constructor. This helps to fix test/Assembler/2007-03-19-NegValue.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4fd8606791e0ff67a9dd13a21d95cda7e114c0e0 |
|
12-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Revert the last patch as it violates the conditions of sext/zext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
7d820f57e27fc00fafe58cd257ac62e38d68fee5 |
|
12-Mar-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
For APInt::z/sext(width), if width == BitWidth, just return *this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ca5183d445954a9b2a570d6bbba1bc2b00ad6442 |
|
05-Mar-2007 |
Jeff Cohen <jeffc@jolt-lang.org> |
Unbreak VC++ build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
46f9c94bdd8344dd41ede35294bb9b6dd390c30a |
|
02-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix ashr for bitwidths > 64. This is now validated up to 1024 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f09aef7698bbae79a67287a353c63c1ca31055b0 |
|
02-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Use a better algorithm for rounding sqrt results. Change the FIXME about this to a NOTE: because pari/gp results start to get rounded incorrectly after 192 bits of precision. APInt and pari/gp never differ by more than 1, but APInt is more accurate because it does not lose precision after 192 bits as does pari/gp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9bf94a4a9f1087dd1d418af59e8f76e9a85f655e |
|
02-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Add a FIXME git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
36184ed4cd8dc0dc302b8f51f169c334b7460168 |
|
02-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix a problem where shifting by 64-bits leads to incorrect results on PPC but not on X86 becuase shift by word size is "undefined". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34825 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
295e40aa5ca771c2841d30332d7b4266fb306d6f |
|
02-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Combine two lines that can be. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34818 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
4e1e87f09ce284ef9e981d86a72fde2f99c70c10 |
|
01-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make the static table of results in sqrt const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
68e2300ad965bf08af11ae363bb85e3badf964dc |
|
01-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Add methods for bit width modification: sextOrTrunc, zextOrTrunc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
b5ca2cd5095b61c17f89edc10bf2fc63a7e22824 |
|
01-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Use a real table in sqrt to shorten and quicken the code. Thanks for the idea Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
af8fb1984674db462bc6923ed54db0275c78b711 |
|
01-Mar-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Add a square root function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
94900774ad65d69274d564bac027d56a5801c7e2 |
|
28-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make the trunc/sext/zext methods return APInt& so that these operations can be chained together with other operations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ff6057664636d5ce5e996bdebac1a8e6b3058504 |
|
28-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits instead of honoring the client's requested bit width. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34712 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f5c0fd9e166b850461683e0914d1ff15829d6b67 |
|
28-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Join two lines that can be joined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
681dcd14e9d59c2070e3a298328db9aea6069480 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize the bit width of negative numbers by computing the minimum bit width for a negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
66ed1099ff3591c61e008198bb5a30862e778fc0 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Improve APInt interface: 1. Add unsigned and signed versions of methods so a "bool" argument doesn't need to be passed in. 2. Make the various getMin/getMax functions all be inline since they are so simple. 3. Simplify sdiv and srem code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
96d91372fd79257bb043f6a01b7e871acbe5a555 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Conform to single person attribution in file comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
1fa111e8d40ce99a9b960ec98c6c84d2ebdc8b02 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix three serious bugs in the comparison code. 2. Change RoundDoubleToAPInt to take a bit width parameter. Use that parameter to limit the bit width of the result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
b4d8ae5dfb2936b1da498e65a7f23af2f9dfccd0 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Get rid of extraneous // in file comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
30f44f3287e13213b439b8924df037190c9cc363 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Simplify and document RoundDoubleToAPInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9ac44113a808c5c7e6c311f1d58fd698b6ffca38 |
|
27-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Make sure all delete operators of arrays use the array form of delete. 2. Rewrite operator=(const APInt& RHS) to allow the RHS to be a different bit width than the LHS. This makes it possible to use APInt as the key of a DenseMap, as needed for the IntConstants map in Constants.cpp 3. Fix operator=(uint64_t) to clear unused bits in case the client assigns a value that has more bits than the APInt allows. 4. Assert that bit widths are equal in operator== 5. Revise getHashValue() to put the bit width in the low order six bits. This should help to make i1 0, i2 0, ... i64 0 all distinct in the IntConstants DenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
794f4725b88060fc2e05449af3cd6a572ea46412 |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Implement the getHashValue method. Fix toString use of getValue to use getZExtValue() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9d1ae8fabeb2c21f24b7bd017d7bec4f51943ed6 |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Re-enable this. The header was committed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ab143beb93c68d85d155551ed3bcb47b0cd94982 |
|
26-Feb-2007 |
Chris Lattner <sabre@nondot.org> |
another missing header :( :( :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
47fbe9e00cebf2c18e9d967f308de142db4afc67 |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Remove redundant calls to clearUsedBits(). 2. Fix countTrailingZeros to use a faster algorithm. 3. Simplify sext() slightly by using isNegative(). 4. Implement ashr using word-at-a-time logic instead of bit-at-a-time 5. Rename locals named isNegative so they don't clash with method name. 6. Fix fromString to compute negated value correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ba81c2b87163d2dbc3c26d5bf12850d841173b64 |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Rewrite lshr to not do bit by bit copy but to copy and shift whole words. This makes it much more efficient. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f30b1885aec1e53edf815bf6c58d93b754e52996 |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix sext operation. Shifting by zero would leave an incorrect mask. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34617 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9eec2413479becc7ccda188b083e43208748923b |
|
26-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix the flip() method to correctly flip all words of the APInt. 2. Implement the trunc, sext, and zext operations. 3. Improve fromString to accept negative values as input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5d0d05c9b8b5faa470b36fc4f8699aa7de4275b4 |
|
25-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Provide more detail in file comment. 2. Move comments for methods to .h file, delete them in .cpp file. 3. All places that were doing manual clear of high order bits now call the clearUnusedBits() method in order to not depend on undefined behavior of the >> operator when the number of bits shifted equals the word size. 4. Reduced # of loc by using the new result of clearUnusedBits() method. 5. Simplified logic (decreased indentation) in a few places. 6. Added code comments to larger functions that needed them. 7. Added FIXME notes about weak implementations of things (e.g. bit-by-bit shift right is sub-optimal). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
31d16b039adbb65d36722d8efd29a6c329d4b20a |
|
25-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Allow this to compile now that the header file is checked in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
0f07e55312d4b2be83061b27e8f5cc6bed606a16 |
|
25-Feb-2007 |
Chris Lattner <sabre@nondot.org> |
this doesn't compile, disable it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
24c4a8f54828f611aac79063fd2c8bfd71d80487 |
|
25-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Clean up lshr and ashr to coding standards. Handle the single word cases for shiftAmt == BitWidth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
438d71eea40b4c69668be891a5d9c5e72c5d8af3 |
|
25-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Whoops, last word with bits in large shift left wasn't correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
8755380fffb185e9959182510dc14e79c8b4a4b8 |
|
25-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix the > 64 bits case for left shift. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
1050ec5cc42c4b1ff1702e09da9d520abe205b0d |
|
24-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix the remainder shifting in KnuthDiv. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5bce8547f3ebad55611bfc74f1be0437287fa319 |
|
24-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix a bug in fromString for the <= 64bits case 2. Fix shl when shiftAmount == BitWidth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34560 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
610fad85d2dcc1b65227f67ae3c86db1d921a4d0 |
|
24-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix last bug in KnuthDiv. All divide tests pass up to 1024 bits now. 2. Clean up comments, style, coding standards, etc. 3. Simplify a constructor. Extended testing revealed some additional bugs in shifting. I'll fix these tomorrow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9d6c919efe4312cf79343ed1d676d0efa087e112 |
|
24-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Make internal functions take const arguments where they should, just to be safe. 2. Make internal functions that return a carry/borrow return bool instead of uint64_t because the carry/borrow can only be in range [0,1]. 3. Assert that the pointers to KnuthDiv are all different so that the result and operands can't overlap. 4. Add debug output to KnuthDiv function. 5. Fix a problem with KnuthDiv by separating the b's complement operation from the subtraction borrow operation. This fixes a wide range of division problems, but alas, not all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
929046376009211fb7794762cfc87ac34a1b4035 |
|
23-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix a carry out problem in add if destination and x point to the same memory (as done in fromString). 2. Implement Knuth divide more closely to what is recommended in his book. 3. Fix computation of the remainder for Knuth Divide (bad shifting). 4. Remove some cruft from the file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
15aab8a723f9a316fe387af22a21b2a3abbaa066 |
|
22-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
When converting from 64 to 32-bits, use the actual number of words to extract the value, not the number of words implied by the active bits. This fixes numerous, but not all divide bugs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34484 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ab2b2c827c4a60e558efaea3bfeb1ebd13b5985b |
|
22-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix countLeadingZeros in the case that the bitwidth evenly divides the word size. This fixes all reads of uninitialized data (buffer over read) and makes APInt.cpp memory clean, per valgrind. The only remaining problem is division in a few cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e0cdd3349df98cb886d9b24351f9116a9a11c5f8 |
|
21-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Reorganize some code to make it clearer, avoid a few uninitialized memory reads, and reduce the number of temporary APInt instances we construct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
60c0a6a74baf6750d87ab69f00c96f120cefa776 |
|
21-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix the carry in addition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
385f7547b9755997b8bd918c2a4e2fc39d7d0207 |
|
21-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Add a dump() method for faster debugging. 2. Change 0 initialization of union to larger component so all is zeroed. 3. Fix the borrow logic in subtraction so it works for > 128 bits. 4. Rewrite fromString to use a simpler but correct algorithm and also to not set the bit width contrary to the user's request. 5. Optimize toString a bit by making it only do one Knuth divide per iteration instead of two. With these changes, all arithmetic passes (verified by pari/GP) up to 1024 bits except for certain division cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e549c4940c414521ea4872f0da2ebcfe510f5317 |
|
21-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix countLeadingZeros to actually return the correct number. Fix toString to correctly return "0" for zero valued APInts over 128 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34459 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
54362ca09512419734b5edc7e42e1fb90457377e |
|
21-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make long addition and subtraction work. Speed things up by using internal functions more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34458 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
61eb180a53320c113fee615bb9d459624e2817f7 |
|
20-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Clean up variable names in operator*. Attempt #3 for getting a portable INFINITY value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
580546a82bdf65148d19e68296ae51cea5ad9ef2 |
|
20-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Use INFINITY macro from math.h instead of constructing hex floating point constants (avoids warnings). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
9c0696f153c86a437b87f44102625ddc6a687b71 |
|
20-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
First version that can process arith.cpp test case up to 1024 bits: 1. Ensure pVal is set to 0 in each constructor. 2. Fix roundToDouble to make correct calculations and not read beyond the end of allocated memory. 3. Implement Knuth's "classical algorithm" for division from scratch and eliminate buffer overflows and uninitialized mememory reads. Document it properly too. 4. Implement a wrapper function for KnuthDiv which handles the 64-bit to 32-bit conversion and back. It also implement short division for the n == 1 case that Knuth's algorithm can't handle. 5. Simplify the logic of udiv and urem a little, make them exit early, and have them use the "divide" wrapper function to perform the division or remainder operation. 6. Move the toString function to the end of the file, closer to where the division functions are located. Note: division is still broken for some > 64 bit values, but at least it doesn't crash any more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f99a0ac0dcdce617df7af21596ceb8dc76b5839c |
|
18-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Fix some indentation and variable names in the get{Min,Max}Value methods. 2. Implement toString for power-of-2 radix without using divide and always printing full words. This allows hex/binary to look at the bit respresentation of the APInt as well as avoid bugs in divide. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a58f05847cb663e962c30d842bf6cbbed446459b |
|
18-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Use APINT_WORD_SIZE instead of sizeof(uint64_t) 2. Teach slt about signedness. 3. Teach roundToDouble to properly sign extend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34391 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
af0e956cefa4a7ed0c252f26a311a62cb961bb62 |
|
18-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
1. Remove dead code (lshift function). 2. Consolidate memory allocation into just two inline functions. 3. Convert "unsigned" to uint32_t to gaurantee its size. 4. Eliminate magic constants and replace with symbolic equivalent. 5. Improve code documentation slightly. 6. Simplify the logical operator code because bitwidths must be the same. 7. Fix indentation per coding standards. 8. Use exit-early style to reduce indentation in several functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
f2c521c58d3652e187d677d048eeb3c6e7e98520 |
|
18-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make add_1 exit early if carry is 0. Fix line breaks and 80 cols violation. Simplify operator^= since bitwidths must be the same. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
443b570149f5756b298de6b63d13bbbf66b4f6fc |
|
18-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Implement signed output for toString. Fix bugs in countLeadingZeros and countTrailingZeros. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
c72f28042b11a329db721b816fdee957f6aac9d4 |
|
17-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix some bugs in division logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
5e0a851ed371c6b26dd56f88393c8b4bba065742 |
|
17-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Move static functions closer to their usage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
71bd08f9beea84c01676c4e9d7689857c72dad4c |
|
17-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Clean up the divide and remainder logic a bit (exit early). Use more meaningful variable names. Add comments to document the flow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
cd6f2bfc268add3dd54cbdf98b2a2c4862fe4ba5 |
|
17-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Fix bugs introduced by constructor parameter order change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
e81d2dad2c54014d36c73573307db5852c5caf8e |
|
16-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Review changes: 1. Function style changes. 2. 80-col violations. 3. Better names for things. 4. Arrange constructors so they all take bit width first. 5. Add named signed and unsigned comparison functions and remove the corresponding operators. 6. Remove operator&& and operator|| but provide a getBoolValue function which converts to bool as comparison against 0. This allows the normal && and || operators to be used as if (X.getBoolValue() && Y.getBoolValue()) Note: this still doesn't function 100% yet. I'm working on the bugs now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
b04973edfaffb12905f58379d632f0d7e4bb5d9b |
|
15-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
Fix some buges: 1. Make getMinValue() returns the right value. 2. Fix the ByteSwap() crash problem. 3. Make Postfix increment work correctly. 4. Fix some bugs in LogBase2, Hi/LoBits and UDiv. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
879dfe1c9c563d05bc210bde6ac948f6b2980206 |
|
14-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Use brute-force algorithm for to_string. It doesn't have to be efficient at this point, it just needs to work so we can test things reliably. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
db3faa64ee89d537ca1b1410dd841ef51e957540 |
|
13-Feb-2007 |
Reid Spencer <rspencer@reidspencer.com> |
Make some minor improvements to APInt: 1. Make all the operators use uppercase 2. Rename APIntRoundToDouble method just RoundToDouble, the APInt is redundant. 3. Turn the class on for compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
d93f00c35dbd1ea415bb2b39435253aef9428d71 |
|
12-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
1. Make APInt::shl work correctly and more efficiently. 2. Add functions to support the numberical conversion between APInt and double/float. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
ff4304f8243f55e2e5c63bc95517cd38ff9295e1 |
|
09-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
Eliminates friend function declaration inside APInt, instead, adds public methods as those global function's internal implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a05eaa658eeb5cd57219ea87e0c2e775dc5105ca |
|
08-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
Switched this file on accidently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
0b706b18bd0a7760d971727460a1f26bff8289b0 |
|
08-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
As Chris and Reid suggested, remove "isSigned" field from APInt, instead, add some signed/unsigned arithmetic operation functions into APInt.h to handle the signed/unsigned issue. These functions will be defined inside a namespace "APIntOps" which is inside llvm namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
a3832fd46af09872a9c6322b9d23df8b4934c897 |
|
07-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
As Chris suggested, fixed some problems. (This is the first part) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
353815dc19fccd638e40120ed4ede0c1bae364f0 |
|
06-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
As Reid suggested, fixed some problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
6ad4c148cf073113d6048eb837eb222f2438af1d |
|
06-Feb-2007 |
Chris Lattner <sabre@nondot.org> |
Disable this for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|
fd43dcfc57076da0661cf94ea59f69aa22dd096c |
|
06-Feb-2007 |
Zhou Sheng <zhousheng00@gmail.com> |
Add a class APInt to represent arbitrary precision constant integral values. It is a functional replacement for common case integer type like "unsigned", "uint64_t", but also allows non-byte-width integer type and large integer value types such as 3-bits, 15-bits, or more than 64-bits of precision. For more details, see pr1043. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Support/APInt.cpp
|