Raymond Toy pushed to branch issue-425-correctly-rounded-math-functions at cmucl / cmucl Commits: f00d0070 by Raymond Toy at 2026-01-28T08:55:25-08:00 Implement lisp_sincos for fdlibm and core-math First, rename lisp_sincos in lisp/sincos.c to cmucl_sincos. Then define lisp_sincos in irrat.c to call cr_sincos or cmucl_sincos depending on whether we're using core-math or not. - - - - - 3 changed files: - src/code/irrat.lisp - src/lisp/irrat.c - src/lisp/sincos.c Changes: ===================================== src/code/irrat.lisp ===================================== @@ -214,9 +214,7 @@ (y1 double-float :out)) (declaim (inline %%sincos)) -(alien:def-alien-routine (#-core-math "lisp_sincos" - #+core-math "cr_sincos" - %%sincos) +(alien:def-alien-routine ("lisp_sincos" %%sincos) c-call:void (x double-float) (s double-float :out) ===================================== src/lisp/irrat.c ===================================== @@ -31,6 +31,7 @@ extern double cr_pow(double, double); extern double cr_hypot(double, double); extern double cr_log1p(double); extern double cr_expm1(double); +extern void cr_sincos(double, double *, double *); #endif @@ -243,3 +244,15 @@ lisp_scalbn(double x, int n) { return fdlibm_scalbn(x, n); } + +void +lisp_sincos (double x, double *s, double *c) +{ +#ifdef FEATURE_CORE_MATH + cr_sincos(x, s, c); +#else + extern void cmucl_sincos(double, double*, double*); + + cmucl_sincos(x, s, c); +#endif +} ===================================== src/lisp/sincos.c ===================================== @@ -13,7 +13,7 @@ * reduction just once. */ void -lisp_sincos (double x, double *s, double *c) +cmucl_sincos (double x, double *s, double *c) { int ix; union { int i[2]; double d; } ux; View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f00d0070856ee72247eaeed2... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/f00d0070856ee72247eaeed2... You're receiving this email because of your account on gitlab.common-lisp.net.