[PATCH] D115441: [X86][MS] Add 80bit long double support for Windows

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 10:01:43 PST 2021


rnk added a comment.

In D115441#3188526 <https://reviews.llvm.org/D115441#3188526>, @mstorsjo wrote:

> In D115441#3188172 <https://reviews.llvm.org/D115441#3188172>, @pengfei wrote:
>
>>> In GCC on Windows (and clang in mingw mode), long double is always 80 bit on x86. (On i386, sizeof(long double) == 12, while on x86_64 it's 16.)
>>
>> How about the alignment? I can see on the i386 Linux case, the alignment is 4, I assume it is also 4 for GCC on Windows, right?
>
> Yes, it's 4 for i386 in GCC on Windows too (and Clang in mingw mode). For x86_64, both sizeof and alignof are 16.

Yeah, the alignment is the key thing which is generating a lot of the MSVC-specific complexity.

I have a thought. Why do you need to change the LLVM data layout at all? Clang's record layout is distinct from LLVM's data layout. This is similar to how `-malign-double` works, which does not affect LLVM's data layout, it is entirely a frontend change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115441/new/

https://reviews.llvm.org/D115441



More information about the llvm-commits mailing list