================
@@ -167,11 +167,19 @@ class LLVM_LIBRARY_VISIBILITY SparcV8TargetInfo : public
SparcTargetInfo {
break;
}
- // The SPARCv8 System V ABI has long double 128-bits in size, but 64-bit
- // aligned.
- LongDoubleWidth = 128;
- LongDoubleAlign = 64;
- LongDoubleFormat = &llvm::APFloat::IEEEquad();
+ // Bare-metal and RTEMS targets default to 64-bit long double, matching
+ // GCC. Other targets use 128-bit per the SPARCv8 System V ABI, with
+ // 64-bit alignment.
+ if (getTriple().getOS() == llvm::Triple::UnknownOS ||
+ getTriple().getOS() == llvm::Triple::RTEMS) {
+ LongDoubleWidth = 64;
+ LongDoubleAlign = 64;
+ LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+ } else {
+ LongDoubleWidth = 128;
+ LongDoubleAlign = 64;
+ LongDoubleFormat = &llvm::APFloat::IEEEquad();
+ }
----------------
folkertdev wrote:
I think this should be configured here instead
https://github.com/llvm/llvm-project/blob/f6b3f9399e98ef8b79388176e94c910d67669e1f/llvm/lib/TargetParser/Triple.cpp#L2541-L2597
https://github.com/llvm/llvm-project/pull/222304
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits