59 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \2// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type \3// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \4// RUN: --check-prefixes=CHECK,NATIVE_HALF \5// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx6// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \7// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \8// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \9// RUN: -DFNATTRS="noundef nofpclass(nan inf)" -DTARGET=dx10// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \11// RUN: spirv-unknown-vulkan-compute %s -fnative-half-type -fnative-int16-type \12// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \13// RUN: --check-prefixes=CHECK,NATIVE_HALF \14// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv15// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \16// RUN: spirv-unknown-vulkan-compute %s -emit-llvm -disable-llvm-passes \17// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF \18// RUN: -DFNATTRS="spir_func noundef nofpclass(nan inf)" -DTARGET=spv19 20// NATIVE_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn half @llvm.[[TARGET]].lerp.f16(half %{{.*}}, half %{{.*}}, half %{{.*}})21// NATIVE_HALF: ret half %hlsl.lerp22// NO_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})23// NO_HALF: ret float %hlsl.lerp24half test_lerp_half(half p0) { return lerp(p0, p0, p0); }25 26// NATIVE_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x half> @llvm.[[TARGET]].lerp.v2f16(<2 x half> %{{.*}}, <2 x half> %{{.*}}, <2 x half> %{{.*}})27// NATIVE_HALF: ret <2 x half> %hlsl.lerp28// NO_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})29// NO_HALF: ret <2 x float> %hlsl.lerp30half2 test_lerp_half2(half2 p0) { return lerp(p0, p0, p0); }31 32// NATIVE_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x half> @llvm.[[TARGET]].lerp.v3f16(<3 x half> %{{.*}}, <3 x half> %{{.*}}, <3 x half> %{{.*}})33// NATIVE_HALF: ret <3 x half> %hlsl.lerp34// NO_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})35// NO_HALF: ret <3 x float> %hlsl.lerp36half3 test_lerp_half3(half3 p0) { return lerp(p0, p0, p0); }37 38// NATIVE_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x half> @llvm.[[TARGET]].lerp.v4f16(<4 x half> %{{.*}}, <4 x half> %{{.*}}, <4 x half> %{{.*}})39// NATIVE_HALF: ret <4 x half> %hlsl.lerp40// NO_HALF: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})41// NO_HALF: ret <4 x float> %hlsl.lerp42half4 test_lerp_half4(half4 p0) { return lerp(p0, p0, p0); }43 44// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn float @llvm.[[TARGET]].lerp.f32(float %{{.*}}, float %{{.*}}, float %{{.*}})45// CHECK: ret float %hlsl.lerp46float test_lerp_float(float p0) { return lerp(p0, p0, p0); }47 48// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <2 x float> @llvm.[[TARGET]].lerp.v2f32(<2 x float> %{{.*}}, <2 x float> %{{.*}}, <2 x float> %{{.*}})49// CHECK: ret <2 x float> %hlsl.lerp50float2 test_lerp_float2(float2 p0) { return lerp(p0, p0, p0); }51 52// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <3 x float> @llvm.[[TARGET]].lerp.v3f32(<3 x float> %{{.*}}, <3 x float> %{{.*}}, <3 x float> %{{.*}})53// CHECK: ret <3 x float> %hlsl.lerp54float3 test_lerp_float3(float3 p0) { return lerp(p0, p0, p0); }55 56// CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}})57// CHECK: ret <4 x float> %hlsl.lerp58float4 test_lerp_float4(float4 p0) { return lerp(p0, p0, p0); }59