[fpc-devel] Data alignment feature

J. Gareth Moreton gareth at moreton-family.com
Wed Jan 24 02:46:57 CET 2018


Oh right.  I see that you've opted to stick with the $codealign compiler directive.  True, no new feature 
should be required, and TM128 shouldn't need to be redeclared by a third-party programmer.

In this case, I think this bug/feature report can be closed now: https://bugs.freepascal.org/view.php?
id=32780 - unless you want the 'align' suffix.

Gareth aka. Kit.



On Mon 22/01/18 21:07 , Florian Klämpfl florian at freepascal.org sent:
> Am 19.01.2018 um 21:08 schrieb J. Gareth Moreton:
> 
> > Hi everyone,
> 
> > 
> 
> > So unless anyone has any objections, I would
> like to start experimenting to implement a feature that allows 
> > for per-type data alignment.  The main purpose
> for this is to better support x86-64 SIMD extensions, where 
> > aligned data is far faster to process.  While
> there is a compiler directive that enforces byte alignment, 
> > this risks causing conflicts with third party
> units and is a bit much of a demand for a programmer wishing 
> > to use an SIMD-tuned unit, say.
> 
> > 
> 
> > Bug/feature details: https://bugs.freepascal.org/view.php?id=32780
> > 
> 
> > The format would be as follows:
> 
> > 
> 
> > type TypeName = TypeInfo [align ByteAmount];
> 
> > 
> 
> > The syntax for declaring a type is exactly the
> same, with a new optional "align" keyword before the 
> > terminating semicolon. "ByteAmount"
> has to be a power of 2, which I will probably limit to 128 currently, 
> > just so it doesn't cause ridiculous or malicious
> memory usage.  There will probably have to be a minimum 
> > alignment as well, although this will probably
> just be automatically enforced (e.g. Single is always aligned 
> > on a 4-byte boundary minimum).
> 
> > 
> 
> > The intention here is that this feature will be
> a stepping stone for properly supporting vectorisation, 
> > implementing some form of the "M128"
> and "M256" types, and the "vectorcall" compiler
> directive for Windows.
> 
> 
> In r38020 I committed a fix and an example tm128 how these records
> (m128/m256) can be implemented
> properly without any additional suffix. Please give it a try.
> 
> _______________________________________________
> 
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> 
> 
> 
> 



More information about the fpc-devel mailing list