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