Parent Directory | Revision Log
|Links to HEAD:||(view) (annotate)|
Add or cleanup more docstrings.
Add or cleanup some docstrings.
o For CMU, ignore target only if we're not using oct-arrays. o Add implementation for SUB-QD-T.
Adjust code so that CMUCL can use arrays to store quad-doubles instead of using a (complex double-double-float). With these changes, CMUCL uses arrays and (rt:do-tests) passes successfully. oct.system: o Push :oct-array onto *FEATURES* to use arrays. This is the default if not building on CMUCL. qd-fun.lisp: o Fix two erroneous uses of zerop on a quad-double in sinh-qd and tanh-qd. o Fix two erroneous uses of + on %quad-double; they should have used ADD-QD instead. qd-rep.lisp: o Change conditionalization to allow arrays for CMUCL. o Update compiler macros appropriately. qd.lisp: o Adjust optional target arg appropriately for oct-array feature. o Clean up IGNORE declarations. o Add some more declarations for the target to make CMUCL happier.
Don't compile with safety 0 on Allegro. I think this causes problems on x86 because it doesn't quite keep the precision right.
Add ADD-QD-D-t, MUL-QD-D-T, and SQR-QD-T to declaim block.
Merge the changes from the THREE-ARG-BRANCH to HEAD.
qd-rep.lisp: o Fix typo in compiler macro for sub-d-qd qd.lisp: o Use 3-arg versions in div-qd-t to speed things up. Approximately doubles the speed with clisp. qd-fun.lisp: o Use 3-arg versions in sqrt-qd to speed things up. Approximately doubles the speed with clisp.
o Add 3-arg forms for add-qd-d, mul-qd-d, add-d-qd, sub-qd-d, sub-d-qd, and neg-qd. o Correct the compiler macros for CMUCL for sub-qd and sqr-qd.
Oops. Make sqr-qd-t inline.
o Add support for SQR-QD-T o Add compiler macro for SQR-QD.
o Move compiler macros from qd.lisp to qd-rep.lisp o Declare add-qd-t, mul-qd-t and div-qd-t as inline functions so that everything is still fast on cmucl.
First cut at adding a 3-arg versions of the basic operations to reduce consing by allowing the third argument to be a place where the result can be stored. This is intended to help reduce allocation and gc costs for Lisps that use arrays to represent quad-doubles. More work is needed to make the compiler macros do the right thing for CMUCL. qd-rep.lisp: o Add %STORE-QD-D to store a quad-double into a place. For CMUCL, there place argument is ignored and a fresh quad-double is created. qd.lisp: o Modify ADD-QD, SUB-QD, MUL-QD, and DIV-QD to take an optional third argument indicating where the result can be stored. Ignored on CMUCL. o Add ADD-QD-T, SUB-QD-T, MUL-QD-T, and DIV-QD-T, which are 3-arg functions with the third arg always required which is the storage area to hold the result. Ignored on CMUCL. o Add compiler macros to convert ADD-QD and friends to ADD-QD-T if the third arg is always given. The effect is, essentially, inlining ADD-QD.
MAKE-QD-DD is only defined for CMUCL, so don't unconditionally inline it.
o Add default implementation of float-infinity-p, float-nan-p, float-trapping-nan-p. These return NIL by default, unless the Lisp implementation has a suitable version. o Remove CMU conditionalization for float-infinity-p, float-nan-p, float-trapping-nan-p.
qd-package.lisp: o Don't :USE CMUCL's EXTENSIONS package anymore. Import just the symbols we need. qd-class.lisp: o No need to use package qualifiers. qd-fun.lisp: o Need package qualifier for MAYBE-INLINE. qd.lisp: o Need package qualifier for *INLINE-EXPANSION-LIMIT* .
o Oops. Fix up a few IN-PACKAGE's for the new package names. qd-fun.lisp: o Comment out the old sin/cos routines o Fix a few mistakes in accurate-sincos-qd o Rename accurate-sincos-qd to sincos-qd.
qd.lisp: o Oops. In INTEGER-DECODE-QD, the signs of the parts were not computed correctly when combining them into the final integer result. rt-tests.lisp: o Add a test for INTEGER-DECODE-QD. o Use OCT as the package, not QD.
Redo implementation of INTEGER-DECODE-QD. It used to return way too many digits if one of the components was 0. This causes problems because the resulting integer can't even be coerced back to a quad-double.
qd-rep.lisp: o Add macro WITH-QD-PARTS to extract the components of a quad-double. qd.lisp: o Use the macro as needed.
New SCALE-FLOAT-QD implementation that shouldn't suffer from premature overflow/underflow. (Still issue if the exponent is very large or very small, though, but not if the exponent is < 2000 or so.)
o Convert THREE-SUM2 to a macro instead of a function (to speed things up for Allegro and other Lisps that don't inline). o Update code for the THREE-SUM2 macro.
o Fix typo in ADD-QD-DD that was introduced in the THREE-SUM macro conversion. o Slightly simplify ADD-QD-DD too.
o Replace THREE-SUM with a macro to make sure it's inlined everywhere. o Update code for new THREE-SUM macro.
o Remove old code. o Inline float-infinity-p.
Make TWO-SUM a macro, just like we did for QUICK-TWO-SUM. All RT tests pass on CMUCL and Allegro. qd-package.lisp: o Don't import C::TWO-SUM anymore. qd-dd.lisp: o Make TWO-SUM a macro. qd.lisp o Add TWO-SUM macro for CMUCL (which just calls C::TWO-SUM). o Update all uses of TWO-SUM to use the macro appropriately.
To speed up Allegro (and other Lisp's that don't support inline functions), change QUICK-TWO-SUM from a function to a macro. Note that macro has different calling convention than the function. This is needed because Allegro apparently doesn't handle VALUES without boxing. All rt tests pass. qd-package.lisp: o For CMUCL, don't import C::QUICK-TWO-SUM into the QDI package anymore. qd-dd.lisp: o New QUICK-TWO-SUM macro. qd.lisp: o Add CMUCL version of QUICK-TWO-SUM macro, which just calls C::QUICK-TWO-SUM. o Update all users of QUICK-TWO-SUM appropriately.
qd-fun.lisp: o Remove unused var R1 in EXP-QD/REDUCE. o TAN-QD was calling ZEROP instead of ZEROP-QD. o Comment out extra copy of ASINH-QD. qd-io.lisp: o Ignore unused var in QD-PRINT-EXPONENT and QD-READER. qd.lisp: o Remove extra version of DIV-QD.
Add license information (MIT).
Document INTEGER-DECODE-QD better.
o Return infinity if we divide by zero. o Handle signed-zeroes in ABS-QD by checking sign of arg via float-sign, not minusp.
Division by zero returns infinity, if traps are disabled.
Make qd-<, qd->=, and qd-<= inline functions, because qd does.
The representation of quad double is monotonic so >= and <= can't do component wise tests. Replace them with negation of the opposite test. A test case: (>= #q.999999999999999999999999999999q0 1) was returning true because the quad-double is (1.0d0, -1.0d-30, 8.333642060758599d-47, -3.9501561822360763d-63), and 1.0d0 >= 1.0d0, returning T. This is wrong.
o Make SCALE-FLOAT-QD inline o Use QD-PARTS to get all parts of the %quad-double
o Try to get signed zeroes correct for addition and multiplication. o For CMUCL, produce infinities if an addition or multiplication would overflow.
Add comments. Use #:qdi instead of "QDI".
SCALE-FLOAT-QD would underflow too soon if the arg was very large but the scale was very negative. Change the implementation to fix that.
o Use explicit loop in nroot-qd instead of manually unrolling, to save code space. Loop cost should be negligible. o Fix typo in minusp-qd docstring.
o Some hacks for maybe-inline stuff. This needs some work. o INTEGER-DECODE-QD wasn't working correctly when components are zero. Hack this to make it work the way CMUCL does. This should be changed.
Add implementation of necessary core double-double routines for quad-double. qd-dd.lisp: o Needed routines (taken from CMUCL) qd.system: o Compile qd-dd.lisp if needed. qd-package.lisp: o If on CMUCL, import the needed routines from the C package. qd.lisp: o Remove the C:: package qualifiers from the core double-double routines.
Conditionalize some more uses of CMUCL double-double-floats.
Only define ADD-QD-DD and ADD-DD-QD for CMUCL.
Add some comments.
Split out the representation of %quad-double to a separate file. Add a portable presentation using a (simple-array double-float (4)) to hold a %quad-double number. All of the tests pass with the portable representation. qd.lisp: o Moved representation to qd-rep.lisp. o INTEGER-DECODE-QD was dependent on the internal representation. Replace with a function using the appropriate accessors. qd.system: o Add new file qd-rep.lisp. qd-rep.lisp: o Representation moved here. o Add portable implementation using a simple-array for holding a %quad-double.
Implement >= and <=.
qd-class.lisp: o TWO-ARG +, -, *, / needs to be able to handle the case when both args are numbers, not just reals. o Add implementation for =, <, and >. o Remove declarations in =, /=, <. qd-package.lisp: o Shadow /=, <, >. qd.lisp: o Add implementation of qd-<.
o Create a QUAD-DOUBLE-INTERNAL package for the internal stuff in qd.lisp and friends o create QUAD-DOUBLE package for the quad-double class. o Update in-package forms appropriately. o Export the necessary QUAD-DOUBLE-INTERNAL symbols so QUAD-DOUBLE can use them.
Change all basic arithmetic operations to use the CL: package prefix, in case we add a package that shadows these operations for real quad-double integration.
Move the quad-double IO functions to a new file. qd-io.lisp: o New file qd.lisp: o Moved IO functions from here to qd-io.lisp. qd.system: o Added qd-io.lisp to defsystem.
o Take advantage of mixed operations between double-floats and quad-doubles instead of coercing the double-float to a quad-double first. o Get rid of a few compiler notes in NPOW
A faster sub-d-qd (I think).
Selectively declare some functions as inline, depending if the :qd-inline feature is enabled or not. Some (small) functions are always inlined. The other functions are declared maybe-inline instead of inline. The maybe-inline functions are all part of a block-compiled section. However, even if :qd-inline is not enabled, some core routines have (space 0) to inline the functions.
Group all the inline declarations into one (several) places, instead of spreading them all over.
qd.lisp: o MAKE-QD-D takes optional args now, so you don't have to specify all four components now. The rest default to 0. If no optional args are given, a quick optimization is possible since renorm-4 isn't needed. o Take advantage of the new definition of MAKE-QD-D, especially when only the first arg is non-zero. o Add new functions: ZEROP-QD, ONEP-QD, PLUSP-QD, MINUSP-QD, QD-= qd-fun.lisp: o Use new MAKE-QD-D, and other new functions. o Change calls to MAKE-QD-DD to MAKE-QD-D when possible. With these changes, most of the code no longer depends on having a double-double type.
Use only the version of sqrt-qd in qd-fun.lisp.
o Since mul-qd-dd is broken, comment out this function so it doesn't get used inadvertently. o Declare type for k in scale-float-qd. If scale-double-float is inlined, this helps a lot.
o Since QD inlines all of the basic arithmetic operations, we do the same. (Should we make them maybe-inline instead so the user can control if and when they're inlined?) o To compile everything, *inline-expansion-limit* needs to be increased to 1600 or so. o Since everything is inlined, comment out the start-block/end-block compilation.
Change scale-float-qd to use multiplication by the scale factor, instead of scaling each component directly.
Declare scale-float-qd as inline.
o Forgot to add sub-qd-dd and sub-qd-d to the start-block. o Added sub-d-qd as inline function.
Oops. Move some more functions around so they're defined before use.
Oops. Remove print from READ-QD.
o Remove stuff that was commented out. o Reorder some functions so that they're defined before use. o Add ADD-D-QD, ADD-DD-QD
Compiling SQRT-QD in qd-fun.lisp causes CMUCL to get a BAD-COERCE-ERROR on ppc and x86. This doesn't happen on sparc. Therefore, move SQRT-QD to qd-fun.lisp. We need to track this down.
qd-fun.lisp: o Comment out SQRT-QD. qd.lisp: o Enable SQRT-QD here. o Block compile more stuff again, including SQRT-QD. This appears to make SQRT-QD about 50% faster and cons 1/5 as much. Other things seem to be faster and less consy too. These changes tested ok on latest (2007-04-12) CVS version on sparc. There may be issues on other platforms.
Compile renorm-4 and renorm-5 with safety 0.
Fix issue with reading negative exponents.
Put everything in the QD package.
o Rearrange order of functions o Block compile different sets of functions (not sure if this really makes a difference or not). o Removed unused functions.
quad-double initial import
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|Powered by ViewVC 1.1.5|