[clang] [llvm] [SPARC] Align i128 to 16 bytes in SPARC datalayouts (PR #106951)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 5 14:30:02 PST 2025


================
@@ -151,7 +151,7 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public SparcTargetInfo {
 public:
   SparcV8TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
       : SparcTargetInfo(Triple, Opts) {
-    resetDataLayout("E-m:e-p:32:32-i64:64-f128:64-n32-S64");
+    resetDataLayout("E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64");
----------------
koachan wrote:

Yes, it is. IIRC the bug report is in the context of Rust which doesn't target 32-bit SPARCs, but the mismatch exists for it as well, with clang frontend [reusing the default int128 alignment of 128 bits](https://github.com/llvm/llvm-project/blob/da61b0ddc5dcc8f1ac64eaddabdbfec5aa23f22b/clang/lib/Basic/TargetInfo.cpp#L77).

I do think that for 32-bit SPARC the value is probably debatable given that it's unspecified in the ABI docs and neither GCC nor clang would actually compile int128 code for it (so there's no de facto standard either), but at that moment what I had in mind is to at least sync the clang and LLVM values, hence the change.

https://github.com/llvm/llvm-project/pull/106951


More information about the cfe-commits mailing list