Skip to content

Commit 09cca09

Browse files
committed
AMDGPU: Update for changed subtarget feature name
llvm-svn: 292838
1 parent a6867fd commit 09cca09

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clang/lib/Basic/Targets.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,15 +2113,15 @@ class AMDGPUTargetInfo final : public TargetInfo {
21132113
for (auto &I : TargetOpts.FeaturesAsWritten) {
21142114
if (I == "+fp32-denormals" || I == "-fp32-denormals")
21152115
hasFP32Denormals = true;
2116-
if (I == "+fp64-denormals" || I == "-fp64-denormals")
2116+
if (I == "+fp64-fp16-denormals" || I == "-fp64-fp16-denormals")
21172117
hasFP64Denormals = true;
21182118
}
21192119
if (!hasFP32Denormals)
21202120
TargetOpts.Features.push_back((Twine(hasFullSpeedFP32Denorms &&
21212121
!CGOpts.FlushDenorm ? '+' : '-') + Twine("fp32-denormals")).str());
2122-
// Always do not flush fp64 denorms.
2122+
// Always do not flush fp64 or fp16 denorms.
21232123
if (!hasFP64Denormals && hasFP64)
2124-
TargetOpts.Features.push_back("+fp64-denormals");
2124+
TargetOpts.Features.push_back("+fp64-fp16-denormals");
21252125
}
21262126

21272127
ArrayRef<Builtin::Info> getTargetBuiltins() const override {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// RUN: %clang_cc1 -S -cl-denorms-are-zero -o - %s 2>&1
22
// RUN: %clang_cc1 -emit-llvm -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s
33
// RUN: %clang_cc1 -emit-llvm -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck %s --check-prefix=CHECK-DENORM
4-
// RUN: %clang_cc1 -emit-llvm -target-feature +fp32-denormals -target-feature -fp64-denormals -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck --check-prefix=CHECK-FEATURE %s
4+
// RUN: %clang_cc1 -emit-llvm -target-feature +fp32-denormals -target-feature -fp64-fp16-denormals -cl-denorms-are-zero -o - -triple amdgcn--amdhsa -target-cpu fiji %s | FileCheck --check-prefix=CHECK-FEATURE %s
55

66
// For non-amdgcn targets, this test just checks that the -cl-denorms-are-zero argument is accepted
77
// by clang. This option is currently a no-op, which is allowed by the
88
// OpenCL specification.
99

1010
// For amdgcn target cpu fiji, fp32 should be flushed since fiji does not support fp32 denormals, unless +fp32-denormals is
11-
// explicitly set. amdgcn target always do not flush fp64 denormals.
11+
// explicitly set. amdgcn target always do not flush fp64 denormals. The control for fp64 and fp16 denormals is the same.
1212

1313
// CHECK-DENORM-LABEL: define void @f()
14-
// CHECK-DENORM: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
14+
// CHECK-DENORM: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-fp16-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
1515
// CHECK-LABEL: define void @f()
16-
// CHECK: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
16+
// CHECK: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp64-fp16-denormals,{{[^"]*}}-fp32-denormals{{[^"]*}}"
1717
// CHECK-FEATURE-LABEL: define void @f()
18-
// CHECK-FEATURE: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp32-denormals,{{[^"]*}}-fp64-denormals{{[^"]*}}"
18+
// CHECK-FEATURE: attributes #{{[0-9]*}} = {{{[^}]*}} "target-features"="{{[^"]*}}+fp32-denormals,{{[^"]*}}-fp64-fp16-denormals{{[^"]*}}"
1919
void f() {}

0 commit comments

Comments
 (0)