|
| 1 | +// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s |
| 2 | + |
| 3 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) half @_ZN4hlsl8__detail10ldexp_implIDhEET_S2_S2_ |
| 4 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn half @llvm.exp2.f16(half %{{.*}}) |
| 5 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn half %elt.exp2, %{{.*}} |
| 6 | +// CHECK: ret half %mul |
| 7 | +half test_ldexp_half(half X, half Exp) { return ldexp(X, Exp); } |
| 8 | + |
| 9 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <2 x half> @_ZN4hlsl8__detail10ldexp_implIDv2_DhEET_S3_S3_ |
| 10 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.exp2.v2f16(<2 x half> %{{.*}}) |
| 11 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x half> %elt.exp2, %{{.*}} |
| 12 | +// CHECK: ret <2 x half> %mul |
| 13 | +half2 test_ldexp_half2(half2 X, half2 Exp) { return ldexp(X, Exp); } |
| 14 | + |
| 15 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <3 x half> @_ZN4hlsl8__detail10ldexp_implIDv3_DhEET_S3_S3_ |
| 16 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.exp2.v3f16(<3 x half> %{{.*}}) |
| 17 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x half> %elt.exp2, %{{.*}} |
| 18 | +// CHECK: ret <3 x half> %mul |
| 19 | +half3 test_ldexp_half3(half3 X, half3 Exp) { return ldexp(X, Exp); } |
| 20 | + |
| 21 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x half> @_ZN4hlsl8__detail10ldexp_implIDv4_DhEET_S3_S3_ |
| 22 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.exp2.v4f16(<4 x half> %{{.*}}) |
| 23 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x half> %elt.exp2, %{{.*}} |
| 24 | +// CHECK: ret <4 x half> %mul |
| 25 | +half4 test_ldexp_half4(half4 X, half4 Exp) { return ldexp(X, Exp); } |
| 26 | + |
| 27 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) float @_ZN4hlsl8__detail10ldexp_implIfEET_S2_S2_ |
| 28 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn float @llvm.exp2.f32(float %{{.*}}) |
| 29 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn float %elt.exp2, %{{.*}} |
| 30 | +// CHECK: ret float %mul |
| 31 | +float test_ldexp_float(float X, float Exp) { return ldexp(X, Exp); } |
| 32 | + |
| 33 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <2 x float> @_ZN4hlsl8__detail10ldexp_implIDv2_fEET_S3_S3_ |
| 34 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.exp2.v2f32(<2 x float> %{{.*}}) |
| 35 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <2 x float> %elt.exp2, %{{.*}} |
| 36 | +// CHECK: ret <2 x float> %mul |
| 37 | +float2 test_ldexp_float2(float2 X, float2 Exp) { return ldexp(X, Exp); } |
| 38 | + |
| 39 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <3 x float> @_ZN4hlsl8__detail10ldexp_implIDv3_fEET_S3_S3_ |
| 40 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.exp2.v3f32(<3 x float> %{{.*}}) |
| 41 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <3 x float> %elt.exp2, %{{.*}} |
| 42 | +// CHECK: ret <3 x float> %mul |
| 43 | +float3 test_ldexp_float3(float3 X, float3 Exp) { return ldexp(X, Exp); } |
| 44 | + |
| 45 | +// CHECK-LABEL: define linkonce_odr noundef nofpclass(nan inf) <4 x float> @_ZN4hlsl8__detail10ldexp_implIDv4_fEET_S3_S3_ |
| 46 | +// CHECK: %elt.exp2 = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.exp2.v4f32(<4 x float> %{{.*}}) |
| 47 | +// CHECK: %mul = fmul reassoc nnan ninf nsz arcp afn <4 x float> %elt.exp2, %{{.*}} |
| 48 | +// CHECK: ret <4 x float> %mul |
| 49 | +float4 test_ldexp_float4(float4 X, float4 Exp) { return ldexp(X, Exp); } |
0 commit comments