r245459 - According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 19 11:29:41 PDT 2015


On Wed, Aug 19, 2015 at 10:02 AM, Yaron Keren via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: yrnkrn
> Date: Wed Aug 19 12:02:32 2015
> New Revision: 245459
>
> URL: http://llvm.org/viewvc/llvm-project?rev=245459&view=rev
> Log:
> According to i686 ABI, long double size on x86 is 12 bytes not 16 bytes.
> See
>  https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/i386-and-x86-64-Options.html
>
>
> Added:
>     cfe/trunk/test/CodeGen/mingw-long-double-size.c
> Modified:
>     cfe/trunk/lib/Basic/Targets.cpp
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=245459&r1=245458&r2=245459&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Wed Aug 19 12:02:32 2015
> @@ -3785,7 +3785,8 @@ class MinGWX86_32TargetInfo : public Win
>  public:
>    MinGWX86_32TargetInfo(const llvm::Triple &Triple)
>        : WindowsX86_32TargetInfo(Triple) {
> -    LongDoubleWidth = LongDoubleAlign = 128;
> +    LongDoubleWidth = 96;
> +    LongDoubleAlign = 128;
>

Is this really correct? It's deeply suspicious that the size is not a
multiple of the alignment.


>      LongDoubleFormat = &llvm::APFloat::x87DoubleExtended;
>    }
>    void getTargetDefines(const LangOptions &Opts,
>
> Added: cfe/trunk/test/CodeGen/mingw-long-double-size.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/mingw-long-double-size.c?rev=245459&view=auto
>
> ==============================================================================
> --- cfe/trunk/test/CodeGen/mingw-long-double-size.c (added)
> +++ cfe/trunk/test/CodeGen/mingw-long-double-size.c Wed Aug 19 12:02:32
> 2015
> @@ -0,0 +1,5 @@
> +// RUN: %clang_cc1 -triple i686-pc-windows-gnu -S %s  -o - | FileCheck %s
> -check-prefix=CHECK_I686
> +// CHECK_I686: lda,12
> +// RUN: %clang_cc1 -triple x86_64-pc-windows-gnu -S %s  -o - | FileCheck
> %s -check-prefix=CHECK_X86_64
> +// CHECK_X86_64: lda,16
> +long double lda;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150819/9bc05c78/attachment.html>


More information about the cfe-commits mailing list