| 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=CHECK |
| 4 |
|
| 5 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_sqrt_double |
| 6 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32( |
| 7 |
// CHECK: ret float %{{.*}} |
| 8 |
float test_sqrt_double(double p0) { return sqrt(p0); } |
| 9 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_double2 |
| 10 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32 |
| 11 |
// CHECK: ret <2 x float> %{{.*}} |
| 12 |
float2 test_sqrt_double2(double2 p0) { return sqrt(p0); } |
| 13 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_double3 |
| 14 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32 |
| 15 |
// CHECK: ret <3 x float> %{{.*}} |
| 16 |
float3 test_sqrt_double3(double3 p0) { return sqrt(p0); } |
| 17 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_double4 |
| 18 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32 |
| 19 |
// CHECK: ret <4 x float> %{{.*}} |
| 20 |
float4 test_sqrt_double4(double4 p0) { return sqrt(p0); } |
| 21 |
|
| 22 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_sqrt_int |
| 23 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32( |
| 24 |
// CHECK: ret float %{{.*}} |
| 25 |
float test_sqrt_int(int p0) { return sqrt(p0); } |
| 26 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_int2 |
| 27 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32 |
| 28 |
// CHECK: ret <2 x float> %{{.*}} |
| 29 |
float2 test_sqrt_int2(int2 p0) { return sqrt(p0); } |
| 30 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_int3 |
| 31 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32 |
| 32 |
// CHECK: ret <3 x float> %{{.*}} |
| 33 |
float3 test_sqrt_int3(int3 p0) { return sqrt(p0); } |
| 34 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_int4 |
| 35 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32 |
| 36 |
// CHECK: ret <4 x float> %{{.*}} |
| 37 |
float4 test_sqrt_int4(int4 p0) { return sqrt(p0); } |
| 38 |
|
| 39 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_sqrt_uint |
| 40 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32( |
| 41 |
// CHECK: ret float %{{.*}} |
| 42 |
float test_sqrt_uint(uint p0) { return sqrt(p0); } |
| 43 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_uint2 |
| 44 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32 |
| 45 |
// CHECK: ret <2 x float> %{{.*}} |
| 46 |
float2 test_sqrt_uint2(uint2 p0) { return sqrt(p0); } |
| 47 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_uint3 |
| 48 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32 |
| 49 |
// CHECK: ret <3 x float> %{{.*}} |
| 50 |
float3 test_sqrt_uint3(uint3 p0) { return sqrt(p0); } |
| 51 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_uint4 |
| 52 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32 |
| 53 |
// CHECK: ret <4 x float> %{{.*}} |
| 54 |
float4 test_sqrt_uint4(uint4 p0) { return sqrt(p0); } |
| 55 |
|
| 56 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_sqrt_int64_t |
| 57 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32( |
| 58 |
// CHECK: ret float %{{.*}} |
| 59 |
float test_sqrt_int64_t(int64_t p0) { return sqrt(p0); } |
| 60 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_int64_t2 |
| 61 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32 |
| 62 |
// CHECK: ret <2 x float> %{{.*}} |
| 63 |
float2 test_sqrt_int64_t2(int64_t2 p0) { return sqrt(p0); } |
| 64 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_int64_t3 |
| 65 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32 |
| 66 |
// CHECK: ret <3 x float> %{{.*}} |
| 67 |
float3 test_sqrt_int64_t3(int64_t3 p0) { return sqrt(p0); } |
| 68 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_int64_t4 |
| 69 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32 |
| 70 |
// CHECK: ret <4 x float> %{{.*}} |
| 71 |
float4 test_sqrt_int64_t4(int64_t4 p0) { return sqrt(p0); } |
| 72 |
|
| 73 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_sqrt_uint64_t |
| 74 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn float @llvm.sqrt.f32( |
| 75 |
// CHECK: ret float %{{.*}} |
| 76 |
float test_sqrt_uint64_t(uint64_t p0) { return sqrt(p0); } |
| 77 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_sqrt_uint64_t2 |
| 78 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.sqrt.v2f32 |
| 79 |
// CHECK: ret <2 x float> %{{.*}} |
| 80 |
float2 test_sqrt_uint64_t2(uint64_t2 p0) { return sqrt(p0); } |
| 81 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_sqrt_uint64_t3 |
| 82 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.sqrt.v3f32 |
| 83 |
// CHECK: ret <3 x float> %{{.*}} |
| 84 |
float3 test_sqrt_uint64_t3(uint64_t3 p0) { return sqrt(p0); } |
| 85 |
// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_sqrt_uint64_t4 |
| 86 |
// CHECK: %{{.*}} = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.sqrt.v4f32 |
| 87 |
// CHECK: ret <4 x float> %{{.*}} |
| 88 |
float4 test_sqrt_uint64_t4(uint64_t4 p0) { return sqrt(p0); } |