[fpc-pascal]Another Intel ASM problem

Peter Vreman peter at freepascal.org
Wed Jun 27 15:11:31 CEST 2001


> Yes I know that directives are used to change configuration, for example by
> setting {$BALIGN 8} compiler should add ".balign 8" in before every
> procedure code...

But what about alignment of jumps and loops? A more generic

{$ALIGNCODE PROCEDURE=8}
{$ALIGNCODE LOOP=4}
{$ALIGNCODE JUMP=4}

is more generic and extendable


> I never used this in TASM or in Delphi, I just found it in FPC sources
> inside AT&T assembler and found that 8 byte aligned code really speeds-up
> the execution so I want to use it in my libraries...
> 
> Another idea is to add new optimization switch which adds this to every
> procedure and main code...
> 
> But hey, it's you who will decide to put it and which way :-))) This is just
> my idea about this, because it's much easier to use it as FPC feature
> instead of rewriting 80000 lines of code to AT&T assembler :)

I think that the simple word ALIGN should be enough:

    mov eax,1
ALIGN 4
    @1:
    inc eax
    loop @1

This is readable and i think it won't clash with other things.

Anybody other opinions?

Btw. this will be added only in the 1.1 development version







More information about the fpc-pascal mailing list