Porting over SSE code from delphi to freepascal I expected the rec_something.sse_data to be offset by 16byte from start of record:
type
rec_sse=record
sse1,sse2,sse3,sse4:single;
end;
{$align 16}{$packrecords 16}
type
rec_something=record
actual_data:longint;
sse_data:rec_sse;
end;
since in delphi the sse_data field would have an offset of 16 in the rec_something record, but it appears to work differently in free pascal as confirmed by
http://bugs.freepascal.org/view.php?id=27480 so instead have to do something like:
type
rec_something=record
actual_data:longint;
padding_data1,padding_data2,padding_data3:longint;
sse_data:rec_sse;
end;
While this works I'm wondering if anyone has a cleaner solution to suggest (without reordering the sse_data field to be first in record) since this will be quite a bit harder to maintain.