Raymond Toy pushed to branch issue-466-c-wrapper-specfun at cmucl / cmucl Commits: 5eda6726 by Raymond Toy at 2026-01-26T17:30:13-08:00 Handle sqrt specially since we don't have a sqrtf function For now, sqrt of a single-float is converted to %sqrt that handles double-floats. Obvious conversions done handle single-float. - - - - - 1 changed file: - src/compiler/float-tran.lisp Changes: ===================================== src/compiler/float-tran.lisp ===================================== @@ -716,7 +716,6 @@ (dolist (stuff '((exp %exp *) (log %log float) - (sqrt %sqrt float) (sin %sin float) (cos %cos float) (tan %tan float) @@ -736,6 +735,14 @@ (deftransform name ((x) '(double-float) rtype :eval-name t :when :both) `(,prim x))))) +(deftransform sqrt ((x) (double-float) double-float :when :both) + `(%sqrt x)) + +;; We don't currently have sqrt specialized for single-floats, so use +;; the double-float version. +(deftransform sqrt ((x) (single-float) single-float) + `(coerce (%sqrt (coerce x 'double-float)) 'single-float)) + (defknown (%sincos) (double-float) (values double-float double-float) (movable foldable flushable)) View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5eda6726b04abf3a826c726e... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/5eda6726b04abf3a826c726e... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)