Re[2]: factorial: let's get ahead of jhc! :)

2006-03-02 Thread Bulat Ziganshin
Hello Simon, Friday, February 24, 2006, 7:18:30 PM, you wrote: >> 1) add for/if/while to the C-- statement types list (data CmmStmt) SM> Please don't extend the C-- data type - it's very small and simple SM> because that makes it easy to manipulate and reason about. SM> I don't see why you nee

Re: factorial: let's get ahead of jhc! :)

2006-03-01 Thread Simon Marlow
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

RE: Re[3]: factorial: let's get ahead of jhc! :)

2006-02-24 Thread Simon Peyton-Jones
| i have found my investiations in this area. that is the C-- code | generated for fac worker: | | Fac_zdwfac_entry() { | c1C0: | _s1BD = I32[Sp + 0]; | if (_s1BD != 1) goto c1C4; | R1 = I32[Sp + 4]; | Sp = Sp + 8; | jump (I32[Sp + 0]); | c1C4: |

Re: factorial: let's get ahead of jhc! :)

2006-02-24 Thread Simon Marlow
Bulat Ziganshin wrote: i propose to do for start rather small change that will allow to make things go several times faster and in particular outperform jhc for the small "leaf" loops (i.e. loops that use only GHC primitives and don't call other functions). that include factorial, "a[]+=b[i]" lo

Re[3]: factorial: let's get ahead of jhc! :)

2006-02-24 Thread Bulat Ziganshin
Hello Bulat, Friday, February 24, 2006, 6:37:42 PM, you wrote: SPJ>> Perhaps you may consider doing this transformation on the C-- data type SPJ>> only, without involving the (already very complicated) STG -> C-- code SPJ>> generator? i have found my investiations in this area. that is the C-- c

factorial: let's get ahead of jhc! :)

2006-02-24 Thread Bulat Ziganshin
Hello glasgow-haskell-users, i propose to do for start rather small change that will allow to make things go several times faster and in particular outperform jhc for the small "leaf" loops (i.e. loops that use only GHC primitives and don't call other functions). that include factorial, "a[]+=b[i]