Skip to content

[Clang][Wasm] Set __float128 alignment to 64 for emscripten #146494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/lib/Basic/Targets/OSTargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ class LLVM_LIBRARY_VISIBILITY EmscriptenTargetInfo
// Emscripten's ABI is unstable and we may change this back to 128 to match
// the WebAssembly default in the future.
this->LongDoubleAlign = 64;
this->Float128Align = 64;
}
};

Expand Down
3 changes: 1 addition & 2 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading