FWIW, here's the inner loop of the accumulating parameter factorial compiled with yesterday's HEAD on x86_64, via C:

Fac_zdwfac_info:
        movq    %rsi, %rax
        testq   %rsi, %rsi
        jne     .L4
        movq    %rdi, %rbx
        jmp     *(%rbp)
.L4:
        leaq    -1(%rsi), %rsi
        imulq   %rax, %rdi
        jmp     Fac_zdwfac_info

It's not perfect, but note the absence of memory operations.

The NCG version is similar, but has a couple of extra reg-to-reg moves (we need to beef up the NCG optimisations a bit).

Cheers,
        Simon
_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to