[fpc-devel] Rules about record types and internal storage
J. Gareth Moreton
gareth at moreton-family.com
Thu Apr 2 21:25:17 CEST 2020
Am I right in thinking that, for C alignment, each field is aligned
according to its data size? For example, if you had:
TType = record
Are there are three unused bytes between Field1 and Field2 and the
structure as a whole is 8 bytes long and aligned to a 4-byte boundary?
I'm trying to find the page that explains all that, and also exceptional
cases where the data size is not necessary the same as the minimum
Gareth aka. Kit
On 02/04/2020 16:10, Sven Barth via fpc-devel wrote:
> J. Gareth Moreton <gareth at moreton-family.com
> <mailto:gareth at moreton-family.com>> schrieb am Do., 2. Apr. 2020, 15:25:
> For standard record types (no "packed" modifier or compiler
> or anything), I'm wondering how many liberties that the compiler is
> allowed to take in storing its data. Take the following example
> raybench.pas over here: http://runtimeterror.com/tools/raybench ):
> With no explicit packing specified the compiler in general follows the
> platform's C compiler for compatibility reasons.
> P.S. Of course you can force it by forcing the vector to be an
> m128 type
> and specifying vectorcall for x86_64-win64, but not everyone will
> to do that and it gets unwieldly rather quickly. Speaking of
> vectorcall, I'm wondering if we can introduce 'fastcall' as an
> alias for
> 'ms_abi_default', mostly so if we follow Microsoft Visual C++'s
> of automatically making all routines vectorcall (which is closer
> to the
> System V ABI used by linux and will make vectorisation easier), we
> force the default one if we need a routine that, say, has to
> with a third-party library ('fastcall' under win32 is what the MS
> ABI is
> based off... first parameter in ECX, second in EDX and everything
> on the stack).
> Please provide a source for your statement that MSVC uses vectorcall
> by default. Cause I highly doubt that as Microsoft is huge on
> backwards compatibility especially regarding the lower level stuff.
> fpc-devel maillist - fpc-devel at lists.freepascal.org
This email has been checked for viruses by Avast antivirus software.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-devel