-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elide bignum operations #4
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paulapatience
force-pushed
the
no-bignum
branch
4 times, most recently
from
June 29, 2024 03:14
a38646e
to
1140a64
Compare
yitzchak
reviewed
Jun 30, 2024
paulapatience
force-pushed
the
no-bignum
branch
2 times, most recently
from
June 30, 2024 15:33
3583fe7
to
9599d7c
Compare
yitzchak
reviewed
Jun 30, 2024
paulapatience
force-pushed
the
no-bignum
branch
6 times, most recently
from
July 4, 2024 20:58
697b0a5
to
253f13b
Compare
* code/schubfach/implementation.lisp (%schubfach): Remove spurious character.
* code/liebler/implementation.lisp (%liebler): Add some type declarations. Co-authored-by: Tarn W. Burton <[email protected]>
A declared result type of T is effectively (VALUES T &REST T). To constrain it to a single value, the syntax is (VALUES T &OPTIONAL). * code/math/implementation.lisp (round-to-odd/32, round-to-odd/64) (round-to-odd/128, expt10/32, expt10/64, expt10/128, floor-log-expt) (ceiling-log-expt): Declare result types with the (VALUES T &OPTIONAL) syntax.
It uses the anticipatory feature QUAVIVER/MATH/SMALLNUM. * code/math/implementation.lisp (arithmetic-word): New type. (round-to-odd/32, round-to-odd/64, round-to-odd/128, expt10/32) (expt10/64, expt10/128): Use it in FTYPE declarations. * code/math/packages.lisp (#:quaviver/math): Export ARITHMETIC-WORD. Co-authored-by: Tarn W. Burton <[email protected]>
* code/liebler/implementation.lisp (%liebler): * code/schubfach/implementation.lisp (%schubfach): Use ARITHMETIC-WORD, declaring any EXPT10 variables DYNAMIC-EXTENT. * code/dragonbox/implementation.lisp (floor-by-expt10-divisible-p) (floor-by-expt10-small, floor-by-expt10, compute-mul) (compute-mul-parity, %nearest, %directed): Same, and replace previous uses of EXPT10-SIZE with (ASH ARITHMETIC-SIZE 1).
In anticipation for upcoming math routines, where the principal arithmetic-sized parameter is first. * code/math/implementation.lisp (%round-to-odd-1, %round-to-odd-2) (round-to-odd/32, round-to-odd/64, round-to-odd/128): Swap parameter order. * code/liebler/implementation.lisp (%liebler): * code/schubfach/implementation.lisp (%schubfach): Update.
So that the sizes of all the parameters are apparent. * code/math/implementation.lisp (round-to-odd/32, round-to-odd/64) (round-to-odd/128): Rename to... (round-to-odd/32-64, round-to-odd/64-128, round-to-odd/128-256): ... these. * code/math/packages.lisp (#:quaviver/math): * code/liebler/implementation.lisp (quaviver:integer-float): * code/schubfach/implementation.lisp (quaviver:float-integer): Update.
From quaviver/dragonbox's COMPUTE-MUL operations. * code/math/implementation.lisp: Add copyright header. (%floor-multiply/n-2nq2n, %floor-multiply/evenp/n-2nq2n): New macros, extracted from code/dragonbox/implementation.lisp. (floor-multiply/32-64q64, floor-multiply/64-128q128) (floor-multiply/evenp/32-64q64, floor-multiply/evenp/64-128q128): New functions. * code/math/utility.lisp: Add copyright header. * code/math/packages.lisp: Same. (#:quaviver/math): Export new functions. * code/dragonbox/implementation.lisp (compute-mul, compute-mul-parity): Remove macros now found in quaviver/math. (beta-bounds/nearest/shorter-interval) (beta-bounds/nearest/normal-interval, beta-bounds/left-closed-directed) (beta-bounds/right-closed-directed): New functions. (%nearest, %directed, quaviver:float-integer): Update to use arithmetic-size–specific FLOOR-MULTIPLY and FLOOR-MULTIPLY/EVENP functions. * quaviver.asd (quaviver/math): Update license.
For extracting the high bits of a word. These operations allow some simplifications in quaviver/dragonbox's nearest shorter interval case and in the computations of DELTAI. * code/math/implementation.lisp (hi/64, hi/hi64/128): New functions. * code/math/packages.lisp (#:quaviver/math): Export them. * code/dragonbox/implementation.lisp (%nearest, %directed) (quaviver:float-integer): Use them.
Mostly ported from the reference implementation of Dragonbox. They are activated by default only on SBCL, as on other implementations they tend to be slower than bignum operations. * code/math/implementation.lisp (+/64-64, +/128-64, */32-64/hi64) (*/32-64/lo64, */64-64, */64-64/hi64, */64-64/lo64, */64-128/hi128) (*/64-128/lo128): New functions, mostly ported from reference Dragonbox. (hi/hi64/128): New smallnum optimization and compiler macro. (round-to-odd/32-64, round-to-odd/64-128): New smallnum optimizations. (floor-multiply/32-64q64, floor-multiply/64-128q128) (floor-multiply/evenp/32-64q64, floor-multiply/evenp/64-128q128): New smallnum optimizations from reference Dragonbox. (*expt10/values/64*): Add smallnum version. * code/math/packages.lisp: Push QUAVIVER/MATH/SMALLNUM feature on SBCL. * code/dragonbox/implementation.lisp (floor-by-expt10): New smallnum optimization from reference Dragonbox.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.