This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Memory layout (novice questions).


Virgil Palanciuc wrote :
>    I don't want to do this. What I want is to implement some kind of
> optimization. As you all know, on some (most, I think) machines you can do
> loads like
>     load REGx, [SP+ xxxx]
> where xxxx is an immediate value (usually a short one - on the architecture
> I am working on, I only have 5 bits available). These kind of instructions
> are used intensively to load/store local variables to/from registers.
> Of course I would like to have as much variables as possible available at
> short offsets from SP, and thus placing the shorter ones in front seems to
> be a good idea. So what I actually want to do is sort the variables by size.

Actually what you really want is to minimize the total access time (for
time-optimization) or the total instruction size (for space-optimization)
thus involving a dynamic or static access count for each stack-variable.

Philippe

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]