summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APFloat.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* proper #include order.Chris Lattner2007-12-081-1/+1
| | | | llvm-svn: 44707
* Prior commit updated wrong if, apologies.Neil Booth2007-12-051-2/+2
| | | | llvm-svn: 44614
* Handle zero correctly.Neil Booth2007-12-051-3/+3
| | | | llvm-svn: 44613
* Handle 0 correctly in string->APFloat conversion.Dale Johannesen2007-12-051-1/+1
| | | | llvm-svn: 44594
* Fix denormal check in float->APInt conversion.Dale Johannesen2007-11-171-1/+1
| | | | | | PR 1804. llvm-svn: 44201
* Remove some unnecessary C-style statics.Neil Booth2007-11-021-6/+8
| | | | | | Restore an assertion that arithmetic can be performed on this format. llvm-svn: 43638
* Add back line whose removal somehow crept into prior patchNeil Booth2007-11-011-0/+1
| | | | llvm-svn: 43627
* When converting to integer, do bit manipulations in the destinationNeil Booth2007-11-011-71/+107
| | | | | | | | | | | memory rather than in a copy of the APFloat. This avoids problems when the destination is wider than our significand and is cleaner. Also provide deterministic values in all cases where conversion fails, namely zero for NaNs and the minimal or maximal value respectively for underflow or overflow. llvm-svn: 43626
* Clarified operator precedence.Hartmut Kaiser2007-10-251-2/+2
| | | | | | Silenced VC++ warning. llvm-svn: 43372
* Fast-track obviously over-large and over-small exponents during decimal->Neil Booth2007-10-151-8/+44
| | | | | | | | | | integer conversion. In some such cases this makes us one or two orders of magnitude faster than NetBSD's libc. Glibc seems to have a similar fast path. Also, tighten up some upper bounds to save a bit of memory. llvm-svn: 42984
* Consolidate logic for creating NaNs. Silence compiler warning.Neil Booth2007-10-141-10/+15
| | | | llvm-svn: 42966
* Whether arithmetic is supported is a property of the semantics. Make itNeil Booth2007-10-141-41/+36
| | | | | | so, and clean up the checks by putting them in an inline function. llvm-svn: 42965
* Separate out parsing of decimal number. Use this to only allocateNeil Booth2007-10-141-97/+150
| | | | | | | memory for the significand once up-front. Also ignore insignificant trailing zeroes; this saves unnecessary multiplications later. llvm-svn: 42964
* If the power of 5 is exact, and the reciprocal exact, the error is zero not ↵Neil Booth2007-10-131-1/+1
| | | | | | one half-ulps. This prevents an infinite loop in rare cases. llvm-svn: 42950
* Remove duplicate comment.Neil Booth2007-10-121-11/+0
| | | | llvm-svn: 42913
* Implement correctly-rounded decimal->binary conversion, i.e. conversionNeil Booth2007-10-121-6/+349
| | | | | | | | | | | from user input strings. Such conversions are more intricate and subtle than they may appear; it is unlikely I have got it completely right first time. I would appreciate being informed of any bugs and incorrect roundings you might discover. llvm-svn: 42912
* Remove a field that was never used.Neil Booth2007-10-121-9/+6
| | | | llvm-svn: 42911
* If we're trying to be arbitrary precision, unsigned char clearly won't cut ↵Neil Booth2007-10-121-1/+1
| | | | | | it. Needed for dec->bin conversions. llvm-svn: 42910
* Next PPC long double bits. First cut at constants.Dale Johannesen2007-10-111-6/+157
| | | | | | | | | No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. llvm-svn: 42865
* Use APInt::tcExtract. It's cleaner, and works :)Neil Booth2007-10-081-19/+14
| | | | llvm-svn: 42746
* Add back convertFromSignExtendedInteger.Neil Booth2007-10-071-0/+30
| | | | llvm-svn: 42735
* Now that convertFromUnsignedParts has a sane, constant interface,Neil Booth2007-10-071-5/+1
| | | | | | | convertFromZeroExtendedInteger can be simplified as it doesn't need to make a copy of the source bignum. llvm-svn: 42734
* Reimplement convertFromUnsignedInteger so it is passed a const bignum.Neil Booth2007-10-071-18/+29
| | | | | | | | | It used to modify its argument in-place. This interface is saner and the implementation more efficient. It will be needed for decimal->binary conversion. llvm-svn: 42733
* convertFromInteger, as originally written, expected sign-extendedNeil Booth2007-10-071-4/+6
| | | | | | | | input. APInt unfortunately zero-extends signed integers, so Dale modified the function to expect zero-extended input. Make this assumption explicit in the function name. llvm-svn: 42732
* combineLostFractions does not need to be a member functionNeil Booth2007-10-071-16/+15
| | | | llvm-svn: 42729
* Cleaner, more general exponent output.Neil Booth2007-10-061-21/+22
| | | | llvm-svn: 42690
* silence warnings in no-assert build.Chris Lattner2007-10-061-23/+20
| | | | llvm-svn: 42687
* Generalize tcFullMultiply so that the operands can be of differingNeil Booth2007-10-061-3/+4
| | | | | | | | 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
* Add APFloat -> hexadecimal string conversion, as per %a and %A in C99.Neil Booth2007-10-031-3/+240
| | | | | | Useful for diagnostics and debugging. llvm-svn: 42598
* Tweak RoundAwayFromZero the bit number below which is truncated, and makeNeil Booth2007-10-031-8/+13
| | | | | | | | it const. Preparation for APFloat -> hexadecimal string conversion. llvm-svn: 42576
* Simplify and fix signed int -> FP conversions.Dale Johannesen2007-09-301-11/+3
| | | | llvm-svn: 42483
* Whitespace and compiler warning cleanup.Neil Booth2007-09-261-76/+91
| | | | llvm-svn: 42373
* Make APFloat->int conversions deterministic even inDale Johannesen2007-09-251-5/+33
| | | | | | cases with undefined behavior. llvm-svn: 42328
* Fix long double<->shorter FP type conversionsDale Johannesen2007-09-251-12/+29
| | | | | | of zero, infinity, and NaNs. llvm-svn: 42298
* Handle storage complications of float->float conversions.Neil Booth2007-09-221-18/+23
| | | | llvm-svn: 42220
* Change APFloat::convertFromInteger to take the incomingDale Johannesen2007-09-211-16/+19
| | | | | | | | | | 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
* Fix PR 1688. See comments there.Dale Johannesen2007-09-201-13/+25
| | | | llvm-svn: 42181
* Remove spurious consts. This fixes warnings with compilers thatDan Gohman2007-09-141-2/+2
| | | | | | are strict about such things. llvm-svn: 41956
* Compensate for partCount change in Bogus definitionDale Johannesen2007-09-121-1/+1
| | | | | | (could break hash table in ConstantFP) llvm-svn: 41874
* Add APInt interfaces to APFloat (allows directlyDale Johannesen2007-09-111-15/+149
| | | | | | | | | access to bits). Use them in place of float and double interfaces where appropriate. First bits of x86 long double constants handling (untested, probably does not work). llvm-svn: 41858
* Fix mod so it actually works. Fix conversions toDale Johannesen2007-09-051-9/+33
| | | | | | native types to handle denormals correctly. llvm-svn: 41726
* Oops, should be part of 41664; won't work very well without this piece.Dale Johannesen2007-08-311-0/+38
| | | | llvm-svn: 41665
* Enhance APFloat to retain bits of NaNs (fixes oggenc).Dale Johannesen2007-08-311-77/+76
| | | | | | | Use APFloat interfaces for more references, mostly of ConstantFPSDNode. llvm-svn: 41632
* Change LegalFPImmediates to use APFloat.Dale Johannesen2007-08-301-1/+1
| | | | | | | | | Add APFloat interfaces to ConstantFP, SelectionDAG. Fix integer bit in double->APFloat conversion. Convert LegalizeDAG to use APFloat interface in ConstantFPSDNode uses. llvm-svn: 41587
* Poison APFloat::operator==. Replace existing uses with bitwiseIsEqual.Dale Johannesen2007-08-241-1/+1
| | | | | | This means backing out the preceding change to Constants.cpp, alas. llvm-svn: 41378
* Revised per review feedback from previous patch.Dale Johannesen2007-08-241-36/+15
| | | | llvm-svn: 41353
* silence some warnings in an optimized build.Chris Lattner2007-08-241-11/+8
| | | | llvm-svn: 41352
* Change internal representation of ConstantFP to use APFloat.Dale Johannesen2007-08-241-1/+187
| | | | | | Interface to rest of the compiler unchanged, as yet. llvm-svn: 41348
* initial checkin of Neil's APFloat work.Chris Lattner2007-08-201-0/+1488
llvm-svn: 41203
OpenPOWER on IntegriCloud