[Git][cmucl/cmucl][master] 3 commits: Fix #28: Recursive function definition in cross-compile

Raymond Toy rtoy at common-lisp.net
Sat Sep 3 18:01:28 UTC 2016


Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
2482e5f0 by Raymond Toy at 2016-09-03T10:55:25-07:00
Fix #28: Recursive function definition in cross-compile

The recursive definition comes from %single-float and %double-float
trying to coerce a double-double-float to a single or double.  Not
sure the best place to fix this, but added a special case here for
%single-float and %double-float to convert the double-double-float to
a double that can then be coerced to the appropriate type.  (Could
have added a deftransform for coerce to handle double-doubles, but
doing it here makes it easier to follow the code.)

Verified that x86->x86 and sparc->sparc cross-compiles no longer have
the warning.  Also verified that sparc->sparc actually cross-compiles
and loads successfully and that the result will compile itself
successfully.

- - - - -
6c86016d by Raymond Toy at 2016-09-03T10:59:29-07:00
Add comment.

- - - - -
a8934d15 by Raymond Toy at 2016-09-03T18:01:25+00:00
Merge branch 'rtoy-28-fix-recursive-fcn-defn' into 'master'

Fix #28: Recursive function definition

Convert a `double-double` to a double before coercing to a `single-float` or `double-float`.

See merge request !9
- - - - -


1 changed file:

- src/code/float.lisp


Changes:

=====================================
src/code/float.lisp
=====================================
--- a/src/code/float.lisp
+++ b/src/code/float.lisp
@@ -1047,9 +1047,15 @@
 		(number-dispatch ((x real))
 		  (((foreach single-float double-float
 			     #+long-float long-float
-			     #+double-double double-double-float
 			     fixnum))
 		   (coerce x ',type))
+		  #+double-double
+		  ((double-double-float)
+		   ;; Convert the double-double to a double before
+		   ;; coercing to the appropriate type.
+		   (coerce (+ (double-double-hi x)
+			      (double-double-lo x))
+			   ',type))
 		  ((bignum)
 		   (bignum-to-float x ',type))
 		  ((ratio)



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/compare/5beb6431855908e9010c36bc9aeaa57b0daebcf3...a8934d1590ee605e2f4f02071a71a8887c2d036a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20160903/d52890cb/attachment-0001.html>


More information about the cmucl-cvs mailing list