Skip to content

Commit

Permalink
Add feature identifier FP_FAST_FMA
Browse files Browse the repository at this point in the history
Signed-off-by: yamacir-kit <[email protected]>
  • Loading branch information
yamacir-kit committed Dec 21, 2024
1 parent ee6d1ef commit 15042e2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 102 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ Then, select one of the following targets and `make` it according to your purpos

| Target | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.5.302.so` and executable `meevax`.
| `all` | Build shared-library `libmeevax.0.5.303.so` and executable `meevax`.
| `install` | Copy files into `/usr/local` directly.
| `package` | Generate debian package `meevax_0.5.302_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.302_amd64.deb`.
| `package` | Generate debian package `meevax_0.5.303_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.303_amd64.deb`.
| `test` | Test executable `meevax`. This target requires Valgrind to be installed.
| `uninstall` | Remove files copied to `/usr/local` directly by target `install`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.302
0.5.303
111 changes: 18 additions & 93 deletions basis/srfi-144.ss
Original file line number Diff line number Diff line change
@@ -1,100 +1,22 @@
(define-library (srfi 144)
(import (only (meevax binary64)
FP_FAST_FMA
binary64-denormalized?
binary64-epsilon
binary64-exponent
binary64-fractional-part
binary64-fused-multiply-add
binary64-greatest
binary64-integer-log-binary
binary64-integral-part
binary64-least
binary64-log-binary
binary64-max
binary64-min
binary64-normalized-fraction
binary64-normalized?
binary64-remquo
binary64-sign-bit
binary64?
)
binary64-denormalized? binary64-epsilon binary64-exponent
binary64-fractional-part binary64-fused-multiply-add
binary64-greatest binary64-integer-log-binary
binary64-integral-part binary64-least binary64-log-binary
binary64-max binary64-min binary64-normalized-fraction
binary64-normalized? binary64-remquo binary64-sign-bit binary64?)
(only (meevax inexact)
acosh
asinh
atanh
copysign
cosh
cyl_bessel_j
cyl_neumann
e
erf
erfc
euler
expm1
fabs
ldexp
lgamma
log1p
nextafter
phi
pi
sinh
tanh
tgamma
)
acosh asinh atanh copysign cosh cyl_bessel_j cyl_neumann e erf erfc
euler expm1 fabs ldexp lgamma log1p nextafter phi pi sinh tanh
tgamma)
(only (scheme base)
*
+
-
/
<
<=
=
>
>=
and
car
cdr
ceiling
define
denominator
even?
expt
floor
if
inexact
integer?
lambda
let
negative?
numerator
odd?
or
positive?
quotient
remainder
round
square
truncate
values
zero?
)
* + - / < <= = > >= and car cdr ceiling cond-expand define
denominator even? expt floor if inexact integer? lambda let
negative? numerator odd? or positive? quotient remainder round
square truncate values zero?)
(only (scheme inexact)
acos
asin
atan
cos
exp
finite?
infinite?
log
nan?
sin
sqrt
tan
)
)
acos asin atan cos exp finite? infinite? log nan? sin sqrt tan))

(export fl-e fl-1/e fl-e-2 fl-e-pi/4 fl-log2-e fl-log10-e fl-log-2 fl-1/log-2
fl-log-3 fl-log-pi fl-log-10 fl-1/log-10 fl-pi fl-1/pi fl-2pi fl-pi/2
Expand Down Expand Up @@ -212,7 +134,10 @@

(define fl-epsilon binary64-epsilon)

(define fl-fast-fl+* FP_FAST_FMA)
(define fl-fast-fl+*
(cond-expand
(FP_FAST_FMA #f)
(else #f)))

(define fl-integer-exponent-zero (binary64-integer-log-binary 0.0))

Expand Down
5 changes: 5 additions & 0 deletions configure/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ namespace meevax::inline kernel
make_symbol(std::endian::native == std::endian::little ? "little-endian" : "big-endian"),
make_symbol("${PROJECT_NAME}"),
make_symbol("${PROJECT_NAME}-${PROJECT_VERSION}")

#ifdef FP_FAST_FMA
, make_symbol("FP_FAST_FMA")
#endif

#if __cpp_lib_math_special_functions
, make_symbol("__cpp_lib_math_special_functions")
#endif
Expand Down
6 changes: 0 additions & 6 deletions src/kernel/boot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,6 @@ namespace meevax::inline kernel

library.define<double>("binary64-epsilon", std::numeric_limits<double>::epsilon());

#ifdef FP_FAST_FMA
library.define<bool>("FP_FAST_FMA", true);
#else
library.define<bool>("FP_FAST_FMA", false);
#endif

library.define<procedure>("binary64-integral-part", [](let const& xs)
{
auto integral_part = 0.0;
Expand Down

0 comments on commit 15042e2

Please sign in to comment.