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

116 Commits

Author SHA1 Message Date
Misha Brukman
380e3db1b4 Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars

llvm-svn: 65181
2009-02-20 22:20:18 +00:00
Bill Wendling
a03453cace These function return 'void'. Don't have 'return' return anything.
llvm-svn: 64136
2009-02-09 12:31:26 +00:00
Chris Lattner
816e00f6a0 eliminate use of uint32_t to improve compatibility with cygwin
llvm-svn: 62591
2009-01-20 18:23:14 +00:00
Misha Brukman
da77da48f3 Removed trailing whitespace.
llvm-svn: 62000
2009-01-09 19:25:42 +00:00
Chris Lattner
a249224590 Fix isIntN to work with APInts > 64 bits. This method is only
used by clang apparently.

llvm-svn: 60446
2008-12-02 23:33:29 +00:00
Eli Friedman
401743c904 Fix bogus assertion using getSExtValue for legitimate values, like -1 in
an 128-bit-wide integer.  No testcase; the issue I ran into depends on 
local changes.

llvm-svn: 60311
2008-12-01 00:43:48 +00:00
Chris Lattner
fc98ac247e random cleanup
llvm-svn: 57383
2008-10-11 22:06:50 +00:00
Chris Lattner
fe3155fc62 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.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Chris Lattner
bb8a53802b remove redundant include
llvm-svn: 55116
2008-08-21 06:41:07 +00:00
Chris Lattner
16121a7f73 Fix the build with gcc 4.3 as the host, patch by Zhongxing Xu!
llvm-svn: 55115
2008-08-21 06:25:28 +00:00
Nick Lewycky
d9012655db Fix build on GCC 4.3.
llvm-svn: 55110
2008-08-21 05:36:03 +00:00
Chris Lattner
c9fdd97035 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.

llvm-svn: 55063
2008-08-20 17:02:31 +00:00
Chris Lattner
c0610874cc 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.

llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner
4e4a482a41 remove a dead APInt ctor.
llvm-svn: 54869
2008-08-17 04:58:58 +00:00
Duncan Sands
e667a05fcb Correct a comment.
llvm-svn: 53401
2008-07-10 11:21:59 +00:00
Wojciech Matyjewicz
1de28ac425 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.

llvm-svn: 52638
2008-06-23 19:39:50 +00:00
Duncan Sands
a487df7710 Remove some DAG combiner assumptions about sizes
of integer types.  Fix the isMask APInt method to
actually work (hopefully) rather than crashing
because it adds apints of different bitwidths.
It looks like isShiftedMask is also broken, but
I'm leaving that one to the APInt people (it is
not used anywhere).

llvm-svn: 52142
2008-06-09 11:32:28 +00:00
Dan Gohman
edc136d18f Fix an error in the comment for APInt::getMinSignedBits.
llvm-svn: 51720
2008-05-30 00:46:49 +00:00
Evan Cheng
c2d34f03bf Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.
llvm-svn: 50590
2008-05-02 21:15:08 +00:00
Dan Gohman
2b8022a8c6 Add support to APInt for shift and rotate operations with APInt
instead of uint32_t for the shift/rotate count operand type.

llvm-svn: 47741
2008-02-29 01:40:47 +00:00
Bill Wendling
ebb707d162 Detabify
llvm-svn: 47597
2008-02-26 10:49:39 +00:00
Dan Gohman
62071ec646 Remove inline keywords from in-class function definitions, for
consistency.

llvm-svn: 47393
2008-02-20 19:29:58 +00:00
Dan Gohman
00fed8a97e Add an intersects method to APInt, to capture a common idiom.
llvm-svn: 47379
2008-02-20 16:08:11 +00:00
Dan Gohman
5562e340b7 Fix a typo in a comment.
llvm-svn: 47097
2008-02-13 22:32:12 +00:00
Dan Gohman
588498082a Rename APInt's isPositive to isNonNegative, to reflect what it
actually does.

