|
1 | 1 | // RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s \
|
2 |
| -// RUN: -emit-llvm -disable-llvm-passes -o - | \ |
| 2 | +// RUN: -emit-llvm -o - | \ |
3 | 3 | // RUN: FileCheck %s --check-prefixes=CHECK
|
4 | 4 |
|
5 |
| -// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litEddd( |
6 |
| -// CHECK: call reassoc nnan ninf nsz arcp afn noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litIfEEKNS_8__detail9enable_ifIXaasr8__detail13is_arithmeticIT_EE5Valuesr8__detail7is_sameIfS3_EE5valueEDv4_S3_E4TypeES3_S3_S3_( |
7 |
| -float4 test_lit_double(double NDotL, double NDotH, double M) { return lit(NDotL, NDotH, M); } |
| 5 | +// CHECK-LABEL: test_lit_double |
| 6 | +// CHECK: %conv.i = fptrunc reassoc nnan ninf nsz arcp afn double %{{.*}} to float |
| 7 | +// CHECK: %conv1.i = fptrunc reassoc nnan ninf nsz arcp afn double %{{.*}} to float |
| 8 | +// CHECK: %conv2.i = fptrunc reassoc nnan ninf nsz arcp afn double %{{.*}} to float |
| 9 | +// CHECK: %cmp.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 10 | +// CHECK: %hlsl.select.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 11 | +// CHECK: %vecinit.i = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float %{{.*}}, i32 1 |
| 12 | +// CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 13 | +// CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i |
| 14 | +// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float %{{.*}}) |
| 15 | +// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, %{{.*}} |
| 16 | +// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float %mul.i) |
| 17 | +// CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 18 | +// CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float %hlsl.select7.i, i32 2 |
| 19 | +// CHECK: %conv3.i = fpext reassoc nnan ninf nsz arcp afn <4 x float> %{{.*}} to <4 x double> |
| 20 | +// CHECK: ret <4 x double> %conv3.i |
| 21 | +double4 test_lit_double(double NDotL, double NDotH, double M) { return lit(NDotL, NDotH, M); } |
8 | 22 |
|
9 |
| -// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litEiii( |
10 |
| -// CHECK: call reassoc nnan ninf nsz arcp afn noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litIfEEKNS_8__detail9enable_ifIXaasr8__detail13is_arithmeticIT_EE5Valuesr8__detail7is_sameIfS3_EE5valueEDv4_S3_E4TypeES3_S3_S3_( |
11 |
| -float4 test_lit_int(int NDotL, int NDotH, int M) { return lit(NDotL, NDotH, M); } |
| 23 | +// CHECK-LABEL: test_lit_int |
| 24 | +// CHECK: %conv.i = sitofp i32 %{{.*}} to float |
| 25 | +// CHECK: %conv1.i = sitofp i32 %{{.*}} to float |
| 26 | +// CHECK: %conv2.i = sitofp i32 %{{.*}} to float |
| 27 | +// CHECK: %cmp.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 28 | +// CHECK: %hlsl.select.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 29 | +// CHECK: %vecinit.i = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float %{{.*}}, i32 1 |
| 30 | +// CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 31 | +// CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i |
| 32 | +// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float %{{.*}}) |
| 33 | +// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, %{{.*}} |
| 34 | +// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float %mul.i) |
| 35 | +// CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 36 | +// CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float %hlsl.select7.i, i32 2 |
| 37 | +// CHECK: %conv3.i = fptosi <4 x float> %{{.*}} to <4 x i32> |
| 38 | +// CHECK: ret <4 x i32> %conv3.i |
| 39 | +int4 test_lit_int(int NDotL, int NDotH, int M) { return lit(NDotL, NDotH, M); } |
12 | 40 |
|
13 |
| -// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litEjjj( |
14 |
| -// CHECK: call reassoc nnan ninf nsz arcp afn noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litIfEEKNS_8__detail9enable_ifIXaasr8__detail13is_arithmeticIT_EE5Valuesr8__detail7is_sameIfS3_EE5valueEDv4_S3_E4TypeES3_S3_S3_( |
15 |
| -float4 test_lit_uint(uint NDotL, uint NDotH, uint M) { return lit(NDotL, NDotH, M); } |
| 41 | +// CHECK-LABEL: test_lit_uint |
| 42 | +// CHECK: %conv.i = uitofp i32 %{{.*}} to float |
| 43 | +// CHECK: %conv1.i = uitofp i32 %{{.*}} to float |
| 44 | +// CHECK: %conv2.i = uitofp i32 %{{.*}} to float |
| 45 | +// CHECK: %cmp.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 46 | +// CHECK: %hlsl.select.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 47 | +// CHECK: %vecinit.i = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float %{{.*}}, i32 1 |
| 48 | +// CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 49 | +// CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i |
| 50 | +// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float %{{.*}}) |
| 51 | +// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, %{{.*}} |
| 52 | +// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float %mul.i) |
| 53 | +// CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 54 | +// CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float %hlsl.select7.i, i32 2 |
| 55 | +// CHECK: %conv3.i = fptoui <4 x float> %{{.*}} to <4 x i32> |
| 56 | +// CHECK: ret <4 x i32> %conv3.i |
| 57 | +uint4 test_lit_uint(uint NDotL, uint NDotH, uint M) { return lit(NDotL, NDotH, M); } |
16 | 58 |
|
17 |
| -// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litElll( |
18 |
| -// CHECK: call reassoc nnan ninf nsz arcp afn noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litIfEEKNS_8__detail9enable_ifIXaasr8__detail13is_arithmeticIT_EE5Valuesr8__detail7is_sameIfS3_EE5valueEDv4_S3_E4TypeES3_S3_S3_( |
19 |
| -float4 test_lit_int64_t(int64_t NDotL, int64_t NDotH, int64_t M) { return lit(NDotL, NDotH, M); } |
| 59 | +// CHECK-LABEL: test_lit_int64_t |
| 60 | +// CHECK: %conv.i = sitofp i64 %{{.*}} to float |
| 61 | +// CHECK: %conv1.i = sitofp i64 %{{.*}} to float |
| 62 | +// CHECK: %conv2.i = sitofp i64 %{{.*}} to float |
| 63 | +// CHECK: %cmp.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 64 | +// CHECK: %hlsl.select.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 65 | +// CHECK: %vecinit.i = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float %{{.*}}, i32 1 |
| 66 | +// CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 67 | +// CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i |
| 68 | +// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float %{{.*}}) |
| 69 | +// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, %{{.*}} |
| 70 | +// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float %mul.i) |
| 71 | +// CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 72 | +// CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float %hlsl.select7.i, i32 2 |
| 73 | +// CHECK: %conv3.i = fptosi <4 x float> %{{.*}} to <4 x i64> |
| 74 | +// CHECK: ret <4 x i64> %conv3.i |
| 75 | +int64_t4 test_lit_int64_t(int64_t NDotL, int64_t NDotH, int64_t M) { return lit(NDotL, NDotH, M); } |
20 | 76 |
|
21 |
| -// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litEmmm( |
22 |
| -// CHECK: call reassoc nnan ninf nsz arcp afn noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl3litIfEEKNS_8__detail9enable_ifIXaasr8__detail13is_arithmeticIT_EE5Valuesr8__detail7is_sameIfS3_EE5valueEDv4_S3_E4TypeES3_S3_S3_( |
23 |
| -float4 test_lit_uint64_t(uint64_t NDotL, uint64_t NDotH, uint64_t M) { return lit(NDotL, NDotH, M); } |
| 77 | +// CHECK-LABEL: test_lit_uint64_t |
| 78 | +// CHECK: %conv.i = uitofp i64 %{{.*}} to float |
| 79 | +// CHECK: %conv1.i = uitofp i64 %{{.*}} to float |
| 80 | +// CHECK: %conv2.i = uitofp i64 %{{.*}} to float |
| 81 | +// CHECK: %cmp.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 82 | +// CHECK: %hlsl.select.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 83 | +// CHECK: %vecinit.i = insertelement <4 x float> <float 1.000000e+00, float poison, float poison, float poison>, float %{{.*}}, i32 1 |
| 84 | +// CHECK: %cmp4.i = fcmp reassoc nnan ninf nsz arcp afn olt float %{{.*}}, 0.000000e+00 |
| 85 | +// CHECK: %hlsl.or.i = or i1 %{{.*}}, %cmp4.i |
| 86 | +// CHECK: %elt.log.i = call reassoc nnan ninf nsz arcp afn float @llvm.log.f32(float %{{.*}}) |
| 87 | +// CHECK: %mul.i = fmul reassoc nnan ninf nsz arcp afn float %elt.log.i, %{{.*}} |
| 88 | +// CHECK: %elt.exp.i = call reassoc nnan ninf nsz arcp afn float @llvm.exp.f32(float %mul.i) |
| 89 | +// CHECK: %hlsl.select7.i = select reassoc nnan ninf nsz arcp afn i1 %{{.*}}, float 0.000000e+00, float %{{.*}} |
| 90 | +// CHECK: %vecins.i = insertelement <4 x float> %{{.*}}, float %hlsl.select7.i, i32 2 |
| 91 | +// CHECK: %conv3.i = fptoui <4 x float> %{{.*}} to <4 x i64> |
| 92 | +// CHECK: ret <4 x i64> %conv3.i |
| 93 | +uint64_t4 test_lit_uint64_t(uint64_t NDotL, uint64_t NDotH, uint64_t M) { return lit(NDotL, NDotH, M); } |
0 commit comments