Index: clang/lib/Basic/Targets/PPC.cpp =================================================================== --- clang/lib/Basic/Targets/PPC.cpp +++ clang/lib/Basic/Targets/PPC.cpp @@ -318,8 +318,10 @@ .Case("pwr8", true) .Default(false); Features["float128"] = llvm::StringSwitch(CPU) - .Case("pwr9", true) - .Default(false); + .Case("ppc64le", true) + .Case("pwr9", true) + .Case("pwr8", true) + .Default(false); Features["spe"] = llvm::StringSwitch(CPU) .Case("8548", true) @@ -343,9 +345,10 @@ if (!ppcUserFeaturesCheck(Diags, FeaturesVec)) return false; - if (!(ArchDefs & ArchDefinePwr9) && (ArchDefs & ArchDefinePpcgr) && + if (!(ArchDefs & (ArchDefinePwr9 | ArchDefinePwr8)) && + (ArchDefs & ArchDefinePpcgr) && llvm::find(FeaturesVec, "+float128") != FeaturesVec.end()) { - // We have __float128 on PPC but not power 9 and above. + // We have __float128 on PPC but not power 8 and above. Diags.Report(diag::err_opt_not_valid_with_opt) << "-mfloat128" << CPU; return false; } Index: clang/test/Driver/ppc-f128-support-check.c =================================================================== --- clang/test/Driver/ppc-f128-support-check.c +++ clang/test/Driver/ppc-f128-support-check.c @@ -2,13 +2,15 @@ // RUN: -mcpu=pwr9 %s 2>&1 | FileCheck %s --check-prefix=HASF128 // RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \ // RUN: -mcpu=power9 %s 2>&1 | FileCheck %s --check-prefix=HASF128 - // RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \ -// RUN: -mcpu=pwr8 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128 +// RUN: -mcpu=pwr8 %s 2>&1 | FileCheck %s --check-prefix=HASF128 // RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \ -// RUN: -mcpu=pwr7 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128 +// RUN: -mcpu=power8 %s 2>&1 | FileCheck %s --check-prefix=HASF128 // RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \ -// RUN: -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128 +// RUN: %s 2>&1 | FileCheck %s --check-prefix=HASF128 + +// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \ +// RUN: -mcpu=pwr7 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=NOF128 #ifdef __FLOAT128__ static_assert(false, "__float128 enabled");