brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.9 KiB · 0d1f3d3 Raw
129 lines · plain
1// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \2// RUN:  -emit-llvm -o - | FileCheck %s --check-prefixes=CHECK \3// RUN:  -DFLOATATTRS="reassoc nnan ninf nsz arcp afn"4 5// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_pow_double6// CHECK: [[CONV0:%.*]] = fptrunc [[FLOATATTRS]] double %{{.*}} to float7// CHECK: [[CONV1:%.*]] = fptrunc [[FLOATATTRS]] double %{{.*}} to float8// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef float @llvm.pow.f32(float [[CONV0]], float [[CONV1]])9// CHECK: ret float [[POW]]10float test_pow_double(double p0, double p1) { return pow(p0, p1); }11// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_double212// CHECK: [[CONV0:%.*]] = fptrunc [[FLOATATTRS]] <2 x double> %{{.*}} to <2 x float>13// CHECK: [[CONV1:%.*]] = fptrunc [[FLOATATTRS]] <2 x double> %{{.*}} to <2 x float>14// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <2 x float> @llvm.pow.v2f32(<2 x float> [[CONV0]], <2 x float> [[CONV1]])15// CHECK: ret <2 x float> [[POW]]16float2 test_pow_double2(double2 p0, double2 p1) { return pow(p0, p1); }17// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_double318// CHECK: [[CONV0:%.*]] = fptrunc [[FLOATATTRS]] <3 x double> %{{.*}} to <3 x float>19// CHECK: [[CONV1:%.*]] = fptrunc [[FLOATATTRS]] <3 x double> %{{.*}} to <3 x float>20// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <3 x float> @llvm.pow.v3f32(<3 x float> [[CONV0]], <3 x float> [[CONV1]])21// CHECK: ret <3 x float> [[POW]]22float3 test_pow_double3(double3 p0, double3 p1) { return pow(p0, p1); }23// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_double424// CHECK: [[CONV0:%.*]] = fptrunc [[FLOATATTRS]] <4 x double> %{{.*}} to <4 x float>25// CHECK: [[CONV1:%.*]] = fptrunc [[FLOATATTRS]] <4 x double> %{{.*}} to <4 x float>26// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <4 x float> @llvm.pow.v4f32(<4 x float> [[CONV0]], <4 x float> [[CONV1]])27// CHECK: ret <4 x float> [[POW]]28float4 test_pow_double4(double4 p0, double4 p1) { return pow(p0, p1); }29 30// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_pow_int31// CHECK: [[CONV0:%.*]] = sitofp i32 %{{.*}} to float32// CHECK: [[CONV1:%.*]] = sitofp i32 %{{.*}} to float33// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef float @llvm.pow.f32(float [[CONV0]], float [[CONV1]])34// CHECK: ret float [[POW]]35float test_pow_int(int p0, int p1) { return pow(p0, p1); }36// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_int237// CHECK: [[CONV0:%.*]] = sitofp <2 x i32> %{{.*}} to <2 x float>38// CHECK: [[CONV1:%.*]] = sitofp <2 x i32> %{{.*}} to <2 x float>39// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <2 x float> @llvm.pow.v2f32(<2 x float> [[CONV0]], <2 x float> [[CONV1]])40// CHECK: ret <2 x float> [[POW]]41float2 test_pow_int2(int2 p0, int2 p1) { return pow(p0, p1); }42// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_int343// CHECK: [[CONV0:%.*]] = sitofp <3 x i32> %{{.*}} to <3 x float>44// CHECK: [[CONV1:%.*]] = sitofp <3 x i32> %{{.*}} to <3 x float>45// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <3 x float> @llvm.pow.v3f32(<3 x float> [[CONV0]], <3 x float> [[CONV1]])46// CHECK: ret <3 x float> [[POW]]47float3 test_pow_int3(int3 p0, int3 p1) { return pow(p0, p1); }48// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_int449// CHECK: [[CONV0:%.*]] = sitofp <4 x i32> %{{.*}} to <4 x float>50// CHECK: [[CONV1:%.*]] = sitofp <4 x i32> %{{.*}} to <4 x float>51// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <4 x float> @llvm.pow.v4f32(<4 x float> [[CONV0]], <4 x float> [[CONV1]])52// CHECK: ret <4 x float> [[POW]]53float4 test_pow_int4(int4 p0, int4 p1) { return pow(p0, p1); }54 55// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_pow_uint56// CHECK: [[CONV0:%.*]] = uitofp i32 %{{.*}} to float57// CHECK: [[CONV1:%.*]] = uitofp i32 %{{.*}} to float58// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef float @llvm.pow.f32(float [[CONV0]], float [[CONV1]])59// CHECK: ret float [[POW]]60float test_pow_uint(uint p0, uint p1) { return pow(p0, p1); }61// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_uint262// CHECK: [[CONV0:%.*]] = uitofp <2 x i32> %{{.*}} to <2 x float>63// CHECK: [[CONV1:%.*]] = uitofp <2 x i32> %{{.*}} to <2 x float>64// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <2 x float> @llvm.pow.v2f32(<2 x float> [[CONV0]], <2 x float> [[CONV1]])65// CHECK: ret <2 x float> [[POW]]66float2 test_pow_uint2(uint2 p0, uint2 p1) { return pow(p0, p1); }67// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_uint368// CHECK: [[CONV0:%.*]] = uitofp <3 x i32> %{{.*}} to <3 x float>69// CHECK: [[CONV1:%.*]] = uitofp <3 x i32> %{{.*}} to <3 x float>70// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <3 x float> @llvm.pow.v3f32(<3 x float> [[CONV0]], <3 x float> [[CONV1]])71// CHECK: ret <3 x float> [[POW]]72float3 test_pow_uint3(uint3 p0, uint3 p1) { return pow(p0, p1); }73// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_uint474// CHECK: [[CONV0:%.*]] = uitofp <4 x i32> %{{.*}} to <4 x float>75// CHECK: [[CONV1:%.*]] = uitofp <4 x i32> %{{.*}} to <4 x float>76// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <4 x float> @llvm.pow.v4f32(<4 x float> [[CONV0]], <4 x float> [[CONV1]])77// CHECK: ret <4 x float> [[POW]]78float4 test_pow_uint4(uint4 p0, uint4 p1) { return pow(p0, p1); }79 80// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_pow_int64_t81// CHECK: [[CONV0:%.*]] = sitofp i64 %{{.*}} to float82// CHECK: [[CONV1:%.*]] = sitofp i64 %{{.*}} to float83// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef float @llvm.pow.f32(float [[CONV0]], float [[CONV1]])84// CHECK: ret float [[POW]]85float test_pow_int64_t(int64_t p0, int64_t p1) { return pow(p0, p1); }86// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_int64_t287// CHECK: [[CONV0:%.*]] = sitofp <2 x i64> %{{.*}} to <2 x float>88// CHECK: [[CONV1:%.*]] = sitofp <2 x i64> %{{.*}} to <2 x float>89// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <2 x float> @llvm.pow.v2f32(<2 x float> [[CONV0]], <2 x float> [[CONV1]])90// CHECK: ret <2 x float> [[POW]]91float2 test_pow_int64_t2(int64_t2 p0, int64_t2 p1) { return pow(p0, p1); }92// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_int64_t393// CHECK: [[CONV0:%.*]] = sitofp <3 x i64> %{{.*}} to <3 x float>94// CHECK: [[CONV1:%.*]] = sitofp <3 x i64> %{{.*}} to <3 x float>95// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <3 x float> @llvm.pow.v3f32(<3 x float> [[CONV0]], <3 x float> [[CONV1]])96// CHECK: ret <3 x float> [[POW]]97float3 test_pow_int64_t3(int64_t3 p0, int64_t3 p1) { return pow(p0, p1); }98// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_int64_t499// CHECK: [[CONV0:%.*]] = sitofp <4 x i64> %{{.*}} to <4 x float>100// CHECK: [[CONV1:%.*]] = sitofp <4 x i64> %{{.*}} to <4 x float>101// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <4 x float> @llvm.pow.v4f32(<4 x float> [[CONV0]], <4 x float> [[CONV1]])102// CHECK: ret <4 x float> [[POW]]103float4 test_pow_int64_t4(int64_t4 p0, int64_t4 p1) { return pow(p0, p1); }104 105// CHECK-LABEL: define hidden noundef nofpclass(nan inf) float {{.*}}test_pow_uint64_t106// CHECK: [[CONV0:%.*]] = uitofp i64 %{{.*}} to float107// CHECK: [[CONV1:%.*]] = uitofp i64 %{{.*}} to float108// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef float @llvm.pow.f32(float [[CONV0]], float [[CONV1]])109// CHECK: ret float [[POW]]110float test_pow_uint64_t(uint64_t p0, uint64_t p1) { return pow(p0, p1); }111// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <2 x float> {{.*}}test_pow_uint64_t2112// CHECK: [[CONV0:%.*]] = uitofp <2 x i64> %{{.*}} to <2 x float>113// CHECK: [[CONV1:%.*]] = uitofp <2 x i64> %{{.*}} to <2 x float>114// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <2 x float> @llvm.pow.v2f32(<2 x float> [[CONV0]], <2 x float> [[CONV1]])115// CHECK: ret <2 x float> [[POW]]116float2 test_pow_uint64_t2(uint64_t2 p0, uint64_t2 p1) { return pow(p0, p1); }117// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <3 x float> {{.*}}test_pow_uint64_t3118// CHECK: [[CONV0:%.*]] = uitofp <3 x i64> %{{.*}} to <3 x float>119// CHECK: [[CONV1:%.*]] = uitofp <3 x i64> %{{.*}} to <3 x float>120// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <3 x float> @llvm.pow.v3f32(<3 x float> [[CONV0]], <3 x float> [[CONV1]])121// CHECK: ret <3 x float> [[POW]]122float3 test_pow_uint64_t3(uint64_t3 p0, uint64_t3 p1) { return pow(p0, p1); }123// CHECK-LABEL: define hidden noundef nofpclass(nan inf) <4 x float> {{.*}}test_pow_uint64_t4124// CHECK: [[CONV0:%.*]] = uitofp <4 x i64> %{{.*}} to <4 x float>125// CHECK: [[CONV1:%.*]] = uitofp <4 x i64> %{{.*}} to <4 x float>126// CHECK: [[POW:%.*]] = call [[FLOATATTRS]] noundef <4 x float> @llvm.pow.v4f32(<4 x float> [[CONV0]], <4 x float> [[CONV1]])127// CHECK: ret <4 x float> [[POW]]128float4 test_pow_uint64_t4(uint64_t4 p0, uint64_t4 p1) { return pow(p0, p1); }129