User talk:Kim Bruning/Compiler metaprogramming example
I'd originally intended to see what would happen if I tried -funroll-loops (and no I wouldn't have put all of *THAT* expected result into wikipedia), but to my surprise, there was no difference in the output of g++. Apparently there are still some things I don't undestand about gcc, can anyone help?
Turns out that by default GCC doesn't unroll loops that are too large (have too many iterations). This is actually logical/useful, since otherwise such an unrolled loop might not fit into the processor-cache of the specific target processor.(Loop unrolling is supposed to be an Optimisation )) . At some point it might be interesting to get gcc to work like that, and modify the example page.
So every time I write a c++ program and compile it I'm doing compiler metaprogramming? Josh Cherry 03:18, 15 Jun 2004 (UTC)
I really don't think this is generally considered metaprogramming. Metaprogramming usually means having the compiler do work other than simple translation. (Even though that assembly is very complex and no human would write it, it's nothing unusual for a compiled program!) - Furrykef 06:55, 16 Aug 2004 (UTC)