If divisor is 1, return (values x 0), if it's -1 (values (- x) 0). If
it's a floating point truncation, like ftruncate or fceiling,
(values (- (float x)) 0).
* optimization: the compiler no longer refuses to coerce large fixnums to
single floats inline, except on x86 where this limitation is still
necessary.
+ * optimization: truncation operations with constant divisor arguments
+ 1 and -1 are optimized away.
* bug fix: deadlock detection could report the same deadlock twice, for
two different threads. Now a single deadlock is reported exactly once.
* bug fix: interval-arithmetic division during type derivation did not
(def round)
(def floor)
(def ceiling))
+
+(macrolet ((def (name &optional float)
+ (let ((x (if float '(float x) 'x)))
+ `(deftransform ,name ((x y) (integer (constant-arg (member 1 -1)))
+ *)
+ "fold division by 1"
+ `(values ,(if (minusp (lvar-value y))
+ '(%negate ,x)
+ ',x) 0)))))
+ (def truncate)
+ (def round)
+ (def floor)
+ (def ceiling)
+ (def ftruncate t)
+ (def fround t)
+ (def ffloor t)
+ (def fceiling t))
+
\f
;;;; character operations