89 lines · plain
1// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \2// RUN: -emit-llvm -disable-llvm-passes -o - | \3// RUN: FileCheck %s --check-prefixes=CHECK4 5// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_round_double6// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(7// CHECK: ret float [[ROUNDEVEN]]8float test_round_double(double p0) { return round(p0); }9// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_double210// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f3211// CHECK: ret <2 x float> [[ROUNDEVEN]]12float2 test_round_double2(double2 p0) { return round(p0); }13// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_double314// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f3215// CHECK: ret <3 x float> [[ROUNDEVEN]]16float3 test_round_double3(double3 p0) { return round(p0); }17// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_double418// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f3219// CHECK: ret <4 x float> [[ROUNDEVEN]]20float4 test_round_double4(double4 p0) { return round(p0); }21 22// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_round_int23// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(24// CHECK: ret float [[ROUNDEVEN]]25float test_round_int(int p0) { return round(p0); }26// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_int227// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f3228// CHECK: ret <2 x float> [[ROUNDEVEN]]29float2 test_round_int2(int2 p0) { return round(p0); }30// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_int331// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f3232// CHECK: ret <3 x float> [[ROUNDEVEN]]33float3 test_round_int3(int3 p0) { return round(p0); }34// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_int435// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f3236// CHECK: ret <4 x float> [[ROUNDEVEN]]37float4 test_round_int4(int4 p0) { return round(p0); }38 39// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_round_uint40// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(41// CHECK: ret float [[ROUNDEVEN]]42float test_round_uint(uint p0) { return round(p0); }43// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_uint244// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f3245// CHECK: ret <2 x float> [[ROUNDEVEN]]46float2 test_round_uint2(uint2 p0) { return round(p0); }47// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_uint348// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f3249// CHECK: ret <3 x float> [[ROUNDEVEN]]50float3 test_round_uint3(uint3 p0) { return round(p0); }51// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_uint452// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f3253// CHECK: ret <4 x float> [[ROUNDEVEN]]54float4 test_round_uint4(uint4 p0) { return round(p0); }55 56// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_round_int64_t57// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(58// CHECK: ret float [[ROUNDEVEN]]59float test_round_int64_t(int64_t p0) { return round(p0); }60// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_int64_t261// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f3262// CHECK: ret <2 x float> [[ROUNDEVEN]]63float2 test_round_int64_t2(int64_t2 p0) { return round(p0); }64// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_int64_t365// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f3266// CHECK: ret <3 x float> [[ROUNDEVEN]]67float3 test_round_int64_t3(int64_t3 p0) { return round(p0); }68// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_int64_t469// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f3270// CHECK: ret <4 x float> [[ROUNDEVEN]]71float4 test_round_int64_t4(int64_t4 p0) { return round(p0); }72 73// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_round_uint64_t74// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn float @llvm.roundeven.f32(75// CHECK: ret float [[ROUNDEVEN]]76float test_round_uint64_t(uint64_t p0) { return round(p0); }77// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_round_uint64_t278// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.roundeven.v2f3279// CHECK: ret <2 x float> [[ROUNDEVEN]]80float2 test_round_uint64_t2(uint64_t2 p0) { return round(p0); }81// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_round_uint64_t382// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.roundeven.v3f3283// CHECK: ret <3 x float> [[ROUNDEVEN]]84float3 test_round_uint64_t3(uint64_t3 p0) { return round(p0); }85// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_round_uint64_t486// CHECK: [[ROUNDEVEN:%.*]] = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.roundeven.v4f3287// CHECK: ret <4 x float> [[ROUNDEVEN]]88float4 test_round_uint64_t4(uint64_t4 p0) { return round(p0); }89