Indeed I was wondering about a similar problem myself some time ago, but not 
really serious...

Well, you have defined a generic data type, so the generic proc version is 
used. My first idea was to move the nongeneric proc above the generic one, in 
the hope that compiler would pick the first matching one. But that seems to 
make no difference.

I think what we may really desire is loop unrolling by the compiler for small 
N. The C/C++ or LLVM backend may do that, maybe later the Nim frontend too. 
Have you inspected the assembly output for N = 3? Maybe it is already perfect 
code? 

Reply via email to