[fpc-devel] Alignment question

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Nov 19 13:15:00 CET 2011


On 19 Nov 2011, at 14:04, Sergei Gorelkin wrote:

> Hm, that looks like two separate tasks: one is distinct vector type for ABIs, another one is alignment of arbitrary types. The issue I've stumbled into is the TContext record (CPU context), which contains only word and qword members, but has to be 16 byte aligned because it is used by SSE instructions. In SDK it has a __declspec(align(16)) attribute, I guess we need something like that too.

You could emulate this with a variant record containing a vector element, but a modifier or directive would be of course be more convenient (and easier to implement). To avoid having to add alignment information to all symbols, I would limit this functionality to recorddefs and objectdefs though (there we already keep track of the alignment requirements via the tabstractrecordsymtable(symtable).recordalignment field).


Jonas


More information about the fpc-devel mailing list