Generate code for -0. constants correctly in liarc.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 23 Feb 2014 16:39:24 +0000 (16:39 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 23 Feb 2014 16:39:24 +0000 (16:39 +0000)
src/Makefile.in
src/compiler/machines/C/cutl.scm
src/compiler/machines/C/stackify.scm

index 195cd7fc74c005bde6b0959602294a3171b559a5..5f50de5c232834a45599f081a61453269bfbeb53 100644 (file)
@@ -141,7 +141,7 @@ target-toolchain: all-sf
 target-toolchain: cross-target
 target-toolchain: lib/runtime.com
 
-@IF_LIARC@microcode/scheme: compile-runtime
+@IF_LIARC@microcode/scheme: all-runtime
 @IF_SVM@microcode/scheme: microcode/svm1-defns.h
 microcode/scheme:
        (cd microcode && $(MAKE) all)
@@ -354,7 +354,9 @@ all-runtime: compile-runtime
 @IF_LIARC@all-runtime: bundle-runtime
 
 .PHONY: bundle-runtime
+bundle-runtime: runtime/runtime-os2.c
 bundle-runtime: runtime/runtime-unx.c
+bundle-runtime: runtime/runtime-w32.c
 
 .PHONY: compile-runtime
 compile-runtime: toolchain
index 012fc6a2f3c9bd10ceafaee340307e26b89e3899..062dc92553debb238a49e7c77266bfd70258613f 100644 (file)
@@ -98,7 +98,14 @@ USA.
   (cond ((string? item) item)
        ((char? item) (string item))
        ((symbol? item) (symbol-name item))
-       ((number? item) (number->string item))
+       ((number? item)
+        ;; XXX Kludgey test for negative zero, to support building
+        ;; from versions when NUMBER->STRING failed to do that itself.
+        (if (and (flo:flonum? item)
+                 (flo:zero? item)
+                 (flo:negative? (flo:atan2 item -1.)))
+            "-0."
+            (number->string item)))
        ((decoded-time? item) (decoded-time->iso8601-string item))
        ((not item) "false")
        ((eq? item #t) "true")
index 4c21f560d1e5329e8a7cfc2ea8fe48cb22f55a6e..cc2b18d835c074fd7284c50b884908248a6bcf00 100644 (file)
@@ -534,7 +534,13 @@ USA.
                         prog)))
        ((flo:flonum? obj)
         (build/string stackify-opcode/push-flonum
-                      (number->string obj)
+                      ;; XXX Kludgey test for negative zero, to
+                      ;; support building from versions when
+                      ;; NUMBER->STRING failed to do that itself.
+                      (if (and (flo:zero? obj)
+                               (flo:negative? (flo:atan2 obj -1.)))
+                          "-0."
+                          (number->string obj))
                       prog))
        ;; The runtime system needs the following
        ((interpreter-return-address? obj)