Re: TomsFastMath speeds
From: Colin Andrew Percival (cperciva_at_sfu.ca)
Date: 07/25/05
- Next message: Mack: "Re: simple shell script to produce randomness from soundcard on linux"
- Previous message: Andrew Swallow: "Re: Sometimes Terrorists can be Unimaginative"
- In reply to: Grumble: "Re: TomsFastMath speeds"
- Next in thread: Tom St Denis: "Re: TomsFastMath speeds"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 25 Jul 2005 19:22:37 +0000 (UTC)
Grumble <devnull@kma.eu.org> wrote:
> Colin Percival wrote:
>> [gcc] will decide that 16 or more variables are all "common
>> subexpressions" and that they should all be stored in registers, then
>> realize that it doesn't have enough registers and spill them all onto the
>> stack. Instead of simply storing them in memory where they're supposed
>> to go, which would be faster than allocating space for them on the
>> stack.)
>
> I don't understand... The stack IS in memory. Pushing a value on the
> stack means, in fact, writing to memory.
>
> What do you mean by "simply storing them in memory" ?
I should have said "simply writing those values into the locations where
those variables are supposed to be stored". For example, I access
doubles stored at X[0], X[1], X[2]... X[15], and in the middle of the
code I have the line
X[8] = X[0] - X[8]
After it computes X[0] - X[8], gcc decides that it shouldn't store that
value into X[8] -- instead, it stores it onto the stack, uses it from
there for a while, and then at the end it loads the value from the stack
and stores it into X[8].
The problem is that the gcse stage is done before the register-allocation
stage, and gcc doesn't have any feedback mechanism so it can't say "hey,
stop looking for common subexpressions, I don't have space to store all
of them". (Yes, they know about this problem.)
Colin Percival
- Next message: Mack: "Re: simple shell script to produce randomness from soundcard on linux"
- Previous message: Andrew Swallow: "Re: Sometimes Terrorists can be Unimaginative"
- In reply to: Grumble: "Re: TomsFastMath speeds"
- Next in thread: Tom St Denis: "Re: TomsFastMath speeds"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|