Skip to content
Snippets Groups Projects
  1. Feb 08, 2008
    • rtoy's avatar
      Need to export the following so cross-compiles work better: · 227d9627
      rtoy authored
      UNIX-SYSINFO SI-SYSNAME SI-HOSTNAME SI-RELEASE SI-VERSION SI-MACHINE
      SI-ARCHITECTURE SI-HW-SERIAL SI-HW-PROVIDER SI-SRPC-DOMAIN SI-PLATFORM
      SI-ISALIST SI-DHCP-CACHE
      
      Actually only UNIX-SYSINFO, SI-MACHINE, and SI-PLATFORM are needed
      (sparc-svr4-vm.lisp) but let's export them all since they're in
      exports.lisp.
      227d9627
  2. Feb 01, 2008
  3. Jan 31, 2008
    • rtoy's avatar
      Correct some comments. · b2a4d85d
      rtoy authored
      b2a4d85d
    • rtoy's avatar
      Revise again. Don't limit the fraction digits. Just print out · 3c160594
      rtoy authored
      whatever dd says.  This allows ~G to match what Fortran does, and also
      defers to ~F to let it decide what to do.
      
      The following tests now fail:
      
      (assert (string= (format nil "~9,5G" pi) "3.142    "))
      (assert (string= (format nil "~12,,,,'%g" 1.2345678d1) "12.34568 "))
      
      The former should be
      (assert (string= (format nil "~9,5G" pi) "3.1416    "))
      
      and the latter should be removed or changed to
      
      (assert (string= (format nil "~12,,,,'%g" 1.2345678d1) "%%%%%%%%%%%%"))
      3c160594
  4. Jan 30, 2008
  5. Jan 29, 2008
    • rtoy's avatar
      Minor tweak. dd is always positive in the fixed format case for · 92c0d760
      rtoy authored
      format-general-aux.
      92c0d760
    • rtoy's avatar
      o (format nil "~9,3,2,-2,'%@E" 1100.0) was printing %%%%%%. It should · c7a4509f
      rtoy authored
        print "+.001e+06"
      o Major changes for ~g.  See the comments in format-general-aux for
        more details.
        - ~g will choose ~e more often now, especially for large numbers.
        - ~g when using ~F as the output format won't overflow if the number
          has lots of significant digits.
        - Excessive number of digits has been suppressed.
        - The original d value is used for ~g, instead of the computed
          value.
      
      
      Here is the test suite used.  All tests passed.
      
      (assert (string= (format nil "~9,3,2,0,'%G" 0.0314159) "0.314e-01"))
      (assert (string= (format nil "~9,3,2,-2,'%@e" 3.14159) "+.003e+03"))
      (assert (string= (format nil "~6,2,1,'*F" 3.14159) " 31.42"))
      (assert (string= (format nil "~9,0,6f" 3.14159) " 3141590."))
      
      ;; Make sure a significant digit is printed with the bad choice of
      ;; scale factor.  Width is exceeded.
      (assert (string= (format nil "~9,4,,-7E" pi) ".00000003d+8"))
      (assert (string= (format nil "~9,4,,-5E" pi) ".000003d+6"))
      (assert (string= (format nil "~5,4,,7E" pi) "3141600.d-6"))
      (assert (string= (format nil "~11,4,,3E" pi) "  314.16d-2"))
      (assert (string= (format nil "~11,4,,5E" pi) "  31416.d-4"))
      (assert (string= (format nil "~11,4,,0E" pi) "  0.3142d+1"))
      (assert (string= (format nil "~9,,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~,,,-2E" pi) "0.003141592653589793d+3"))
      (assert (string= (format nil "~,,,2E" pi) "31.41592653589793d-1"))
      (assert (string= (format nil "~E" pi) "3.141592653589793d+0"))
      (assert (string= (format nil "~9,5,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~11,5,,-1E" pi) " 0.03142d+2"))
      (assert (string= (format nil "~G" pi) "3.141592653589793    "))
      ;; This test exceeds the specified width, unnecessarily.
      ;;(assert (string= (format nil "~9,5G" pi) "3.1416    "))
      (assert (string= (format nil "~9,5G" pi) "3.142    "))
      (assert (string= (format nil "|~13,6,2,7E|" pi) "| 3141593.d-06|"))
      (assert (string= (format nil "~9,3,2,0,'%E" pi) "0.314d+01"))
      (assert (string= (format nil "~9,0,6f" pi) " 3141593."))
      (assert (string= (format nil "~6,2,1,'*F" pi) " 31.42"))
      (assert (string= (format nil "~6,2,1,'*F" (* 100 pi)) "******"))
      (assert (string= (format nil "~9,3,2,-2,'%@E" pi) "+.003d+03"))
      (assert (string= (format nil "~10,3,2,-2,'%@E" pi) "+0.003d+03"))
      (assert (string= (format nil "~15,3,2,-2,'%,'=@E" pi) "=====+0.003d+03"))
      (assert (string= (format nil "~9,3,2,-2,'%E" pi) "0.003d+03"))
      (assert (string= (format nil "~8,3,2,-2,'%@E" pi) "%%%%%%%%"))
      
      (assert (string= (format nil "~g" 1e0) "1.    "))
      ;; This test is one interpration of the spec.  We don't use this.
      ;;(assert (string= (format nil "~g" 1.2d40) "12000000000000000000000000000000000000000.    "))
      (assert (string= (format nil "~g" 1.2d40) "1.2d+40"))
      
      (assert (string= (format nil "~e" 0) "0.0e+0"))
      (assert (string= (format nil "~e" 0d0) "0.0d+0"))
      (assert (string= (format nil "~9,,4e" 0d0) "0.0d+0000"))
      (assert (string= (format nil "~E" 1.234567890123456789d4) "1.2345678901234567d+4"))
      
      (assert (string= (format nil "~20E" (expt 2d0 120)) "1.32922799578492d+36"))
      (assert (string= (format nil "~21,8E" (expt 2d0 120)) "       1.32922800d+36"))
      (assert (string= (format nil "~9,,,-2E" 1.2345689d3) ".00123d+6"))
      (assert (string= (format nil "~9,,,-2E" -1.2345689d3) "-.0012d+6"))
      (assert (string= (format nil "~9,,,-2E" 1.2345689d-3) ".00123d+0"))
      (assert (string= (format nil "~9,,,-2E" -1.2345689d-3) "-.0012d+0"))
      
      ;; Trac ticket #12:
      (assert (string= (format nil "~10,1,2,0,'*,,'DE" 1d-6) "   0.1D-05"))
      
      (assert (string= (format nil "~11f" 1.23456789123456789d-3) ".0012345679"))
      
      ;; Don't overflow
      (assert (string= (format nil "~12,,,,'%g" 1.2345678d1) "12.34568    "))
      
      ;; From CLH 22.3.11
      (defun test-f (x)
         (format nil "~6,2F|~6,2,1,'*F|~6,2,,'?F|~6F|~,2F|~F"
                 x x x x x x))
      
      (assert (string= (test-f 3.14159) "  3.14| 31.42|  3.14|3.1416|3.14|3.14159"))
      (assert (string= (test-f -3.14159) " -3.14|-31.42| -3.14|-3.142|-3.14|-3.14159" ))
      (assert (string= (test-f 100.0)  "100.00|******|100.00| 100.0|100.00|100.0"))
      (assert (string= (test-f 1234.0) "1234.00|******|??????|1234.0|1234.00|1234.0"))
      (assert (string= (test-f 0.006) "  0.01|  0.06|  0.01| 0.006|0.01|0.006"))
      
      
      
      (defun test-e (x)
          (format nil
                 "~9,2,1,,'*E|~10,3,2,2,'?,,'$E|~
                  ~9,3,2,-2,'%@E|~9,2E"
                 x x x x))
      
      
      (assert (string= (test-e 3.14159)  "  3.14e+0| 31.42$-01|+.003e+03|  3.14e+0"))
      (assert (string= (test-e -3.14159)  " -3.14e+0|-31.42$-01|-.003e+03| -3.14e+0"))
      (assert (string= (test-e 1100.0)  "  1.10e+3| 11.00$+02|+.001e+06|  1.10e+3"))
      (assert (string= (test-e 1100.0d0)  "  1.10d+3| 11.00$+02|+.001d+06|  1.10d+3"))
      (assert (string= (test-e 1.1e13)  "*********| 11.00$+12|+.001e+16| 1.10e+13"))
      (assert (string= (test-e 1.1d120)  "*********|??????????|%%%%%%%%%|1.10d+120"))
      
      (defun test-g (x)
         (format nil "~9,2,1,,'*G|~9,3,2,3,'?,,'$G|~9,3,2,0,'%G|~9,2G"
      	   x x x x))
      
      (assert (string= (test-g 0.0314159)  "  3.14e-2|314.2$-04|0.314e-01|  3.14e-2"))
      (assert (string= (test-g 0.314159)  "  0.31   |0.314    |0.314    | 0.31    "))
      (assert (string= (test-g 3.14159)  "   3.1   | 3.14    | 3.14    |  3.1    "))
      (assert (string= (test-g 31.4159)  "   31.   | 31.4    | 31.4    |  31.    "))
      (assert (string= (test-g 314.159)  "  3.14e+2| 314.    | 314.    |  3.14e+2"))
      (assert (string= (test-g 3141.59)  "  3.14e+3|314.2$+01|0.314e+04|  3.14e+3"))
      (assert (string= (test-g 3141.59d0)  "  3.14d+3|314.2$+01|0.314d+04|  3.14d+3"))
      (assert (string= (test-g 3.14e12)  "*********|314.0$+10|0.314e+13| 3.14e+12"))
      (assert (string= (test-g 3.14d120)  "*********|?????????|%%%%%%%%%|3.14d+120"))
      
      (defun test-scale (k)
        (format nil "~&Scale factor ~2D: |~13,6,2,VE|"
      	  (- k 5) (- k 5) 3.14159))
      
      (assert (string= (test-scale 0) "Scale factor -5: | 0.000003e+06|"))
      (assert (string= (test-scale 1) "Scale factor -4: | 0.000031e+05|"))
      (assert (string= (test-scale 2) "Scale factor -3: | 0.000314e+04|"))
      (assert (string= (test-scale 3) "Scale factor -2: | 0.003142e+03|"))
      (assert (string= (test-scale 4) "Scale factor -1: | 0.031416e+02|"))
      (assert (string= (test-scale 5) "Scale factor  0: | 0.314159e+01|"))
      (assert (string= (test-scale 6) "Scale factor  1: | 3.141590e+00|"))
      (assert (string= (test-scale 7) "Scale factor  2: | 31.41590e-01|"))
      (assert (string= (test-scale 8) "Scale factor  3: | 314.1590e-02|"))
      (assert (string= (test-scale 9) "Scale factor  4: | 3141.590e-03|"))
      (assert (string= (test-scale 10) "Scale factor  5: | 31415.90e-04|"))
      (assert (string= (test-scale 11) "Scale factor  6: | 314159.0e-05|"))
      (assert (string= (test-scale 12) "Scale factor  7: | 3141590.e-06|"))
      c7a4509f
  6. Jan 28, 2008
  7. Jan 26, 2008
    • rtoy's avatar
      Was failing to print enough digits for things like (format nil · 75de5422
      rtoy authored
      "~9,,,-2E" 1.2345689d-3).   This change also allows us to get rid of
      one other call to flonum-to-string, so printing should be faster now.
      
      Some additional tests:
      
      (assert (string= (format nil "~9,,,-2E" 1.2345689d3) ".00123d+6"))
      (assert (string= (format nil "~9,,,-2E" -1.2345689d3) "-.0012d+6"))
      (assert (string= (format nil "~9,,,-2E" 1.2345689d-3) ".00123d+0"))
      (assert (string= (format nil "~9,,,-2E" -1.2345689d-3) "-.0012d+0"))
      75de5422
  8. Jan 25, 2008
    • rtoy's avatar
      o Incorrect number of digits were printed for ~wF. · 9e71e519
      rtoy authored
      o If FMIN is given, print out the digits, even if we're out of room.
        (This is so ~E will print at least 1 digit due to a bad choice in
        scale factor.)
      
      The following tests all pass.
      
      (assert (string= (format nil "~9,3,2,0,'%G" 0.0314159) "0.314e-01"))
      (assert (string= (format nil "~9,3,2,-2,'%@e" 3.14159) "+.003e+03"))
      (assert (string= (format nil "~6,2,1,'*F" 3.14159) " 31.42"))
      (assert (string= (format nil "~9,0,6f" 3.14159) " 3141590."))
      
      (assert (string= (format nil "~9,4,,-7E" pi) ".00000003d+8"))
      (assert (string= (format nil "~9,4,,-5E" pi) ".000003d+6"))
      (assert (string= (format nil "~5,4,,7E" pi) "3141600.d-6"))
      (assert (string= (format nil "~11,4,,3E" pi) "  314.16d-2"))
      (assert (string= (format nil "~11,4,,5E" pi) "  31416.d-4"))
      (assert (string= (format nil "~11,4,,0E" pi) "  0.3142d+1"))
      (assert (string= (format nil "~9,,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~,,,-2E" pi) "0.003141592653589793d+3"))
      (assert (string= (format nil "~,,,2E" pi) "31.41592653589793d-1"))
      (assert (string= (format nil "~E" pi) "3.141592653589793d+0"))
      (assert (string= (format nil "~9,5,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~11,5,,-1E" pi) " 0.03142d+2"))
      (assert (string= (format nil "~G" pi) "3.141592653589793    "))
      (assert (string= (format nil "~9,5G" pi) "3.1416    "))
      (assert (string= (format nil "|~13,6,2,7E|" pi) "| 3141593.d-06|"))
      (assert (string= (format nil "~9,3,2,0,'%E" pi) "0.314d+01"))
      (assert (string= (format nil "~9,0,6f" pi) " 3141593."))
      (assert (string= (format nil "~6,2,1,'*F" pi) " 31.42"))
      (assert (string= (format nil "~6,2,1,'*F" (* 100 pi)) "******"))
      (assert (string= (format nil "~9,3,2,-2,'%@E" pi) "+.003d+03"))
      (assert (string= (format nil "~10,3,2,-2,'%@E" pi) "+0.003d+03"))
      (assert (string= (format nil "~15,3,2,-2,'%,'=@E" pi) "=====+0.003d+03"))
      (assert (string= (format nil "~9,3,2,-2,'%E" pi) "0.003d+03"))
      (assert (string= (format nil "~8,3,2,-2,'%@E" pi) "%%%%%%%%"))
      
      (assert (string= (format nil "~g" 1e0) "1.    "))
      ;(assert (string= (format nil "~g" 1.2d40) "12000000000000000000000000000000000000000.    "))
      
      (assert (string= (format nil "~e" 0) "0.0e+0"))
      (assert (string= (format nil "~e" 0d0) "0.0d+0"))
      (assert (string= (format nil "~9,,4e" 0d0) "0.0d+0000"))
      (assert (string= (format nil "~E" 1.234567890123456789d4) "1.2345678901234567d+4"))
      
      (assert (string= (format nil "~20E" (expt 2d0 120)) "1.32922799578492d+36"))
      (assert (string= (format nil "~21,8E" (expt 2d0 120)) "       1.32922800d+36"))
      
      (assert (string= (format nil "~11f" 1.23456789123456789d-3) ".0012345679"))
      
      ;; From CLH 22.3.11
      (defun test-f (x)
         (format nil "~6,2F|~6,2,1,'*F|~6,2,,'?F|~6F|~,2F|~F"
                 x x x x x x))
      
      (assert (string= (test-f 3.14159) "  3.14| 31.42|  3.14|3.1416|3.14|3.14159"))
      (assert (string= (test-f -3.14159) " -3.14|-31.42| -3.14|-3.142|-3.14|-3.14159" ))
      (assert (string= (test-f 100.0)  "100.00|******|100.00| 100.0|100.00|100.0"))
      (assert (string= (test-f 1234.0) "1234.00|******|??????|1234.0|1234.00|1234.0"))
      (assert (string= (test-f 0.006) "  0.01|  0.06|  0.01| 0.006|0.01|0.006"))
      
      
      
      (defun test-e (x)
          (format nil
                 "~9,2,1,,'*E|~10,3,2,2,'?,,'$E|~
                  ~9,3,2,-2,'%@E|~9,2E"
                 x x x x))
      
      
      (assert (string= (test-e 3.14159)  "  3.14e+0| 31.42$-01|+.003e+03|  3.14e+0"))
      (assert (string= (test-e -3.14159)  " -3.14e+0|-31.42$-01|-.003e+03| -3.14e+0"))
      (assert (string= (test-e 1100.0)  "  1.10e+3| 11.00$+02|+.001e+06|  1.10e+3"))
      (assert (string= (test-e 1100.0d0)  "  1.10d+3| 11.00$+02|+.001d+06|  1.10d+3"))
      (assert (string= (test-e 1.1e13)  "*********| 11.00$+12|+.001e+16| 1.10e+13"))
      (assert (string= (test-e 1.1d120)  "*********|??????????|%%%%%%%%%|1.10d+120"))
      
      (defun test-scale (k)
        (format nil "~&Scale factor ~2D: |~13,6,2,VE|"
      	  (- k 5) (- k 5) 3.14159))
      
      (assert (string= (test-scale 0) "Scale factor -5: | 0.000003e+06|"))
      (assert (string= (test-scale 1) "Scale factor -4: | 0.000031e+05|"))
      (assert (string= (test-scale 2) "Scale factor -3: | 0.000314e+04|"))
      (assert (string= (test-scale 3) "Scale factor -2: | 0.003142e+03|"))
      (assert (string= (test-scale 4) "Scale factor -1: | 0.031416e+02|"))
      (assert (string= (test-scale 5) "Scale factor  0: | 0.314159e+01|"))
      (assert (string= (test-scale 6) "Scale factor  1: | 3.141590e+00|"))
      (assert (string= (test-scale 7) "Scale factor  2: | 31.41590e-01|"))
      (assert (string= (test-scale 8) "Scale factor  3: | 314.1590e-02|"))
      (assert (string= (test-scale 9) "Scale factor  4: | 3141.590e-03|"))
      (assert (string= (test-scale 10) "Scale factor  5: | 31415.90e-04|"))
      (assert (string= (test-scale 11) "Scale factor  6: | 314159.0e-05|"))
      (assert (string= (test-scale 12) "Scale factor  7: | 3141590.e-06|"))
      9e71e519
  9. Jan 24, 2008
    • rtoy's avatar
      Fix a format regression. (format nil "~21E" (expt 2d0 120)) was · 9877b8f6
      rtoy authored
      printing 1.0d+36.  It should have printed far more digits.
      
      The previous fixes weren't quite right.  We can't just adjust the
      scale factor with the size of the number.  The wrong number of digits
      gets printed.  So FLONUM-TO-STRING takes an extra parameter to
      indicate the exponent (base 10) of the number.  This is used to
      compensate for the output of FLONUM-TO-DIGITS so that we have the
      right number of digits.  (FLONUM-TO-STRING was assuming
      FLONUM-TO-DIGITS was called with a scaled number, but we weren't.)
      
      print.lisp:
      o FLONUM-TO-STRING takes extra parameter for the exponent (base 10) of
        the number---basically what ACCURATE-SCALE-EXPONENT would return.
      o Add FIXUP-FLONUM-TO-DIGITS to compensate the exponent returned by
        FLONUM-TO-DIGITS by the exponent of the number.
      o Some rearrange of the code to get the right number of digits printed
        under this new scheme.
      
      format.lisp:
      o Keep the exponent of the number and the scaled exponent separate so
        FLONUM-TO-STRING knows the real exponent.
      o FORMAT-GENERAL-AUX uses ACCURATE-SCALE-EXPONENT now instead of
        LISP:SCALE-EXPONENT.
      
      With these changes, the following tests all pass:
      
      (assert (string= (format nil "~9,3,2,0,'%G" 0.0314159) "0.314e-01"))
      (assert (string= (format nil "~9,3,2,-2,'%@e" 3.14159) "+.003e+03"))
      (assert (string= (format nil "~6,2,1,'*F" 3.14159) " 31.42"))
      (assert (string= (format nil "~9,0,6f" 3.14159) " 3141590."))
      
      (assert (string= (format nil "~9,4,,-7E" pi) ".00000003d+8"))
      (assert (string= (format nil "~9,4,,-5E" pi) ".000003d+6"))
      (assert (string= (format nil "~5,4,,7E" pi) "3141600.d-6"))
      (assert (string= (format nil "~11,4,,3E" pi) "  314.16d-2"))
      (assert (string= (format nil "~11,4,,5E" pi) "  31416.d-4"))
      (assert (string= (format nil "~11,4,,0E" pi) "  0.3142d+1"))
      (assert (string= (format nil "~9,,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~,,,-2E" pi) "0.003141592653589793d+3"))
      (assert (string= (format nil "~,,,2E" pi) "31.41592653589793d-1"))
      (assert (string= (format nil "~E" pi) "3.141592653589793d+0"))
      (assert (string= (format nil "~9,5,,-1E" pi) ".03142d+2"))
      (assert (string= (format nil "~11,5,,-1E" pi) " 0.03142d+2"))
      (assert (string= (format nil "~G" pi) "3.141592653589793    "))
      (assert (string= (format nil "~9,5G" pi) "3.1416    "))
      (assert (string= (format nil "|~13,6,2,7E|" pi) "| 3141593.d-06|"))
      (assert (string= (format nil "~9,3,2,0,'%E" pi) "0.314d+01"))
      (assert (string= (format nil "~9,0,6f" pi) " 3141593."))
      (assert (string= (format nil "~6,2,1,'*F" pi) " 31.42"))
      (assert (string= (format nil "~6,2,1,'*F" (* 100 pi)) "******"))
      (assert (string= (format nil "~9,3,2,-2,'%@E" pi) "+.003d+03"))
      (assert (string= (format nil "~10,3,2,-2,'%@E" pi) "+0.003d+03"))
      (assert (string= (format nil "~15,3,2,-2,'%,'=@E" pi) "=====+0.003d+03"))
      (assert (string= (format nil "~9,3,2,-2,'%E" pi) "0.003d+03"))
      (assert (string= (format nil "~8,3,2,-2,'%@E" pi) "%%%%%%%%"))
      
      (assert (string= (format nil "~g" 1e0) "1.    "))
      (assert (string= (format nil "~g" 1.2d40) "12000000000000000000000000000000000000000.    "))
      
      (assert (string= (format nil "~e" 0) "0.0e+0"))
      (assert (string= (format nil "~e" 0d0) "0.0d+0"))
      (assert (string= (format nil "~9,,4e" 0d0) "0.0d+0000"))
      (assert (string= (format nil "~E" 1.234567890123456789d4) "1.2345678901234567d+4"))
      
      (assert (string= (format nil "~20E" (expt 2d0 120)) "1.32922799578492d+36"))
      (assert (string= (format nil "~21,8E" (expt 2d0 120)) "       1.32922800d+36"))
      
      
      (let (x)
       (dotimes (k 13 x)
        (setq x (cons (format nil "~%Scale factor ~2D: |~13,6,2,VE|"
                (- k 5) (- k 5) 3.14159) x))))
      9877b8f6
  10. Jan 22, 2008
  11. Jan 18, 2008
    • rtoy's avatar
      code/bit-bash.lisp: · 6fea08db
      rtoy authored
      o Change MAX-BITS to #xffffffff.  This fixes (works around) the issue
        reported by Walter Pelissero, reported on cmucl-help, 2008-01-09.
        We will still have problems for sufficiently long strings.
      
      boot-2007-12-1.lisp:
      o Boot file to use for the above change.
      6fea08db
  12. Jan 09, 2008
  13. Jan 03, 2008
    • cshapiro's avatar
      Switch the FreeBSD port to use the common floating point trap handling · 9495c516
      cshapiro authored
      code.  Rather than introduce a new FreeBSD case to the x86 sigcontext
      member accessor routines, collapse all of the system specific routines
      down to a common set of routines.
      
      * code/debug-int.lisp - Disable some Darwin-specific code to debug
        NULL mcontext pointers.
      
      * code/float-trap.lisp - Remove ancient FreeBSD-specific code for
        handling floating point signals.
      
      * code/macros.lisp, code/sap.lisp, compiler/saptran.lisp - Include the
        SAP-REF-LONG setter by default on the x86.
      
      * code/x86-vm.lisp - Remove operating system specific sigcontext
        definitions and sigcontext accessors.  Define the alien sigcontext
        as a system area pointer.  Replace the sigcontext accessors with
        foreign function calls that mask the complexity of the underlying
        sigcontext member access.
      
      * compiler/x86/float.lisp - Unconditionally define STORE-LONG-FLOAT.
        This function is used by the %SET-SAP-REF-LONG VOP that underlies
        the SAP-REF-LONG setter.
      
      * compiler/x86/sap.lisp - Unconditionally define %SET-SAP-REF-LONG.
        In the case where there is not a distinct LONG-FLOAT type, admit
        DOUBLE-FLOAT values instead.  The x87 automatically widens values
        pushed onto stack.  This mirrors the behavior of the SAP-REF-LONG
        VOP.
      
      * lisp/Darwin-os.c, lisp/Linux-os.c - Define functions to access
        sigcontext members of interest to Lisp.  Delete the sc_reg function
        and replace its uses with os_sigcontext_reg which is more suitably
        typed.
      
      * lisp/FreeBSD-os.c - Define functions to access sigcontext members of
        interest to Lisp.  We need to be careful about the SSE and non-SSE
        cases for retrieving x87 registers from the saved machine state.
        Define a low-level SIGFPE handler to intercept floating point traps
        and restore the cleared status word bits based on the signal code.
        Get rid of sc_reg for the reasons noted above.
      
      * lisp/Darwin-os.h, lisp/FreeBSD-os.h - Declare the restore_fpu
        function and define a specialized RESTORE_FPU macro.  Remove the
        sc_reg prototype.
      
      * lisp/Linux-os.h - Remove the sc_reg prototype.
      
      * lisp/os.h - Add prototypes for the new os_sigcontext functions.
      
      * lisp/x86-lispregs.h - Redefine SC_REG and SC_PC to expand out to the
        new os_sigcontext functions.  Redfine SC_SP to expand out to SC_REG.
        Eliminate all platform-specific defintions of SC_PC and SC_SP.
      9495c516
  14. Dec 21, 2007
  15. Dec 18, 2007
  16. Dec 17, 2007
  17. Dec 15, 2007
    • rtoy's avatar
      Tracing with :encapsulate NIL works on Darwin now. There are some · 7d7c3c3e
      rtoy authored
      issues like why the mcontext slot is 0 in the sigcontext from a
      function end breakpoint.  This works around that problem for now.
      
      lisp/x86-arch.c:
      o Add documentation on how arch_do_displaced_inst works.
      o Darwin has the eflags register in the sigcontext so use that to
        enable and disable single-stepping using the eflags slot.  This is
        how Linux works too.  This change makes function start breakpoints
        work.
      
      code/debug-int.lisp:
      o In FIND-ESCAPED-FRAME, make sure the mcontext slot is not null (0)
        before we try to grab the cfp slot from it.  This works around an
        issue where the mcontext slot is 0 on Darwin.
      
      code/ntrace.lisp:
      o Make *TRACE-ENCAPSULATE-DEFAULT* be :default again.
      7d7c3c3e
  18. Dec 13, 2007
  19. Nov 14, 2007
    • rtoy's avatar
      Export COMPATIBLE-FUNCTION-TYPES-P. · 2b51b6a3
      rtoy authored
      2b51b6a3
    • rtoy's avatar
      Fix some mistakes accidentally introduced in the sigcontext · 42b3bda6
      rtoy authored
      rearrangement.  Changes not tested, but there are no compiler warnings
      anymore.
      
      o Fix typo:  It's fpstate, not ftpstate.
      o Fix dereferencing of the fpstate, which is not in the sigcontext
        anymore.  It's in the sc-mcontext slot of the sigcontext now.
      42b3bda6
    • rtoy's avatar
      boot-1007-11-14-1.lisp: · e86597ac
      rtoy authored
      o Add comments that we need to cross-compile on x86.
      o Load up boot-2007-11-1 for the x86 cross-compile to get rid of a
        warning.
      o Load up the default cross-x86-x86 script.
      
      exports.lisp:
      o Remove FLOAT-ACCURACY.  It is now gone.
      e86597ac
    • rtoy's avatar
      In UNIX-MMAP, replace FILE-OFFSET with (SIGNED-BYTE 32), since · 71a7a181
      rtoy authored
      unix-glibc2 doesn't define FILE-OFFSET.
      71a7a181
    • cshapiro's avatar
      * Change the way the x87 precision control is managed. While in Lisp, · 1440af76
      cshapiro authored
        the precision control will always be set to double precision.  For
        the duration of calls into C, the precision control will be set to
        the ABI default.  On Linux and Darwin this is double extended
        precision.  On all other platforms the precision control is left as
        double precision.  The specious FLOAT-ACCURACY declaration has been
        eliminated.
      
      * Shorten the precision control field to 24-bits by disposing of the
        unexamined high order eight bits of the status word.  This compacts
        the code generated around floating point mode changes and reduces
        consing.
      
      * Eliminate unnecessary uses of FLDENV and FSTENV.  We can substitute a
        use of FSTENV with FSTSW in FLOATING-POINT-MODES.  This reduces the
        number of cycles to access the relevant mode bits by a factor of
        thirty.  We cannot eliminate FLDENV in SET-FLOATING-POINT-MODES, but
        the common case does not require an update to the status word.  A
        fast path has been added to the VOP that improves the execution time
        by at least a factor of fifteen.
      
      * Remove the precision control option to SET-FLOATING-POINT-MODES.  It
        is the responsibility of the compiler to generating code that yields
        correctly rounded results in double and single precision.
      1440af76
  20. Nov 09, 2007
    • rtoy's avatar
      Lynn Quam noted that callbacks did not work on his system. This · 1e0ff599
      rtoy authored
      happened because the callback trampoline used malloc'ed space which
      were not executable by default.  Change this so that the trampoline is
      executable.
      
      code/unix.lisp, code/unix-glibc2.lisp:
      o Add UNIX-MPROTECT
      
      code/exports.lisp:
      o Export UNIX-MPROTECT
      
      code/alieneval.lisp:
      o Make sure the malloc'ed trampoline area is executable.
      
      general-info/release-19e.txt:
      o Update
      1e0ff599
  21. Nov 06, 2007
  22. Nov 05, 2007
  23. Oct 31, 2007
    • rtoy's avatar
      Update from Paul Foley. · 989bf7e1
      rtoy authored
      o Disable package errors when loading up external formats.
      o A minor patch allowing string-to-octets and vice versa to write into
        a preallocated array (though they might still allocate a bigger one
        if necessary),
      o Fix up any confusion between simple-base-string and simple-string so
        that nothing breaks when/if they're not the same.
      989bf7e1
  24. Oct 25, 2007
    • rtoy's avatar
      Import Paul Foley's external-formats support. · e49c536b
      rtoy authored
      New files:
      o code/extfmts.lisp
      o pcl/simple-streams/external-formats/iso8859-1.lisp
      o pcl/simple-streams/external-formats/void.lisp
      
      code/exports.lisp:
      o Export the new symbols STRING-TO-OCTETS, OCTETS-TO-STRING,
        *DEFAULT-EXTERNAL-FORMAT*, ENCODE-STRING, and DECODE-STRING from the
        STREAM package
      o Make the symbols in the EXT package too.
      
      pcl/simple-streams/internal.lisp:
      o Move the implementation of STRING-TO-OCTETS and friends to a new
        file (extfmts.lisp).
      
      pcl/simple-streams/external-formats/utf-8.lisp:
      o New implementation.
      
      tools/make-main-dist.sh:
      o Create new target directory to hold external formats
      o Copy all of the external formats to the new directory.
      
      tools/pclcom.lisp:
      o Compile new code
      
      tools/worldcom.lisp:
      o Compile code/extfmts.lisp
      
      tools/worldload.lisp:
      o Load code/extfmts.lisp
      e49c536b
  25. Oct 18, 2007
    • rtoy's avatar
      Slight reimplemention of how tracing of local functions is done. We · 620750d0
      rtoy authored
      don't do the hackish list-of-name to find local debug function
      anymore.  This change allows us to retrace local functions when the
      function is redefined.
      
      code/debug-int.lisp:
      o Add :LOCAL-NAME keyword parameter to tell us to look for the local
        function within the given FUN.  The bizarre hack using a list as the
        FUN to do this is now gone.
      
      code/ntrace.lisp:
      o Change TRACE-FDEFINITION to return a fourth value if the function is
        a local function.  The fourth value is the name of the local
        function.
      
      o TRACE-1 recognizes the extra value from TRACE-FDEFINITION to
        determine if this is a local function that needs to be traced.
        Also, if DEFINITION is given, we process that carefully so we can
        trace the new definition with a local function.
      
      o UNTRACE-1 likewise updated to recognize and handle local functions.
      
      o TRACE-REFINED-UPDATE modified so that when a function is redefined,
        we retrace the function itself if it was traced (as before).  But we
        also look through the traced functions to see if we need to retrace
        the local definitions in this new function.
      620750d0
  26. Oct 10, 2007
    • rtoy's avatar
      o Use new RATIONAL-TO-DD function to convert bignums to · fa8ea7c8
      rtoy authored
        double-doubles.
      o Remove now unused DOUBLE-DOUBLE-FLOAT-FROM-BITS.
      
      This should fix an issue with converting bignums to double-doubles.
      For example (- (ash 1 150) 1) can now be be represented accurately as
      a double-double.
      fa8ea7c8
    • rtoy's avatar
      o Add RATIONAL-TO-DD, an accurate method to convert rationals to · 4f86a308
      rtoy authored
        double-double-floats.  (From Richard Fateman.)
      o Use that in FLOAT-RATIO for convertnig ratios to
        double-double-floats.
      o Remove old double-double-float support from FLOAT-RATIO.
      o Split FLOAT-RATIO in two, one supporting single/double floats, and
        one for double-double-floats.
      
      With these changes, I think we now have print/read consistency for
      double-double-float numbers.
      4f86a308
  27. Oct 09, 2007
Loading