Skip to content

Commit 762f1b1

Browse files
authored
[HLSL] Make fast math the default for HLSL (#119820)
Make fast math the default for HLSL Repair test cases broken by this change. Closes #108597
1 parent a429dfc commit 762f1b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+821
-821
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<
22852285
NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
22862286
MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Default">;
22872287
defm fast_math : BoolFOption<"fast-math",
2288-
LangOpts<"FastMath">, DefaultFalse,
2288+
LangOpts<"FastMath">, Default<hlsl.KeyPath>,
22892289
PosFlag<SetTrue, [], [ClangOption, CC1Option, FC1Option, FlangOption],
22902290
"Allow aggressive, lossy floating-point optimizations",
22912291
[cl_fast_relaxed_math.KeyPath]>,

clang/test/CodeGenHLSL/ArrayTemporary.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ void template_call(float FA2[2], float FA4[4], int IA3[3]) {
9090

9191
// CHECK: [[Addr:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 0
9292
// CHECK: [[Tmp:%.*]] = load float, ptr [[Addr]]
93-
// CHECK: call void @_Z11template_fnIfEvT_(float noundef [[Tmp]])
93+
// CHECK: call void @_Z11template_fnIfEvT_(float noundef nofpclass(nan inf) [[Tmp]])
9494

9595
// CHECK: [[Idx0:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 0
9696
// CHECK: [[Val0:%.*]] = load float, ptr [[Idx0]]
97-
// CHECK: [[Sum:%.*]] = fadd float [[Val0]], 5.000000e+00
97+
// CHECK: [[Sum:%.*]] = fadd reassoc nnan ninf nsz arcp afn float [[Val0]], 5.000000e+00
9898
// CHECK: [[Idx1:%.*]] = getelementptr inbounds [2 x float], ptr [[FA2]], i32 0, i32 1
9999
// CHECK: store float [[Sum]], ptr [[Idx1]]
100100

clang/test/CodeGenHLSL/BasicFeatures/OutputArguments.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// CHECK: define void {{.*}}trunc_Param{{.*}}(ptr noalias noundef nonnull align 4 dereferenceable(4) {{%.*}})
1010
void trunc_Param(inout int X) {}
1111

12-
// ALL-LABEL: define noundef float {{.*}}case1
12+
// ALL-LABEL: define noundef nofpclass(nan inf) float {{.*}}case1
1313
// CHECK: [[F:%.*]] = alloca float
1414
// CHECK: [[ArgTmp:%.*]] = alloca i32
1515
// CHECK: [[FVal:%.*]] = load float, ptr {{.*}}
@@ -197,7 +197,7 @@ export int case7() {
197197
// CHECK: define void {{.*}}trunc_vec{{.*}}(ptr noalias noundef nonnull align 16 dereferenceable(16) {{%.*}})
198198
void trunc_vec(inout int3 V) {}
199199

200-
// ALL-LABEL: define noundef <3 x float> {{.*}}case8
200+
// ALL-LABEL: define noundef nofpclass(nan inf) <3 x float> {{.*}}case8
201201

202202
// CHECK: [[V:%.*]] = alloca <3 x float>
203203
// CHECK: [[Tmp:%.*]] = alloca <3 x i32>

clang/test/CodeGenHLSL/BasicFeatures/standard_conversion_sequences.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// CHECK: store <3 x float> splat (float 1.000000e+00), ptr [[f3]]
77
// CHECK: [[vecf3:%.*]] = load <3 x float>, ptr [[f3]]
88
// CHECK: [[vecf4:%.*]] = shufflevector <3 x float> [[vecf3]], <3 x float> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 0>
9-
// CHECK: [[vecd4:%.*]] = fpext <4 x float> [[vecf4]] to <4 x double>
9+
// CHECK: [[vecd4:%.*]] = fpext reassoc nnan ninf nsz arcp afn <4 x float> [[vecf4]] to <4 x double>
1010
// CHECK: store <4 x double> [[vecd4]], ptr [[d4]]
1111
void f3_to_d4() {
1212
vector<float,3> f3 = 1.0;
@@ -30,7 +30,7 @@ void f3_to_f2() {
3030
// CHECK: [[f2:%.*]] = alloca <2 x float>
3131
// CHECK: store <4 x double> splat (double 3.000000e+00), ptr [[d4]]
3232
// CHECK: [[vecd4:%.*]] = load <4 x double>, ptr [[d4]]
33-
// CHECK: [[vecf4:%.*]] = fptrunc <4 x double> [[vecd4]] to <4 x float>
33+
// CHECK: [[vecf4:%.*]] = fptrunc reassoc nnan ninf nsz arcp afn <4 x double> [[vecd4]] to <4 x float>
3434
// CHECK: [[vecf2:%.*]] = shufflevector <4 x float> [[vecf4]], <4 x float> poison, <2 x i32> <i32 0, i32 1>
3535
// CHECK: store <2 x float> [[vecf2]], ptr [[f2]]
3636
void d4_to_f2() {
@@ -108,7 +108,7 @@ void i2_to_b2() {
108108
// CHECK: [[b2:%.*]] = alloca i8
109109
// CHECK: store <4 x double> splat (double 9.000000e+00), ptr [[d4]]
110110
// CHECK: [[vecd4:%.*]] = load <4 x double>, ptr [[d4]]
111-
// CHECK: [[vecb4:%.*]] = fcmp une <4 x double> [[vecd4]], zeroinitializer
111+
// CHECK: [[vecb4:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x double> [[vecd4]], zeroinitializer
112112
// CHECK: [[vecd2:%.*]] = shufflevector <4 x i1> [[vecb4]], <4 x i1> poison, <2 x i32> <i32 0, i32 1>
113113
// CHECK: [[vecb8:%.*]] = shufflevector <2 x i1> [[vecd2]], <2 x i1> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
114114
// CHECK: [[i8:%.*]] = bitcast <8 x i1> [[vecb8]] to i8

clang/test/CodeGenHLSL/builtins/ScalarSwizzles.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ float2 HowManyFloats(float V) {
119119
// CHECK: store <1 x double> splat (double 1.000000e+00), ptr [[Tmp]], align 8
120120
// CHECK: [[vec1:%.*]] = load <1 x double>, ptr [[Tmp]], align 8
121121
// CHECK: [[vec3:%.*]] = shufflevector <1 x double> [[vec1]], <1 x double> poison, <3 x i32> zeroinitializer
122-
// CHECK: [[vec3f:%.*]] = fptrunc <3 x double> [[vec3]] to <3 x float>
122+
// CHECK: [[vec3f:%.*]] = fptrunc reassoc nnan ninf nsz arcp afn <3 x double> [[vec3]] to <3 x float>
123123
// CHECK: ret <3 x float> [[vec3f]]
124124

125125
float3 AllRighty() {

clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-lib.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export void TestAppend(float value) {
3333
ASB.Append(value);
3434
}
3535

36-
// CHECK: define void @_Z10TestAppendf(float noundef %value)
36+
// CHECK: define void @_Z10TestAppendf(float noundef nofpclass(nan inf) %value)
3737
// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %value.addr, align 4
3838
// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i8 1)
3939
// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %[[INDEX]])
@@ -43,7 +43,7 @@ export float TestConsume() {
4343
return CSB.Consume();
4444
}
4545

46-
// CHECK: define noundef float @_Z11TestConsumev()
46+
// CHECK: define noundef nofpclass(nan inf) float @_Z11TestConsumev()
4747
// CHECK-DXIL: %[[INDEX:.*]] = call i32 @llvm.dx.resource.updatecounter.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %1, i8 -1)
4848
// CHECK-DXIL: %[[RESPTR:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %0, i32 %[[INDEX]])
4949
// CHECK-DXIL: %[[VALUE:.*]] = load float, ptr %[[RESPTR]], align 4
@@ -53,7 +53,7 @@ export float TestLoad() {
5353
return RWSB1.Load(1) + SB1.Load(2);
5454
}
5555

56-
// CHECK: define noundef float @_Z8TestLoadv()
56+
// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
5757
// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_0t(target("dx.RawBuffer", float, 1, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})
5858
// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
5959
// CHECK: %[[PTR2:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_0_0t(target("dx.RawBuffer", float, 0, 0) %{{[0-9]+}}, i32 %{{[0-9]+}})

clang/test/CodeGenHLSL/builtins/StructuredBuffers-methods-ps.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export float TestLoad() {
2828
return ROSB1.Load(10);
2929
}
3030

31-
// CHECK: define noundef float @_Z8TestLoadv()
31+
// CHECK: define noundef nofpclass(nan inf) float @_Z8TestLoadv()
3232
// CHECK: %[[PTR1:.*]] = call ptr @llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer", float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
3333
// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
3434

clang/test/CodeGenHLSL/builtins/WaveReadLaneAt.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ int16_t test_int16(int16_t expr, uint idx) {
3838
// CHECK-LABEL: test_half
3939
half test_half(half expr, uint idx) {
4040
// CHECK-SPIRV: %[[#entry_tok2:]] = call token @llvm.experimental.convergence.entry()
41-
// CHECK-SPIRV: %[[RET:.*]] = call spir_func [[TY:.*]] @llvm.spv.wave.readlane.f16([[TY]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok2]]) ]
42-
// CHECK-DXIL: %[[RET:.*]] = call [[TY:.*]] @llvm.dx.wave.readlane.f16([[TY]] %[[#]], i32 %[[#]])
41+
// CHECK-SPIRV: %[[RET:.*]] = call reassoc nnan ninf nsz arcp afn spir_func [[TY:.*]] @llvm.spv.wave.readlane.f16([[TY]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok2]]) ]
42+
// CHECK-DXIL: %[[RET:.*]] = call reassoc nnan ninf nsz arcp afn [[TY:.*]] @llvm.dx.wave.readlane.f16([[TY]] %[[#]], i32 %[[#]])
4343
// CHECK: ret [[TY]] %[[RET]]
4444
return WaveReadLaneAt(expr, idx);
4545
}
@@ -50,8 +50,8 @@ half test_half(half expr, uint idx) {
5050
// CHECK-LABEL: test_double
5151
double test_double(double expr, uint idx) {
5252
// CHECK-SPIRV: %[[#entry_tok3:]] = call token @llvm.experimental.convergence.entry()
53-
// CHECK-SPIRV: %[[RET:.*]] = call spir_func [[TY:.*]] @llvm.spv.wave.readlane.f64([[TY]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok3]]) ]
54-
// CHECK-DXIL: %[[RET:.*]] = call [[TY:.*]] @llvm.dx.wave.readlane.f64([[TY]] %[[#]], i32 %[[#]])
53+
// CHECK-SPIRV: %[[RET:.*]] = call reassoc nnan ninf nsz arcp afn spir_func [[TY:.*]] @llvm.spv.wave.readlane.f64([[TY]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok3]]) ]
54+
// CHECK-DXIL: %[[RET:.*]] = call reassoc nnan ninf nsz arcp afn [[TY:.*]] @llvm.dx.wave.readlane.f64([[TY]] %[[#]], i32 %[[#]])
5555
// CHECK: ret [[TY]] %[[RET]]
5656
return WaveReadLaneAt(expr, idx);
5757
}
@@ -62,8 +62,8 @@ double test_double(double expr, uint idx) {
6262
// CHECK-LABEL: test_floatv4
6363
float4 test_floatv4(float4 expr, uint idx) {
6464
// CHECK-SPIRV: %[[#entry_tok4:]] = call token @llvm.experimental.convergence.entry()
65-
// CHECK-SPIRV: %[[RET1:.*]] = call spir_func [[TY1:.*]] @llvm.spv.wave.readlane.v4f32([[TY1]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok4]]) ]
66-
// CHECK-DXIL: %[[RET1:.*]] = call [[TY1:.*]] @llvm.dx.wave.readlane.v4f32([[TY1]] %[[#]], i32 %[[#]])
65+
// CHECK-SPIRV: %[[RET1:.*]] = call reassoc nnan ninf nsz arcp afn spir_func [[TY1:.*]] @llvm.spv.wave.readlane.v4f32([[TY1]] %[[#]], i32 %[[#]]) [ "convergencectrl"(token %[[#entry_tok4]]) ]
66+
// CHECK-DXIL: %[[RET1:.*]] = call reassoc nnan ninf nsz arcp afn [[TY1:.*]] @llvm.dx.wave.readlane.v4f32([[TY1]] %[[#]], i32 %[[#]])
6767
// CHECK: ret [[TY1]] %[[RET1]]
6868
return WaveReadLaneAt(expr, idx);
6969
}

clang/test/CodeGenHLSL/builtins/abs.hlsl

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@ int16_t3 test_abs_int16_t3(int16_t3 p0) { return abs(p0); }
2222
int16_t4 test_abs_int16_t4(int16_t4 p0) { return abs(p0); }
2323
#endif // __HLSL_ENABLE_16_BIT
2424

25-
// NATIVE_HALF-LABEL: define noundef half @_Z13test_abs_half
26-
// NATIVE_HALF: call half @llvm.fabs.f16(
27-
// NO_HALF-LABEL: define noundef float @_Z13test_abs_half
28-
// NO_HALF: call float @llvm.fabs.f32(float %0)
25+
// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) half @_Z13test_abs_half
26+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.fabs.f16(
27+
// NO_HALF-LABEL: define noundef nofpclass(nan inf) float @_Z13test_abs_half
28+
// NO_HALF: call reassoc nnan ninf nsz arcp afn float @llvm.fabs.f32(float %0)
2929
half test_abs_half(half p0) { return abs(p0); }
30-
// NATIVE_HALF-LABEL: define noundef <2 x half> @_Z14test_abs_half2
31-
// NATIVE_HALF: call <2 x half> @llvm.fabs.v2f16(
32-
// NO_HALF-LABEL: define noundef <2 x float> @_Z14test_abs_half2
33-
// NO_HALF: call <2 x float> @llvm.fabs.v2f32(
30+
// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <2 x half> @_Z14test_abs_half2
31+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.fabs.v2f16(
32+
// NO_HALF-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z14test_abs_half2
33+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.fabs.v2f32(
3434
half2 test_abs_half2(half2 p0) { return abs(p0); }
35-
// NATIVE_HALF-LABEL: define noundef <3 x half> @_Z14test_abs_half3
36-
// NATIVE_HALF: call <3 x half> @llvm.fabs.v3f16(
37-
// NO_HALF-LABEL: define noundef <3 x float> @_Z14test_abs_half3
38-
// NO_HALF: call <3 x float> @llvm.fabs.v3f32(
35+
// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <3 x half> @_Z14test_abs_half3
36+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.fabs.v3f16(
37+
// NO_HALF-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z14test_abs_half3
38+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.fabs.v3f32(
3939
half3 test_abs_half3(half3 p0) { return abs(p0); }
40-
// NATIVE_HALF-LABEL: define noundef <4 x half> @_Z14test_abs_half4
41-
// NATIVE_HALF: call <4 x half> @llvm.fabs.v4f16(
42-
// NO_HALF-LABEL: define noundef <4 x float> @_Z14test_abs_half4
43-
// NO_HALF: call <4 x float> @llvm.fabs.v4f32(
40+
// NATIVE_HALF-LABEL: define noundef nofpclass(nan inf) <4 x half> @_Z14test_abs_half4
41+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.fabs.v4f16(
42+
// NO_HALF-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z14test_abs_half4
43+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.fabs.v4f32(
4444
half4 test_abs_half4(half4 p0) { return abs(p0); }
4545

4646
// CHECK-LABEL: define noundef i32 @_Z12test_abs_int
@@ -56,17 +56,17 @@ int3 test_abs_int3(int3 p0) { return abs(p0); }
5656
// CHECK: call <4 x i32> @llvm.abs.v4i32(
5757
int4 test_abs_int4(int4 p0) { return abs(p0); }
5858

59-
// CHECK-LABEL: define noundef float @_Z14test_abs_float
60-
// CHECK: call float @llvm.fabs.f32(
59+
// CHECK-LABEL: define noundef nofpclass(nan inf) float @_Z14test_abs_float
60+
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.fabs.f32(
6161
float test_abs_float(float p0) { return abs(p0); }
62-
// CHECK-LABEL: define noundef <2 x float> @_Z15test_abs_float2
63-
// CHECK: call <2 x float> @llvm.fabs.v2f32(
62+
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x float> @_Z15test_abs_float2
63+
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.fabs.v2f32(
6464
float2 test_abs_float2(float2 p0) { return abs(p0); }
65-
// CHECK-LABEL: define noundef <3 x float> @_Z15test_abs_float3
66-
// CHECK: call <3 x float> @llvm.fabs.v3f32(
65+
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x float> @_Z15test_abs_float3
66+
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.fabs.v3f32(
6767
float3 test_abs_float3(float3 p0) { return abs(p0); }
68-
// CHECK-LABEL: define noundef <4 x float> @_Z15test_abs_float4
69-
// CHECK: call <4 x float> @llvm.fabs.v4f32(
68+
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x float> @_Z15test_abs_float4
69+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.fabs.v4f32(
7070
float4 test_abs_float4(float4 p0) { return abs(p0); }
7171

7272
// CHECK-LABEL: define noundef i64 @_Z16test_abs_int64_t
@@ -82,15 +82,15 @@ int64_t3 test_abs_int64_t3(int64_t3 p0) { return abs(p0); }
8282
// CHECK: call <4 x i64> @llvm.abs.v4i64(
8383
int64_t4 test_abs_int64_t4(int64_t4 p0) { return abs(p0); }
8484

85-
// CHECK-LABEL: define noundef double @_Z15test_abs_double
86-
// CHECK: call double @llvm.fabs.f64(
85+
// CHECK-LABEL: define noundef nofpclass(nan inf) double @_Z15test_abs_double
86+
// CHECK: call reassoc nnan ninf nsz arcp afn double @llvm.fabs.f64(
8787
double test_abs_double(double p0) { return abs(p0); }
88-
// CHECK-LABEL: define noundef <2 x double> @_Z16test_abs_double2
89-
// CHECK: call <2 x double> @llvm.fabs.v2f64(
88+
// CHECK-LABEL: define noundef nofpclass(nan inf) <2 x double> @_Z16test_abs_double2
89+
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x double> @llvm.fabs.v2f64(
9090
double2 test_abs_double2(double2 p0) { return abs(p0); }
91-
// CHECK-LABEL: define noundef <3 x double> @_Z16test_abs_double3
92-
// CHECK: call <3 x double> @llvm.fabs.v3f64(
91+
// CHECK-LABEL: define noundef nofpclass(nan inf) <3 x double> @_Z16test_abs_double3
92+
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x double> @llvm.fabs.v3f64(
9393
double3 test_abs_double3(double3 p0) { return abs(p0); }
94-
// CHECK-LABEL: define noundef <4 x double> @_Z16test_abs_double4
95-
// CHECK: call <4 x double> @llvm.fabs.v4f64(
94+
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_abs_double4
95+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.fabs.v4f64(
9696
double4 test_abs_double4(double4 p0) { return abs(p0); }

clang/test/CodeGenHLSL/builtins/acos.hlsl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,53 @@
77
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
88

99
// CHECK-LABEL: test_acos_half
10-
// NATIVE_HALF: call half @llvm.acos.f16
11-
// NO_HALF: call float @llvm.acos.f32
10+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.acos.f16
11+
// NO_HALF: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
1212
half test_acos_half ( half p0 ) {
1313
return acos ( p0 );
1414
}
1515

1616
// CHECK-LABEL: test_acos_half2
17-
// NATIVE_HALF: call <2 x half> @llvm.acos.v2f16
18-
// NO_HALF: call <2 x float> @llvm.acos.v2f32
17+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.acos.v2f16
18+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
1919
half2 test_acos_half2 ( half2 p0 ) {
2020
return acos ( p0 );
2121
}
2222

2323
// CHECK-LABEL: test_acos_half3
24-
// NATIVE_HALF: call <3 x half> @llvm.acos.v3f16
25-
// NO_HALF: call <3 x float> @llvm.acos.v3f32
24+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.acos.v3f16
25+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
2626
half3 test_acos_half3 ( half3 p0 ) {
2727
return acos ( p0 );
2828
}
2929

3030
// CHECK-LABEL: test_acos_half4
31-
// NATIVE_HALF: call <4 x half> @llvm.acos.v4f16
32-
// NO_HALF: call <4 x float> @llvm.acos.v4f32
31+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.acos.v4f16
32+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
3333
half4 test_acos_half4 ( half4 p0 ) {
3434
return acos ( p0 );
3535
}
3636

3737
// CHECK-LABEL: test_acos_float
38-
// CHECK: call float @llvm.acos.f32
38+
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.acos.f32
3939
float test_acos_float ( float p0 ) {
4040
return acos ( p0 );
4141
}
4242

4343
// CHECK-LABEL: test_acos_float2
44-
// CHECK: call <2 x float> @llvm.acos.v2f32
44+
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.acos.v2f32
4545
float2 test_acos_float2 ( float2 p0 ) {
4646
return acos ( p0 );
4747
}
4848

4949
// CHECK-LABEL: test_acos_float3
50-
// CHECK: call <3 x float> @llvm.acos.v3f32
50+
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.acos.v3f32
5151
float3 test_acos_float3 ( float3 p0 ) {
5252
return acos ( p0 );
5353
}
5454

5555
// CHECK-LABEL: test_acos_float4
56-
// CHECK: call <4 x float> @llvm.acos.v4f32
56+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.acos.v4f32
5757
float4 test_acos_float4 ( float4 p0 ) {
5858
return acos ( p0 );
5959
}

clang/test/CodeGenHLSL/builtins/asdouble.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ double test_uint(uint low, uint high) {
1818
// CHECK-SPV-SAME: {{.*}} <i32 0, i32 1>
1919
// CHECK-SPV: bitcast <2 x i32> %[[SHUFFLE0]] to double
2020

21-
// CHECK-DXIL: call double @llvm.dx.asdouble.i32
21+
// CHECK-DXIL: call reassoc nnan ninf nsz arcp afn double @llvm.dx.asdouble.i32
2222
return asdouble(low, high);
2323
}
2424

@@ -30,7 +30,7 @@ double3 test_vuint(uint3 low, uint3 high) {
3030
// CHECK-SPV-SAME: {{.*}} <i32 0, i32 3, i32 1, i32 4, i32 2, i32 5>
3131
// CHECK-SPV: bitcast <6 x i32> %[[SHUFFLE1]] to <3 x double>
3232

33-
// CHECK-DXIL: call <3 x double> @llvm.dx.asdouble.v3i32
33+
// CHECK-DXIL: call reassoc nnan ninf nsz arcp afn <3 x double> @llvm.dx.asdouble.v3i32
3434
return asdouble(low, high);
3535
}
3636

clang/test/CodeGenHLSL/builtins/asin.hlsl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,53 +7,53 @@
77
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
88

99
// CHECK-LABEL: test_asin_half
10-
// NATIVE_HALF: call half @llvm.asin.f16
11-
// NO_HALF: call float @llvm.asin.f32
10+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn half @llvm.asin.f16
11+
// NO_HALF: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
1212
half test_asin_half ( half p0 ) {
1313
return asin ( p0 );
1414
}
1515

1616
// CHECK-LABEL: test_asin_half2
17-
// NATIVE_HALF: call <2 x half> @llvm.asin.v2f16
18-
// NO_HALF: call <2 x float> @llvm.asin.v2f32
17+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.asin.v2f16
18+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
1919
half2 test_asin_half2 ( half2 p0 ) {
2020
return asin ( p0 );
2121
}
2222

2323
// CHECK-LABEL: test_asin_half3
24-
// NATIVE_HALF: call <3 x half> @llvm.asin.v3f16
25-
// NO_HALF: call <3 x float> @llvm.asin.v3f32
24+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.asin.v3f16
25+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
2626
half3 test_asin_half3 ( half3 p0 ) {
2727
return asin ( p0 );
2828
}
2929

3030
// CHECK-LABEL: test_asin_half4
31-
// NATIVE_HALF: call <4 x half> @llvm.asin.v4f16
32-
// NO_HALF: call <4 x float> @llvm.asin.v4f32
31+
// NATIVE_HALF: call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.asin.v4f16
32+
// NO_HALF: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
3333
half4 test_asin_half4 ( half4 p0 ) {
3434
return asin ( p0 );
3535
}
3636

3737
// CHECK-LABEL: test_asin_float
38-
// CHECK: call float @llvm.asin.f32
38+
// CHECK: call reassoc nnan ninf nsz arcp afn float @llvm.asin.f32
3939
float test_asin_float ( float p0 ) {
4040
return asin ( p0 );
4141
}
4242

4343
// CHECK-LABEL: test_asin_float2
44-
// CHECK: call <2 x float> @llvm.asin.v2f32
44+
// CHECK: call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.asin.v2f32
4545
float2 test_asin_float2 ( float2 p0 ) {
4646
return asin ( p0 );
4747
}
4848

4949
// CHECK-LABEL: test_asin_float3
50-
// CHECK: call <3 x float> @llvm.asin.v3f32
50+
// CHECK: call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.asin.v3f32
5151
float3 test_asin_float3 ( float3 p0 ) {
5252
return asin ( p0 );
5353
}
5454

5555
// CHECK-LABEL: test_asin_float4
56-
// CHECK: call <4 x float> @llvm.asin.v4f32
56+
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.asin.v4f32
5757
float4 test_asin_float4 ( float4 p0 ) {
5858
return asin ( p0 );
5959
}

0 commit comments

Comments
 (0)