Mail Archives: djgpp/1999/11/03/23:06:40
stefan fröberg wrote:
> Which of the following assembling methods gives the fastest graphic code
> possible ?
> - Using NASM (yiepee !).
> - Using GAS (oh no !)
> - Using inline AT&T (aaarghh !)
The big differences in speed result from how well you design and
code your routines, not from which assembler you select.
If your routines rapidly alternate short ASM sequences with short
C sequences, then the overhead of the call/ret for NASM or GAS
would eliminate any savings from coding in ASM, so the only
reasonble choice would be inline.
If you can execute many interations of the ASM code before
returning to C code, then the call/ret overhead won't matter
as much.
GAS will often select a shorter encoding of an instruction
than the default encoding selected by NASM. If you let NASM
select longer encodings that may result in some extra cache
misses and slow the code down some. If you really care about
that and don't want to use GAS, you can just review your
ASM source by hand and insert "BYTE" and "SHORT" overrides
wherever they are appropriate to get the same short encodings
GAS would have selected.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -