| 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 @isnan_half(half noundef %a) { |
| 12 |
entry: |
| 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.isnan |
| 18 |
} |
| 19 |
|
| 20 |
define noundef i1 @isnan_float(float noundef %a) { |
| 21 |
entry: |
| 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.isnan |
| 27 |
} |
| 28 |
|
| 29 |
define noundef <4 x i1> @isnan_half4(<4 x half> noundef %a) { |
| 30 |
entry: |
| 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.isnan |
| 36 |
} |
| 37 |
|
| 38 |
define noundef <4 x i1> @isnan_float4(<4 x float> noundef %a) { |
| 39 |
entry: |
| 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.isnan |
| 45 |
} |