46 lines · plain
1; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val --target-env spv1.4 %}3 4; CHECK-DAG: %[[#float_16:]] = OpTypeFloat 165; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 326; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 47; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 48; CHECK-DAG: %[[#bool:]] = OpTypeBool9; CHECK-DAG: %[[#vec4_bool:]] = OpTypeVector %[[#bool]] 410 11define noundef i1 @isinf_half(half noundef %a) {12entry:13 ; CHECK: %[[#]] = OpFunction %[[#bool]] None %[[#]]14 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_16]]15 ; CHECK: %[[#]] = OpIsInf %[[#bool]] %[[#arg0]]16 %hlsl.isinf = call i1 @llvm.spv.isinf.f16(half %a)17 ret i1 %hlsl.isinf18}19 20define noundef i1 @isinf_float(float noundef %a) {21entry:22 ; CHECK: %[[#]] = OpFunction %[[#bool]] None %[[#]]23 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_32]]24 ; CHECK: %[[#]] = OpIsInf %[[#bool]] %[[#arg0]]25 %hlsl.isinf = call i1 @llvm.spv.isinf.f32(float %a)26 ret i1 %hlsl.isinf27}28 29define noundef <4 x i1> @isinf_half4(<4 x half> noundef %a) {30entry:31 ; CHECK: %[[#]] = OpFunction %[[#vec4_bool]] None %[[#]]32 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_16]]33 ; CHECK: %[[#]] = OpIsInf %[[#vec4_bool]] %[[#arg0]]34 %hlsl.isinf = call <4 x i1> @llvm.spv.isinf.v4f16(<4 x half> %a)35 ret <4 x i1> %hlsl.isinf36}37 38define noundef <4 x i1> @isinf_float4(<4 x float> noundef %a) {39entry:40 ; CHECK: %[[#]] = OpFunction %[[#vec4_bool]] None %[[#]]41 ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_32]]42 ; CHECK: %[[#]] = OpIsInf %[[#vec4_bool]] %[[#arg0]]43 %hlsl.isinf = call <4 x i1> @llvm.spv.isinf.v4f32(<4 x float> %a)44 ret <4 x i1> %hlsl.isinf45}46