From 18f7655178a69daa52f4d4ef56169b90efc7f601 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 8 Jul 2025 10:20:43 +0200 Subject: [Clang][Wasm] Set __float128 alignment to 64 for emscripten (#146494) https://reviews.llvm.org/D104808 set the alignment of long double to 64 bits. This is also the alignment specified in the LLVM data layout. However, the alignment of __float128 was left at 128 bits. I assume that this was just an oversight, rather than an intentional divergence. The C ABI document currently does not make any statement about `__float128`: https://github.com/WebAssembly/tool-conventions/blob/main/BasicCABI.md --- clang/lib/CodeGen/CodeGenModule.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index e6d150f..c8866f1 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -388,8 +388,7 @@ static void checkDataLayoutConsistency(const TargetInfo &Target, llvm::Type::getFloatingPointTy(Context, *Target.LongDoubleFormat), Target.LongDoubleAlign); } - // FIXME: Wasm has a mismatch in f128 alignment between Clang and LLVM. - if (Target.hasFloat128Type() && !Triple.isWasm()) + if (Target.hasFloat128Type()) Check("__float128", llvm::Type::getFP128Ty(Context), Target.Float128Align); if (Target.hasIbm128Type()) Check("__ibm128", llvm::Type::getPPC_FP128Ty(Context), Target.Ibm128Align); -- cgit v1.1