------- Comment #11 from martsummsw at hotmail dot com  2006-08-27 19:33 -------
You are right =) 

I recall I did play with some params in 3.4, but without result.... but I did
not in 4.0 - since I did not expect a so (in my head) fairly low number to be
"large" ...

It would be real nice if gcc had an option forceing it to compile both unrolled
and not unrolled versions of known sizes and "at last" deciding the speed gain
contra the extra used space. In this case with e.g 14 iterations the space is
not even doubled in space however the speed is increased with more than 400%.
(I know gcc cannot know how much faster it is)

The #pragma would also be real nice....
I could dream about a pragma with the following behaviour ...
#pragma unroll-next-loop [guess x1,x2,x3] 

and if guess was used (for unknown sizes) it expanded "for (int u=0;u<x;u++)"
to
switch(x)
{
  case x1:
    unrolled x1 times
    break;
  case x2:
    unrolled x2 times
    break;
  and so on..
  default: 
    not unrolled ...
}


But to be realistic - you probaly have a lot of work and lot of better
suggestions to put into gcc. So maybe this should just be close now.

Thanks for reply! I am sorry I have wasted your time....

regards
Thorbjørn


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21827

Reply via email to