[PowerPC] [Clang] Enable float128 feature on P9 by default

As Power9 introduced hardware support for IEEE quad-precision FP type,
the feature should be enabled by default on Power9 or newer targets.

Reviewed By: steven.zhang

Differential Revision: https://reviews.llvm.org/D90213
This commit is contained in:
Qiu Chaofan 2020-12-07 18:31:00 +08:00
parent 67dbc8195d
commit 6bf29dbb15
2 changed files with 5 additions and 2 deletions

View File

@ -317,6 +317,9 @@ bool PPCTargetInfo::initFeatureMap(
.Case("pwr9", true)
.Case("pwr8", true)
.Default(false);
Features["float128"] = llvm::StringSwitch<bool>(CPU)
.Case("pwr9", true)
.Default(false);
Features["spe"] = llvm::StringSwitch<bool>(CPU)
.Case("8548", true)

View File

@ -1,7 +1,7 @@
// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
// RUN: -mcpu=pwr9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
// RUN: -mcpu=pwr9 %s 2>&1 | FileCheck %s --check-prefix=HASF128
// RUN: not %clang -target powerpc64le-unknown-linux-gnu -fsyntax-only \
// RUN: -mcpu=power9 -mfloat128 %s 2>&1 | FileCheck %s --check-prefix=HASF128
// 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