summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APFloat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-7/+7
| | | | | | | | | 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"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-7/+8
| | | | | | | | | 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. llvm-svn: 75379
* Add support for letting the client choose different flavors of NaNs. ↵Mike Stump2009-05-301-6/+12
| | | | | | | | Testcase to be added in clang. llvm-svn: 72606
* Fix whitespacing (space after switch).Mike Stump2009-05-131-6/+6
| | | | llvm-svn: 71738
* Fix internal representation of fp80 to be theDale Johannesen2009-03-231-8/+6
| | | | | | | | | | same as a normal i80 {low64, high16} rather than its own {high64, low16}. A depressing number of places know about this; I think I got them all. Bitcode readers and writers convert back to the old form to avoid breaking compatibility. llvm-svn: 67562
* just initialize the first element, we don't need to set the rest to zeros.Chris Lattner2009-03-131-3/+3
| | | | llvm-svn: 66850
* Eliminate a 9640 byte static mutable initialized data item by moving itChris Lattner2009-03-131-2/+2
| | | | | | to the stack. This shrinks all llvm tools by 9k, and improves reentrancy. llvm-svn: 66847
* static functions don't need an anonymous namespace.Chris Lattner2009-03-121-373/+371
| | | | llvm-svn: 66845
* Unbreak the build on win32.Cedric Venet2009-02-141-1/+1
| | | | | | | | | | Cleanup some warning. Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync. Only tested with VS2008. hope it does not break anything. feel free to revert. llvm-svn: 64554
* Do not use host floating point types when emittingDale Johannesen2009-01-211-1/+2
| | | | | | | | | ASCII IR; loading and storing these can change the bits of NaNs on some hosts. Remove or add warnings at a few other places using host floating point; this is a bad thing to do in general. llvm-svn: 62712
* Make special cases (0 inf nan) work for frem.Dale Johannesen2009-01-211-23/+63
| | | | | | | | Besides APFloat, this involved removing code from two places that thought they knew the result of frem(0., x) but were wrong. llvm-svn: 62645
* Add an IEEE remainder function, which is notDale Johannesen2009-01-201-1/+39
| | | | | | | | fully implemented yet and not used. This is mainly to clarify that APFloat::mod implements C fmod, not remainder. llvm-svn: 62593
* compile-time fmod was done incorrectly. PR 3316.Dale Johannesen2009-01-191-2/+4
| | | | llvm-svn: 62528
* Get rid of bogus "control may reach end of non-void function ‘...’ beingBill Wendling2008-11-271-2/+2
| | | | | | inlined" message. llvm-svn: 60165
* Revert r60042. IndVarSimplify should check if APFloat is PPCDoubleDouble ↵Evan Cheng2008-11-261-7/+1
| | | | | | first before trying to convert it to an integer. llvm-svn: 60072
* convertToSignExtendedInteger should return opInvalidOp instead of asserting ↵Evan Cheng2008-11-251-1/+7
| | | | | | if sematics of float does not allow arithmetics. llvm-svn: 60042
* Add a "loses information" return value to APFloat::convertDale Johannesen2008-10-091-14/+37
| | | | | | | and APFloat::convertToInteger. Restore return value to IEEE754. Adjust all users accordingly. llvm-svn: 57329
* Rename APFloat::convertToAPInt to bitcastToAPInt toDale Johannesen2008-10-091-4/+4
| | | | | | | make it clearer what the function does. No functional change. llvm-svn: 57325
* Mark negative-zero-to-int conversion as Inexact,Dale Johannesen2008-10-071-1/+2
| | | | | | | | | since -0.0 can't be represented as an int. This prevents llvm from reducing -0.0 to a load-and-convert of int 0. Fixes ieee.exp/mzero[2356].c in gcc testsuite. llvm-svn: 57224
* Be more precise about which conversions of NaNsDale Johannesen2008-10-061-3/+18
| | | | | | | | are Inexact. (These are not Inexact as defined by IEEE754, but that seems like a reasonable way to abstract what happens: information is lost.) llvm-svn: 57218
* Temporarily revert functionality change from my previous patch;Dale Johannesen2008-10-061-2/+1
| | | | | | it is too aggressive. llvm-svn: 57203
* Mark shortening NaN conversions as Inexact. PR 2856.Dale Johannesen2008-10-061-6/+9
| | | | | | Improve description of unsupported formats. llvm-svn: 57185
* Rework the routines that convert AP[S]Int into a string. Now, instead ofChris Lattner2008-08-171-2/+1
| | | | | | | | | | | | | | | | | 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
* remove a dead APInt ctor.Chris Lattner2008-08-171-0/+1
| | | | llvm-svn: 54869
* Don't assume underlying APInt type is limitedDale Johannesen2008-05-141-1/+1
| | | | | | to 64 bits. llvm-svn: 51135
* Remove undefined behavior in hex string->APFloatDale Johannesen2008-05-141-1/+1
| | | | | | conversion. Try 0x1.0000a4p+0f. Neil, please review. llvm-svn: 51132
* Make firstEightPowers const.Dan Gohman2008-05-121-2/+2
| | | | llvm-svn: 50975
* Suppress -Wshorten-64-to-32 warnings for 64-bit hosts.Evan Cheng2008-05-021-23/+25
| | | | llvm-svn: 50590
* Check that APFloat::convert is not trying to targetDale Johannesen2008-04-201-0/+1
| | | | | | | | | ppc long double, which doesn't work. This may break some stuff temporarily, but I want to avoid the propagation of code that assumes this works. llvm-svn: 49983
* Make several symbols static.Dan Gohman2008-04-101-18/+18
| | | | llvm-svn: 49496
* Add a method to APFloat to convert directly from APInt.Dan Gohman2008-02-291-0/+17
| | | | llvm-svn: 47738
* Added "Profile" method to APFloat for use with FoldingSet.Ted Kremenek2008-02-111-0/+6
| | | | | | | | | | Added member template "Add" to FoldingSetNodeID that allows "adding" arbitrary objects to a profile via dispatch to FoldingSetTrait<T>::Profile(). Removed FoldingSetNodeID::AddAPFloat and FoldingSetNodeID::APInt, as their functionality is now replaced using the above mentioned member template. llvm-svn: 46957
* Chris' change to print an approximation to long doublesDale Johannesen2008-01-311-1/+2
| | | | | | | exposed a bug in APFloat's long double->double conversion of NaNs. Broke several things in the ieee part of gcc testsuite. llvm-svn: 46617
* Remove top-level const qualifiers from casts, avoiding associatedDan Gohman2008-01-291-10/+10
| | | | | | compiler warnings. llvm-svn: 46509
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* 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
OpenPOWER on IntegriCloud