File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -683,9 +683,13 @@ void registerPredefinedTargetVersions() {
683683 if (triple.getOS () == llvm::Triple::Linux) {
684684 VersionCondition::addPredefinedGlobalIdent (
685685 triple.getArch () == llvm::Triple::ppc64 ? " ELFv1" : " ELFv2" );
686- if (opts::mABI == " ieeelongdouble" && triple.isOSGlibc ()) {
687- // Only GLibc needs this for IEEELongDouble
688- VersionCondition::addPredefinedGlobalIdent (" D_PPCUseIEEE128" );
686+ if (opts::mABI == " ieeelongdouble" ) {
687+ if (triple.getEnvironment () == llvm::Triple::GNU) {
688+ // Only GLibc needs this for IEEELongDouble
689+ VersionCondition::addPredefinedGlobalIdent (" D_PPCUseIEEE128" );
690+ } else {
691+ warning (Loc (), " float ABI 'ieeelongdouble' is not supported by the target system" );
692+ }
689693 }
690694 }
691695 break ;
Original file line number Diff line number Diff line change @@ -266,10 +266,16 @@ const char *TargetCPP::typeMangle(Type *t) {
266266 triple.getArch () == llvm::Triple::x86_64;
267267 if (triple.getArch () == llvm::Triple::ppc64 ||
268268 triple.getArch () == llvm::Triple::ppc64le) {
269- if (opts::mABI == " ieeelongdouble" ) {
269+ if (opts::mABI == " ieeelongdouble" &&
270+ triple.getEnvironment () == llvm::Triple::GNU) {
270271 return " u9__ieee128" ;
271272 }
272- return " g" ;
273+ if (size (t) == 16 ) {
274+ // IBM long double
275+ return " g" ;
276+ }
277+ // fall back to 64-bit double type
278+ return " e" ;
273279 }
274280 return isAndroidX64 ? " g" : " e" ;
275281 }
You can’t perform that action at this time.
0 commit comments