logo       

Re: ffloor-derived-type-optimizer: msg#00285

lisp.cmucl.devel

Subject: Re: ffloor-derived-type-optimizer

Raymond Toy <toy@xxxxxxxxxxxxxxx> writes:

> I wonder why ffloor defoptimizer isn't called when compiling
> natively?

Maybe FFLOOR is transformed to something else with default OPTIMIZE
settings? No idea.

> This is probably caused by this bit:

Thanks, Indeed, this seems to work. I'll let it run through
ANSI tests before I commit it.

--- srctran.lisp.~1.124.2.1.~ Mon Aug 25 19:06:45 2003
+++ srctran.lisp Mon Aug 25 20:55:38 2003
@@ -1743,12 +1743,17 @@
(numeric-type->interval divisor-type))
(quot (,q-name (interval-div number-interval
divisor-interval)))
- (res-type (numeric-contagion number-type divisor-type)))
- (make-numeric-type
- :class (numeric-type-class res-type)
- :format (numeric-type-format res-type)
- :low (interval-low quot)
- :high (interval-high quot))))
+ (res-type (numeric-contagion number-type divisor-type))
+ (res-format (numeric-type-format res-type)))
+ (flet ((floatify (x)
+ (if (numberp x)
+ (coerce x (or res-format 'float))
+ x)))
+ (make-numeric-type
+ :class 'float
+ :format res-format
+ :low (floatify (interval-low quot))
+ :high (floatify (interval-high quot))))))

(defoptimizer (,name derive-type) ((number divisor))
(flet ((derive-q (n d same-arg)




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise