Raymond Toy pushed to branch issue-435-add-core-math-lisp-support at cmucl / cmucl Commits: a90abab8 by Raymond Toy at 2026-03-04T10:24:50-08:00 Remove unused DARWIN_SINGLE_FLOAT_OVERFLOW We fixed openlibm expf to signal overflow now, so this macro is not used nor needed anymore. - - - - - 12f6a778 by Raymond Toy at 2026-03-04T14:51:03-08:00 Fix #488: Add log2f function from openlibm - - - - - f103e3fd by Raymond Toy at 2026-03-04T14:51:03-08:00 Merge branch 'issue-488-add-openlibm-log2f' into 'master' Fix #488: Add log2f function from openlibm Closes #488 See merge request cmucl/cmucl!364 - - - - - 4600adb3 by Raymond Toy at 2026-03-11T19:00:12-07:00 Fix #478: Allow analyzer and link-checker to run on a schedule - - - - - af26a647 by Raymond Toy at 2026-03-11T19:00:12-07:00 Merge branch 'issue-478-run-analyzer-link-chcker-on-schedule' into 'master' Fix #478: Allow analyzer and link-checker to run on a schedule Closes #478 See merge request cmucl/cmucl!360 - - - - - 4775ebfb by Raymond Toy at 2026-03-12T07:31:26-07:00 Fix #486: Rename openlibm functions to be different from libm - - - - - 6b134354 by Raymond Toy at 2026-03-12T07:31:26-07:00 Merge branch 'issue-486-rename-openlibm-functions' into 'master' Fix #486: Rename openlibm functions to be different from libm Closes #486 See merge request cmucl/cmucl!363 - - - - - 90281c28 by Raymond Toy at 2026-03-12T07:35:13-07:00 Update comment according to review. - - - - - d43042c0 by Raymond Toy at 2026-03-12T07:36:22-07:00 Merge branch 'master' into issue-435-add-core-math-lisp-support - - - - - 13 changed files: - .gitlab-ci.yml - src/code/irrat.lisp - src/lisp/irrat.c - src/lisp/openlibm/math_private.h - src/lisp/openlibm/s_asinhf.c - src/lisp/openlibm/s_atanf.c - src/lisp/openlibm/s_cosf.c - src/lisp/openlibm/s_expm1f.c - src/lisp/openlibm/s_log1pf.c - src/lisp/openlibm/s_sincosf.c - src/lisp/openlibm/s_sinf.c - src/lisp/openlibm/s_tanf.c - src/lisp/openlibm/s_tanhf.c Changes: ===================================== .gitlab-ci.yml ===================================== @@ -9,6 +9,18 @@ variables: tar_ext: "xz" bootstrap: "" +workflow: + rules: + # Always run on schedules (for analyze and markdown-link-check stages) + - if: $CI_PIPELINE_SOURCE == "schedule" + # Run on merge requests + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + # Don't create a branch pipeline when an MR pipeline already exists + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH + - if: $CI_COMMIT_TAG + # Default install configuration to download the cmucl tarballs to use # for building. .install_template: &install_configuration @@ -159,18 +171,12 @@ linux:cross-build: CONFIG: "x86_linux" needs: - - # Normally need the linux:install stage to get the compiler to - # use. But for #337, we need the normal build from linux:build to - # do the cross-compile. Once the snapshot is made, we can use - # linux:install instead. - - job: linux:build - #- job: linux:install + - job: linux:install artifacts: true script: - bin/create-target.sh xtarget $CONFIG - bin/create-target.sh xcross $CONFIG - - bin/cross-build-world.sh -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp dist/bin/lisp + - bin/cross-build-world.sh -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp - bin/build.sh -b xlinux $bootstrap -R -C $CONFIG -o "xtarget/lisp/lisp -lib xtarget/lisp" - bin/make-dist.sh -I xdist xlinux-4 @@ -294,7 +300,11 @@ linux:static-analyzer: needs: - job: linux:build artifacts: true - when: manual + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $RUN_CHECKS + - when: manual + allow_failure: true script: # Analysis can generate huge amounts of output. For now just save # the results to the log file instead of also having it go to the @@ -354,10 +364,16 @@ markdown-link-check: # Only the linux runner has markdown-link-check installed tags: - linux - when: manual # It's ok if this fails; we don't want to declare the entire # pipeline as having failed. allow_failure: true + # This job doesn't depend on any others. + needs: [] + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + - if: $RUN_CHECKS + - when: manual + allow_failure: true script: # Check links in the main repo - find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check @@ -366,3 +382,4 @@ markdown-link-check: # https://gitlab.com/gitlab-org/gitlab/-/issues/17845. - git clone https://gitlab.common-lisp.net/cmucl/cmucl.wiki.git - find cmucl.wiki -name \*.md -print0 | xargs -0 -n1 markdown-link-check + ===================================== src/code/irrat.lisp ===================================== @@ -56,10 +56,9 @@ (push (list (intern (format nil "ARG-~D" i)) 'double-float) results)))) - ;; We assume the single-float version has the same C name as - ;; the double-float version except an "f" is appended. The - ;; lisp name is the same as the double-float name except "F" is - ;; appended. + ;; The C99 convention is for the float version to have the same + ;; name as the double version but with an "f" appended. We do + ;; the same here and append an "F" to the lisp name too. (alien:def-alien-routine (,(concatenate 'string c-name "f") ,(symbolicate lisp-name "F")) single-float ===================================== src/lisp/irrat.c ===================================== @@ -58,6 +58,31 @@ extern void cr_sincosf(float, float *, float *); extern float cr_log2f(float); #else #include "openlibm_math.h" +/* + * Declare the openlibm functions we use. This is needed because we + * changed the names of the openlibm functions. + */ +extern float openlibm_asinhf(float); +extern float openlibm_atanf(float); +extern float openlibm_cosf(float); +extern float openlibm_expm1f(float); +extern float openlibm_log1pf(float); +extern float openlibm_sinf(float); +extern float openlibm_tanf(float); +extern float openlibm_tanhf(float); +extern void openlibm_sincosf(float, float*, float*); +extern float __ieee754_acosf(float); +extern float __ieee754_acoshf(float); +extern float __ieee754_logf(float); +extern float __ieee754_atanhf(float); +extern float __ieee754_asinf(float); +extern float __ieee754_atan2f(float, float); +extern float __ieee754_expf(float); +extern float __ieee754_coshf(float); +extern float __ieee754_log10f(float); +extern float __ieee754_sinhf(float); +extern float __ieee754_hypotf(float, float); + #endif @@ -80,17 +105,6 @@ extern float cr_log2f(float); } \ } while (0) - -#ifdef DARWIN -#define DARWIN_SINGLE_FLOAT_OVERFLOW(y) \ - do { \ - if (fabs(y) >= 0x1.0p128) { \ - return fdlibm_setexception(y, FDLIBM_OVERFLOW); \ - } \ - } while (0) - -#endif - double lisp_sin(double x) { @@ -372,7 +386,7 @@ lisp_sinf(float x) #ifdef FEATURE_CORE_MATH return cr_sinf(x); #else - return sinf(x); + return openlibm_sinf(x); #endif } @@ -382,7 +396,7 @@ lisp_cosf(float x) #ifdef FEATURE_CORE_MATH return cr_cosf(x); #else - return cosf(x); + return openlibm_cosf(x); #endif } @@ -392,7 +406,7 @@ lisp_tanf(float x) #ifdef FEATURE_CORE_MATH return cr_tanf(x); #else - return tanf(x); + return openlibm_tanf(x); #endif } @@ -402,7 +416,7 @@ lisp_atanf(float x) #ifdef FEATURE_CORE_MATH return cr_atanf(x); #else - return atanf(x); + return openlibm_atanf(x); #endif } @@ -412,7 +426,7 @@ lisp_atan2f(float y, float x) #ifdef FEATURE_CORE_MATH return cr_atan2f(y, x); #else - return atan2f(y, x); + return __ieee754_atan2f(y, x); #endif } @@ -422,7 +436,7 @@ lisp_asinf(float x) #ifdef FEATURE_CORE_MATH return cr_asinf(x); #else - return asinf(x); + return __ieee754_asinf(x); #endif } @@ -432,7 +446,7 @@ lisp_acosf(float x) #ifdef FEATURE_CORE_MATH return cr_acosf(x); #else - return acosf(x); + return __ieee754_acosf(x); #endif } @@ -442,7 +456,7 @@ lisp_sinhf(float x) #ifdef FEATURE_CORE_MATH return cr_sinhf(x); #else - return sinhf(x); + return __ieee754_sinhf(x); #endif } @@ -452,7 +466,7 @@ lisp_coshf(float x) #ifdef FEATURE_CORE_MATH return cr_coshf(x); #else - return coshf(x); + return __ieee754_coshf(x); #endif } @@ -462,7 +476,7 @@ lisp_tanhf(float x) #ifdef FEATURE_CORE_MATH return cr_tanhf(x); #else - return tanhf(x); + return openlibm_tanhf(x); #endif } @@ -472,7 +486,7 @@ lisp_asinhf(float x) #ifdef FEATURE_CORE_MATH return cr_asinhf(x); #else - return asinhf((double) x); + return openlibm_asinhf((double) x); #endif } @@ -482,7 +496,7 @@ lisp_acoshf(float x) #ifdef FEATURE_CORE_MATH return cr_acoshf(x); #else - return acoshf(x); + return __ieee754_acoshf(x); #endif } @@ -492,7 +506,7 @@ lisp_atanhf(float x) #ifdef FEATURE_CORE_MATH return cr_atanhf(x); #else - return atanhf(x); + return __ieee754_atanhf(x); #endif } @@ -502,7 +516,7 @@ lisp_expf(float x) #ifdef FEATURE_CORE_MATH return cr_expf(x); #else - return expf(x); + return __ieee754_expf(x); #endif } @@ -512,7 +526,7 @@ lisp_logf(float x) #ifdef FEATURE_CORE_MATH return cr_logf(x); #else - return log(x); + return __ieee754_log(x); #endif } @@ -522,7 +536,7 @@ lisp_log10f(float x) #ifdef FEATURE_CORE_MATH return cr_log10f(x); #else - return log10f(x); + return __ieee754_log10f(x); #endif } @@ -554,7 +568,7 @@ lisp_hypotf(float x, float y) #ifdef FEATURE_CORE_MATH return cr_hypotf(x, y); #else - return hypotf(x, y); + return __ieee754_hypotf(x, y); #endif } @@ -564,7 +578,7 @@ lisp_log1pf(float x) #ifdef FEATURE_CORE_MATH return cr_log1pf(x); #else - return log1pf(x); + return openlibm_log1pf(x); #endif } @@ -574,7 +588,7 @@ lisp_expm1f(float x) #ifdef FEATURE_CORE_MATH return cr_expm1f(x); #else - return expm1f(x); + return openlibm_expm1f(x); #endif } @@ -584,9 +598,9 @@ lisp_sincosf(float x, float *s, float *c) #ifdef FEATURE_CORE_MATH cr_sincosf(x, s, c); #else - extern void sincosf(float x, float *s, float *c); + extern void openlibm_sincosf(float x, float *s, float *c); - sincosf(x, s, c); + openlibm_sincosf(x, s, c); #endif } ===================================== src/lisp/openlibm/math_private.h ===================================== @@ -309,6 +309,7 @@ irint(double x) #define __ieee754_yn yn #define __ieee754_remainder remainder #define __ieee754_sqrtf sqrtf +#if 0 #define __ieee754_acosf acosf #define __ieee754_acoshf acoshf #define __ieee754_logf logf @@ -317,14 +318,31 @@ irint(double x) #define __ieee754_atan2f atan2f #define __ieee754_expf expf #define __ieee754_coshf coshf +#else +extern float __ieee754_acosf(float); +extern float __ieee754_acoshf(float); +extern float __ieee754_logf(float); +extern float __ieee754_atanhf(float); +extern float __ieee754_asinf(float); +extern float __ieee754_atan2f(float, float); +extern float __ieee754_expf(float); +extern float __ieee754_coshf(float); +#endif #define __ieee754_fmodf fmodf #define __ieee754_powf powf #define __ieee754_lgammaf lgammaf #define __ieee754_lgammaf_r lgammaf_r +#if 0 #define __ieee754_log10f log10f #define __ieee754_log2f log2f #define __ieee754_sinhf sinhf #define __ieee754_hypotf hypotf +#else +extern float __ieee754_log10f(float); +extern float __ieee754_log2f(float); +extern float __ieee754_sinhf(float); +extern float __ieee754_hypotf(float, float); +#endif #define __ieee754_j0f j0f #define __ieee754_j1f j1f #define __ieee754_y0f y0f ===================================== src/lisp/openlibm/s_asinhf.c ===================================== @@ -26,7 +26,7 @@ ln2 = 6.9314718246e-01, /* 0x3f317218 */ huge= 1.0000000000e+30; OLM_DLLEXPORT float -asinhf(float x) +openlibm_asinhf(float x) { float t,w; int32_t hx,ix; ===================================== src/lisp/openlibm/s_atanf.c ===================================== @@ -47,7 +47,7 @@ one = 1.0, huge = 1.0e30; OLM_DLLEXPORT float -atanf(float x) +openlibm_atanf(float x) { float w,s1,s2,z; int32_t ix,hx,id; ===================================== src/lisp/openlibm/s_cosf.c ===================================== @@ -36,7 +36,7 @@ c3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ c4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ OLM_DLLEXPORT float -cosf(float x) +openlibm_cosf(float x) { double y; int32_t n, hx, ix; ===================================== src/lisp/openlibm/s_expm1f.c ===================================== @@ -38,7 +38,7 @@ Q1 = -3.3333212137e-2, /* -0x888868.0p-28 */ Q2 = 1.5807170421e-3; /* 0xcf3010.0p-33 */ OLM_DLLEXPORT float -expm1f(float x) +openlibm_expm1f(float x) { float y,hi,lo,c,t,e,hxs,hfx,r1,twopk; int32_t k,xsb; ===================================== src/lisp/openlibm/s_log1pf.c ===================================== @@ -36,7 +36,7 @@ Lp7 = 1.4798198640e-01; /* 3E178897 */ static const float zero = 0.0; OLM_DLLEXPORT float -log1pf(float x) +openlibm_log1pf(float x) { float hfsq,f,c,s,z,R,u; int32_t k,hx,hu,ax; ===================================== src/lisp/openlibm/s_sincosf.c ===================================== @@ -73,7 +73,7 @@ __kernel_sincosdf( double x, float * s, float * c ) } OLM_DLLEXPORT void -sincosf(float x, float * s, float * c) { +openlibm_sincosf(float x, float * s, float * c) { // Worst approximation of sin and cos NA *s = x; *c = x; ===================================== src/lisp/openlibm/s_sinf.c ===================================== @@ -36,7 +36,7 @@ s3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ s4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ OLM_DLLEXPORT float -sinf(float x) +openlibm_sinf(float x) { double y; int32_t n, hx, ix; ===================================== src/lisp/openlibm/s_tanf.c ===================================== @@ -34,7 +34,7 @@ t3pio2 = 3*M_PI_2, /* 0x4012D97C, 0x7F3321D2 */ t4pio2 = 4*M_PI_2; /* 0x401921FB, 0x54442D18 */ OLM_DLLEXPORT float -tanf(float x) +openlibm_tanf(float x) { double y; int32_t n, hx, ix; ===================================== src/lisp/openlibm/s_tanhf.c ===================================== @@ -22,7 +22,7 @@ static const float one=1.0, two=2.0, tiny = 1.0e-30, huge = 1.0e30; OLM_DLLEXPORT float -tanhf(float x) +openlibm_tanhf(float x) { float t,z; int32_t jx,ix; View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a03443c70abd7a41c91be30... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a03443c70abd7a41c91be30... You're receiving this email because of your account on gitlab.common-lisp.net.