On 16 mei 2006, at 10:35, Пётр Косаревский wrote:

1. I think, that when you optimize for size, default options should be "avoid alignment when possible". 2. SSE2 is a special case and, by the way, will FPC support integer SSE2 operations? (Current mmx unit is not widely used, so Florian K. said it is low priority.)

Compile this with "-OG" and notice, that while record has size 9, individual variables of that type are aligned by 16-byte. (FPC 2.0.3, i386, win32) And it does not depend on processor model: -Cp386 and -CpPENTIUM4 yield the same results.

Record packing is separate from optimization or target processors, because otherwise this would be too confusing (e.g. you'd have problems if you want to share memory or files between programs compiled with different optimization modes or for a different processor). In other compilers (both Pascal and C), record packing/ alignment is also completely separate from optimization switches.

If you want a particular alignment mode other than the default, use {$packrecords x}


Jonas_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to