[LLVMdev] x86_fp80, f80, and -m96bit-long-double

Duncan Sands baldrick at free.fr
Tue Nov 2 01:14:40 PDT 2010


Hi Chris,

>>> I think the "fact" that x86 long double is 16 byte aligned on x86-64 is
>>> hard-wired in.
>>
>> Note that it's not just about alignment, but mainly about the reserved storage size.
>>
>>> I'm not sure how hard this would be to control via a
>>> command line option (i.e. -m96bit-long-double).
>>
>> Is there no different way to go about this? Our compiler currently supports the x87 long double type as
>> a) 10 bytes, for Turbo Pascal and Delphi-compatibility
>> b) 12 bytes, for non-Darwin ABI/C x86 compatibility
>> c) 16 bytes, for Darwin x86 ABI/C and x86_64 ABI/C compatibility
>>
>> long doubles of type a) and c), or of type b) and c), can occur in the same compilation unit. A command line switch does not offer sufficient flexibility in this case.
>
> The right fix for this is to find the assumptions in the code generator and fix them.

since storing a long double always writes only 10 bytes, I think it is easy
enough for Jonas to get the effect he wants by allocating some other type
which has his desired size, and bitcasting pointers to get a (long double)*
which he can use to read/write.

Ciao,

Duncan.



More information about the llvm-dev mailing list