Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-08

(no subject)

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ростислав Окулов

How I can aligh data in FPC like in C?

struct __declspec(align(16)) VECTOR4F
{
    float x;
    float y;
    float z;
    float w;
};

Reply by email

Florian Klaempfl
to Ростислав Окулов
Ростислав Окулов wrote 9 lines
How I can aligh data in FPC like in C? struct __declspec(align(16)) VECTOR4F { float x; float y; float z; float w; };

FPC can align local data only up to 4 byte boundaries. Aligning to 16 byte boundaries done by the compiler requires too much extra code because at every procedure entry the stack must be realigned so causing often a slow down.

Reply by email

Jan Ruzicka
to Florian Klaempfl

Hi Rostya and Florian

Is there a way to align code? (specially in loops.) A Profiler is complaining about an unaligned loop. It gives following suggestion:
"... With gcc, use the -falign-loops=16 compiler flag (broken in gcc 3.1; gcc 3.3 or later should be used)."
I am using Shark on OSX 10.3.9 .

Is there any way to pass parameters to an assembler and/or linker ?

Jan

Florian Klaempfl wrote 22 lines
Ростислав Окулов wrote: > How I can aligh data in FPC like in C? > > struct __declspec(align(16)) VECTOR4F > { > float x; > float y; > float z; > float w; > }; FPC can align local data only up to 4 byte boundaries. Aligning to 16 byte boundaries done by the compiler requires too much extra code because at every procedure entry the stack must be realigned so causing often a slow down. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Florian Klaempfl
to Jan Ruzicka
Jan Ruzicka wrote 7 lines
Hi Rostya and Florian Is there a way to align code? (specially in loops.) A Profiler is complaining about an unaligned loop. It gives following suggestion: "... With gcc, use the -falign-loops=16 compiler flag (broken in gcc 3.1; gcc 3.3 or later should be used)."

You can use -OaLOOP=16 with fpc. However, at least on my machines (mostly AMDs) I never saw an effect of this except in very synthetic benchmarks compared with the standard value 4.

I am using Shark on OSX 10.3.9 . Is there any way to pass parameters to an assembler and/or linker ?

Assembler: no
Linker: -k

Show quoted text 33 lines
Jan On Aug 12, 2005, at 03:39, Florian Klaempfl wrote: > Ростислав Окулов wrote: > >> How I can aligh data in FPC like in C? >> >> struct __declspec(align(16)) VECTOR4F >> { >> float x; >> float y; >> float z; >> float w; >> }; > > > FPC can align local data only up to 4 byte boundaries. Aligning to 16 > byte > boundaries done by the compiler requires too much extra code because > at every > procedure entry the stack must be realigned so causing often a slow down. > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email