Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/OpIsInf.ll

raw
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
2 ; 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 16
5 ; CHECK-DAG: %[[#float_32:]] = OpTypeFloat 32
6 ; CHECK-DAG: %[[#vec4_float_16:]] = OpTypeVector %[[#float_16]] 4
7 ; CHECK-DAG: %[[#vec4_float_32:]] = OpTypeVector %[[#float_32]] 4
8 ; CHECK-DAG: %[[#bool:]] = OpTypeBool
9 ; CHECK-DAG: %[[#vec4_bool:]] = OpTypeVector %[[#bool]] 4
10
11 define noundef i1 @isinf_half(half noundef %a) {
12 entry:
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.isinf
18 }
19
20 define noundef i1 @isinf_float(float noundef %a) {
21 entry:
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.isinf
27 }
28
29 define noundef <4 x i1> @isinf_half4(<4 x half> noundef %a) {
30 entry:
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.isinf
36 }
37
38 define noundef <4 x i1> @isinf_float4(<4 x float> noundef %a) {
39 entry:
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.isinf
45 }