File tree Expand file tree Collapse file tree 6 files changed +32
-7
lines changed Expand file tree Collapse file tree 6 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -338,10 +338,11 @@ dividing \var{fixnum_1} by the product of the remaining arguments
338
338
339
339
%----------------------------------------------------------------------------
340
340
\entryheader
341
- \formdef{fx+/wraparound}{\categoryprocedure}{(fx+/wraparound \var{fixnum} \dots)}
342
- \formdef{fx-/wraparound}{\categoryprocedure}{(fx-/wraparound \var{fixnum} \dots)}
343
- \formdef{fx*/wraparound}{\categoryprocedure}{(fx*/wraparound \var{fixnum} \dots)}
344
- \formdef{fxsll/wraparound}{\categoryprocedure}{(fxsll/wraparound \var{fixnum} \dots)}
341
+ \formdef{fx+/wraparound}{\categoryprocedure}{(fx+/wraparound \var{fixnum} \var{fixnum})}
342
+ \formdef{fx-/wraparound}{\categoryprocedure}{(fx-/wraparound \var{fixnum} \var{fixnum})}
343
+ \formdef{fx-/wraparound}{\categoryprocedure}{(fx-/wraparound \var{fixnum})}
344
+ \formdef{fx*/wraparound}{\categoryprocedure}{(fx*/wraparound \var{fixnum} \var{fixnum})}
345
+ \formdef{fxsll/wraparound}{\categoryprocedure}{(fxsll/wraparound \var{fixnum} \var{fixnum})}
345
346
\returns the arithmetic result, wrapping on overflow
346
347
\listlibraries
347
348
\endentryheader
Original file line number Diff line number Diff line change 564
564
(mat fx-/ wraparound
565
565
(eqv? (fx-/ wraparound 3 0 ) 3 )
566
566
(eqv? (fx-/ wraparound 3 1 ) 2 )
567
+ (eqv? (fx-/ wraparound 0 3 ) - 3 )
567
568
(eqv? (fx-/ wraparound - 3 4 ) - 7 )
569
+ (eqv? (fx-/ wraparound 3 ) - 3 )
568
570
(error? (fx-/ wraparound ' (a . b) 0))
569
571
(error? (fx- (add1 (most-positive-fixnum)) 1))
570
572
(error? (fx- 1 (add1 (most-positive-fixnum))))
Original file line number Diff line number Diff line change @@ -121,6 +121,12 @@ Online versions of both books can be found at
121
121
The type recovery pass has improved support for \scheme{abs} with a fixnum argument
122
122
and added support for \scheme{1+}, \scheme{1-}, and \scheme{-1+}.
123
123
124
+ \subsection{Single-argument \scheme{fx-/wraparound} (10.2.0)}
125
+
126
+ The \scheme{fx-/wraparound} function changed to accept a single
127
+ argument, which makes it more consistent with the R6RS \scheme{fx-}
128
+ function.
129
+
124
130
\subsection{Constrain signal delivery to the main thread (10.1.0)}
125
131
126
132
Signals are now always delivered to the main Scheme thread to avoid crashes when a signal
@@ -2769,6 +2775,13 @@ in fasl files does not generally make sense.
2769
2775
%-----------------------------------------------------------------------------
2770
2776
\section{Bug Fixes}\label{section:bugfixes}
2771
2777
2778
+ \subsection{Fix \scheme{fx-/wraparound} with \scheme{0} first argument (10.2.0)}
2779
+
2780
+ When \scheme{fx-/wraparound} was called with \scheme{0} as its first
2781
+ argument, the call could be rewritten to have a single argument, even though
2782
+ \scheme{fx-/wraparound} required two arguments. As part of the repair,
2783
+ \scheme{fx-/wraparound} changed to accept a single argument.
2784
+
2772
2785
\subsection{Performance regression for \scheme{fxdiv-and-mod} at optimize-level 3 (10.2.0)}
2773
2786
2774
2787
At optimize-level 3, the source optimizer (cp0) could replace calls to
Original file line number Diff line number Diff line change 1796
1796
[(e) (%inline - (immediate 0 ) ,e)]
1797
1797
[(e1 e2) (%inline - ,e1 ,e2)])
1798
1798
(define-inline 3 fx-/wraparound
1799
+ [(e) (%inline - (immediate 0 ) ,e)]
1799
1800
[(e1 e2) (%inline - ,e1 ,e2)])
1800
1801
(define-inline 3 fx1-
1801
1802
[(e) (%inline - ,e (immediate ,(fix 1 )))])
1840
1841
[(e) (go src sexpr `(immediate ,(fix 0 )) e)]
1841
1842
[(e1 e2) (go src sexpr e1 e2)])
1842
1843
(define-inline 2 fx-/wraparound
1844
+ [(e)
1845
+ (bind #t (e)
1846
+ `(if ,(build-fixnums? (list e))
1847
+ ,(%inline - (immediate 0 ) ,e)
1848
+ ,(build-libcall #t src sexpr fx-/wraparound `(immediate 0 ) e)))]
1843
1849
[(e1 e2)
1844
1850
(bind #t (e1 e2)
1845
1851
`(if ,(build-fixnums? (list e1 e2))
Original file line number Diff line number Diff line change 353
353
(#2%fx+/wraparound x1 x2)))
354
354
355
355
(set-who! fx-/wraparound
356
- (lambda (x1 x2 )
357
- (#2%fx-/wraparound x1 x2)))
356
+ (case-lambda
357
+ [(x)
358
+ (#2%fx-/wraparound x)]
359
+ [(x1 x2)
360
+ (#2%fx-/wraparound x1 x2)]))
358
361
359
362
(set! fx1-
360
363
(lambda (x )
Original file line number Diff line number Diff line change 1389
1389
(fx+ [sig [(fixnum ...) -> (fixnum)]] [flags arith-op partial-folder]) ; not restricted to 2 arguments
1390
1390
(fx+/wraparound [sig [(fixnum fixnum) -> (fixnum)]] [flags arith-op partial-folder safeongoodargs])
1391
1391
(fx- [sig [(fixnum fixnum ...) -> (fixnum)]] [flags arith-op partial-folder]) ; not restricted to 1 or 2 arguments
1392
- (fx-/wraparound [sig [(fixnum fixnum) -> (fixnum)]] [flags arith-op partial-folder safeongoodargs])
1392
+ (fx-/wraparound [sig [(fixnum) -> (fixnum)] [(fixnum fixnum) -> (fixnum)]] [flags arith-op partial-folder safeongoodargs])
1393
1393
(fx/ [sig [(fixnum fixnum ...) -> (fixnum)]] [flags arith-op partial-folder]) ; not restricted to 1 or 2 arguments
1394
1394
(fx1+ [sig [(fixnum) -> (fixnum)]] [flags arith-op cp02])
1395
1395
(fx1- [sig [(fixnum) -> (fixnum)]] [flags arith-op cp02])
You can’t perform that action at this time.
0 commit comments