Re: [Chicken-hackers] Floating point performance

2019-04-24 Thread Peter Bex
On Thu, Apr 18, 2019 at 06:28:11PM +0200, Peter Bex wrote: > Now, fp+ is only inlineable if the scrutinizer can prove that it's adding > flonums, otherwise it falls back to a CPS call. I'm sure we can change > that relatively easily by making it into an inline function that uses > check_flonum or

Re: [Chicken-hackers] Floating point performance

2019-04-19 Thread felix . winkelmann
> To make this code specialize two things are needed: > > 1. Infer more specific types for (recursive) functions. > > 2. Prove that a function is always called with correct arguments. > > If we can do this then we can effectively re-walk the function with the > arguments assumed to be of the

Re: [Chicken-hackers] Floating point performance

2019-04-19 Thread megane
Peter Bex writes: [...] > > Of course this means several more intrinsics will have to be added as > safe versions for each of the specific flonum operators. Thoughts? Can't see a reason why not, except it's a lot of code to write. > > I also wonder why the scrutinizer can't detect that

[Chicken-hackers] Floating point performance

2019-04-18 Thread Peter Bex
Hi guys, I came across this post[1] and could not resist writing something like it in CHICKEN: (import srfi-4 (chicken fixnum) (chicken flonum)) (let* ((size (* 3200)) (v (make-f64vector size))) (time (do ((i 0 (fx+ i 1)) (sum 0.0 (fp+ sum (f64vector-ref v i