Mail Archives: djgpp-workers/1999/07/02/09:23:40
Bill Currie wrote:
> salvador wrote:
> > Can we tell Gas to use "int 3" (or other trap) when pading between functions?
> > (and any other place where the code should never be executed).
>
> so long as it's only for text areas that are never meant to be
> executed. You wouldn't want loop padding to do a debug trap. 'Twould
> kinda slow things down:)
Of course.
> > > Intel manuals seem to recommend 16-byte alignment, both for code and
> > > for data.
> >
> > And that's normally the best. MSVC uses 16 and 32 (based on some strange
> > criteria).
>
> Isn't 32 bytes the size of a cache line on 486+?
Yes, most processors uses 32, but that's also a waste if you routine is around 32
bytes and you pad it with 60 bytes ;-) (30+30).
32 bytes is too much and you start losing from other things. I don't know how MSVC
determines when 32 bytes is good idea or not, perhaps is related to the size of the
functions. BTW MSVC also exploits "proximity" by moving functions closer to the
caller (mostly small static ones, that's usually better than inlining if the function
have more than a couple of lines).
> > But looks like the most sensitive stuff is the entry point of functions, not the
> > align of loops or jumps.
>
> Nope, any destination: functions, loops and jumps are all equally
> important.
Not for K6 and not for Pentium MMX, I tried it. In fact MSVC do *not* align jumps or
loops. In K6 processors it could be even worst (if a loop is in a xxxxxC memory
address works slowly), in Pentium MMX de difference is very small.
I think aligning jumps and loops is only good idea for big functions, small functions
could need more cache lines if you add bytes inside.
Currently I think MSVC have better ideas than gcc because generates faster code.
Take a look to my compila.html page.
I think Gas should have conditional aligment instructions, like: "align it if all the
references are at 64 or more bytes of distance"
SET
--
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Visit my home page: http://welcome.to/SetSoft or
http://www.geocities.com/SiliconValley/Vista/6552/
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
set AT ieee DOT org set-soft AT bigfoot DOT com
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA Phone: +(5411) 4759 0013
- Raw text -