Mail Archives: djgpp/1997/05/23/04:22:45
On 13 May 1997 03:40:10 GMT, ao950 AT FreeNet DOT Carleton DOT CA (Paul
Derbyshire) wrote:
<...>
>Compile with -m486, since anything speed-requiring should be run on 486
>and up nowadays. This causes gcc to optimize for 486 and up chips.
Two things about this- firstly, since i am linking separately from my
compile line, should I also link with a -m486? I've tried, and I get
no complaints... but I also don't know what I'm asking the linker to
do!
Secondly, what are all the "alignment problems" I keep seeing flash by
this newsgroup regarding something to do with -m486? I have notice a
speed increase compiling with it, so this isn't really a key issue; it
works in what I'm doing now nicely.
<...>
>A function
>called frequently, especially recursively or in inner loops, can be
>declared "register"
I'd never thought of that- thanks!
> and registers are used to pass parameters instead of
>the stack. If the function has only two or three arguments, they all get
>passed by register. This saves a lot of push and pop instructions, but it
>might cause gcc to juggle registers instead, so test your program's speed
>with and without this for each function. It of course does not affect
>functions with no arguments.
Great stuff. Thanks.
- Raw text -