llvm-svn: 47090
2008-02-13 22:09:18 +00:00
Dan Gohman
d22101a970 Add countTrailingOnes member functions to APInt.
llvm-svn: 47086
2008-02-13 21:11:05 +00:00
Dan Gohman
547ea0a60d Fix a typo in a comment.
llvm-svn: 47085
2008-02-13 20:56:53 +00:00
Dan Gohman
f65b0b112c Change APInt::getBitsSet to accept a "half-open" range, where the
hiBit parameter marks the index one past the last desired set bit.

llvm-svn: 47032
2008-02-12 21:47:33 +00:00
Dan Gohman
b7bbe43ad3 Correct the order of the arguments in the examples in the comments
for APInt::getBitsSet. And fix an off-by-one bug in "wrapping" mode.

llvm-svn: 46978
2008-02-11 23:45:14 +00:00
Dan Gohman
3d296e049c Add an isSignedIntN, like isIntN but for signed integer values instead of
unsigned.

llvm-svn: 46894
2008-02-08 21:58:15 +00:00
Ted Kremenek
99c2b963e8 Changed argument name for 'Profile' method to potentially fix a name conflict
reported in pr1929 (http://llvm.org/PR1929).

llvm-svn: 46193
2008-01-19 17:21:43 +00:00
Ted Kremenek
702d3b8f37 Added FoldingSet style 'profiling' support for APInt.
llvm-svn: 46188
2008-01-19 04:23:33 +00:00
Chris Lattner
e0b1ee937a Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Chris Lattner
d62e99bd4a eliminate dependency on Bitcode headers.
llvm-svn: 44709
2007-12-08 19:01:44 +00:00
Chris Lattner
36854c740d Fix PR1816, by correcting the broken definition of APInt::countTrailingZeros.
llvm-svn: 44296
2007-11-23 22:42:31 +00:00
Ted Kremenek
7c8260f21b Fixed default ctor for APInt to properly initialize BitWidth to a
non-random value.

llvm-svn: 43795
2007-11-07 00:27:59 +00:00
Ted Kremenek
3f3b4818ef Added serialization support for APInt.
llvm-svn: 43405
2007-10-26 21:50:10 +00:00
Ted Kremenek
0347caa918 Fixed incorrect "path name" in preamble (comment) of header file.
llvm-svn: 43401
2007-10-26 20:42:45 +00:00
Neil Booth
f003f9bf1a 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.

llvm-svn: 42745
2007-10-08 13:47:12 +00:00
Neil Booth
2c4419d71b 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.

llvm-svn: 42669
2007-10-06 00:24:48 +00:00
Dale Johannesen
c7279629cc 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.

llvm-svn: 42210
2007-09-21 22:09:37 +00:00
Devang Patel
547d418b8e Do not hide APInt::dump() inside #ifndef NDEBUG.
llvm-svn: 42068
2007-09-17 22:24:00 +00:00
Dale Johannesen
575bd6070a 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).

llvm-svn: 41967
2007-09-14 22:26:36 +00:00
Chris Lattner
d49a347b87 getMinSignedBits needs to take into consider the sign bit when the value is positive.
llvm-svn: 41566
2007-08-29 16:21:18 +00:00
Chris Lattner
742b745b0c rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()
Add an APSInt::toString() method.

llvm-svn: 41309
2007-08-23 05:15:32 +00:00
Chris Lattner
401698e8b5 initial checkin of Neil's APFloat work.
llvm-svn: 41203
2007-08-20 22:49:32 +00:00
Chris Lattner
4c6c787315 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!

llvm-svn: 41124
2007-08-16 15:56:55 +00:00
Reid Spencer
2a23af68c8 Document a missing parameter.
llvm-svn: 40852
2007-08-05 19:36:39 +00:00
Reid Spencer
a17d02ad08 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.

llvm-svn: 37025
2007-05-13 23:44:59 +00:00
Chris Lattner
d710ec51bf remove useless type qualifiers
llvm-svn: 36676
2007-05-03 17:09:36 +00:00