|
| 1 | +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ |
| 2 | +// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \ |
| 3 | +// RUN: -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \ |
| 5 | +// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ |
| 6 | +// RUN: -D__HLSL_ENABLE_16_BIT -o - | FileCheck %s --check-prefix=NO_HALF |
| 7 | + |
| 8 | +using hlsl::floor; |
| 9 | + |
| 10 | +// CHECK: define noundef half @ |
| 11 | +// CHECK: call half @llvm.floor.f16( |
| 12 | +// NO_HALF: define noundef float @"?test_floor_half@@YA$halff@$halff@@Z"( |
| 13 | +// NO_HALF: call float @llvm.floor.f32(float %0) |
| 14 | +half test_floor_half ( half p0 ) { |
| 15 | + return floor ( p0 ); |
| 16 | +} |
| 17 | +// CHECK: define noundef <2 x half> @ |
| 18 | +// CHECK: call <2 x half> @llvm.floor.v2f16( |
| 19 | +// NO_HALF: define noundef <2 x float> @"?test_floor_half2@@YAT?$__vector@$halff@$01@__clang@@T12@@Z"( |
| 20 | +// NO_HALF: call <2 x float> @llvm.floor.v2f32( |
| 21 | +half2 test_floor_half2 ( half2 p0 ) { |
| 22 | + return floor ( p0 ); |
| 23 | +} |
| 24 | +// CHECK: define noundef <3 x half> @ |
| 25 | +// CHECK: call <3 x half> @llvm.floor.v3f16( |
| 26 | +// NO_HALF: define noundef <3 x float> @"?test_floor_half3@@YAT?$__vector@$halff@$02@__clang@@T12@@Z"( |
| 27 | +// NO_HALF: call <3 x float> @llvm.floor.v3f32( |
| 28 | +half3 test_floor_half3 ( half3 p0 ) { |
| 29 | + return floor ( p0 ); |
| 30 | +} |
| 31 | +// CHECK: define noundef <4 x half> @ |
| 32 | +// CHECK: call <4 x half> @llvm.floor.v4f16( |
| 33 | +// NO_HALF: define noundef <4 x float> @"?test_floor_half4@@YAT?$__vector@$halff@$03@__clang@@T12@@Z"( |
| 34 | +// NO_HALF: call <4 x float> @llvm.floor.v4f32( |
| 35 | +half4 test_floor_half4 ( half4 p0 ) { |
| 36 | + return floor ( p0 ); |
| 37 | +} |
| 38 | + |
| 39 | +// CHECK: define noundef float @ |
| 40 | +// CHECK: call float @llvm.floor.f32( |
| 41 | +float test_floor_float ( float p0 ) { |
| 42 | + return floor ( p0 ); |
| 43 | +} |
| 44 | +// CHECK: define noundef <2 x float> @ |
| 45 | +// CHECK: call <2 x float> @llvm.floor.v2f32( |
| 46 | +float2 test_floor_float2 ( float2 p0 ) { |
| 47 | + return floor ( p0 ); |
| 48 | +} |
| 49 | +// CHECK: define noundef <3 x float> @ |
| 50 | +// CHECK: call <3 x float> @llvm.floor.v3f32( |
| 51 | +float3 test_floor_float3 ( float3 p0 ) { |
| 52 | + return floor ( p0 ); |
| 53 | +} |
| 54 | +// CHECK: define noundef <4 x float> @ |
| 55 | +// CHECK: call <4 x float> @llvm.floor.v4f32( |
| 56 | +float4 test_floor_float4 ( float4 p0 ) { |
| 57 | + return floor ( p0 ); |
| 58 | +} |
| 59 | + |
| 60 | +// CHECK: define noundef double @ |
| 61 | +// CHECK: call double @llvm.floor.f64( |
| 62 | +double test_floor_double ( double p0 ) { |
| 63 | + return floor ( p0 ); |
| 64 | +} |
| 65 | +// CHECK: define noundef <2 x double> @ |
| 66 | +// CHECK: call <2 x double> @llvm.floor.v2f64( |
| 67 | +double2 test_floor_double2 ( double2 p0 ) { |
| 68 | + return floor ( p0 ); |
| 69 | +} |
| 70 | +// CHECK: define noundef <3 x double> @ |
| 71 | +// CHECK: call <3 x double> @llvm.floor.v3f64( |
| 72 | +double3 test_floor_double3 ( double3 p0 ) { |
| 73 | + return floor ( p0 ); |
| 74 | +} |
| 75 | +// CHECK: define noundef <4 x double> @ |
| 76 | +// CHECK: call <4 x double> @llvm.floor.v4f64( |
| 77 | +double4 test_floor_double4 ( double4 p0 ) { |
| 78 | + return floor ( p0 ); |
| 79 | +} |
0 commit comments