brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 67bb0cd Raw
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 @isnan_half(half noundef %a) {12entry:13  ; CHECK: %[[#]] = OpFunction %[[#bool]] None %[[#]]14  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_16]]15  ; CHECK: %[[#]] = OpIsNan %[[#bool]] %[[#arg0]]16  %hlsl.isnan = call i1 @llvm.spv.isnan.f16(half %a)17  ret i1 %hlsl.isnan18}19 20define noundef i1 @isnan_float(float noundef %a) {21entry:22  ; CHECK: %[[#]] = OpFunction %[[#bool]] None %[[#]]23  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#float_32]]24  ; CHECK: %[[#]] = OpIsNan %[[#bool]] %[[#arg0]]25  %hlsl.isnan = call i1 @llvm.spv.isnan.f32(float %a)26  ret i1 %hlsl.isnan27}28 29define noundef <4 x i1> @isnan_half4(<4 x half> noundef %a) {30entry:31  ; CHECK: %[[#]] = OpFunction %[[#vec4_bool]] None %[[#]]32  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_16]]33  ; CHECK: %[[#]] = OpIsNan %[[#vec4_bool]] %[[#arg0]]34  %hlsl.isnan = call <4 x i1> @llvm.spv.isnan.v4f16(<4 x half> %a)35  ret <4 x i1> %hlsl.isnan36}37 38define noundef <4 x i1> @isnan_float4(<4 x float> noundef %a) {39entry:40  ; CHECK: %[[#]] = OpFunction %[[#vec4_bool]] None %[[#]]41  ; CHECK: %[[#arg0:]] = OpFunctionParameter %[[#vec4_float_32]]42  ; CHECK: %[[#]] = OpIsNan %[[#vec4_bool]] %[[#arg0]]43  %hlsl.isnan = call <4 x i1> @llvm.spv.isnan.v4f32(<4 x float> %a)44  ret <4 x i1> %hlsl.isnan45}46