1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV
3 declare dso_local spir_func <4 x i8> @_Z13__spirv_IsNanIDv4_aDv4_fET_T0_(<4 x float>)
4 declare dso_local spir_func <4 x i8> @_Z13__spirv_IsInfIDv4_aDv4_fET_T0_(<4 x float>)
5 declare dso_local spir_func <4 x i8> @_Z16__spirv_IsFiniteIDv4_aDv4_fET_T0_(<4 x float>)
6 declare dso_local spir_func <4 x i8> @_Z16__spirv_IsNormalIDv4_aDv4_fET_T0_(<4 x float>)
7 declare dso_local spir_func <4 x i8> @_Z18__spirv_SignBitSetIDv4_aDv4_fET_T0_(<4 x float>)
9 ; CHECK-SPIRV: %[[#TBool:]] = OpTypeBool
10 ; CHECK-SPIRV: %[[#TBoolVec:]] = OpTypeVector %[[#TBool]]
12 define spir_kernel void @k() {
14 %arg1 = alloca <4 x float>, align 16
15 %ret = alloca <4 x i8>, align 4
16 %0 = load <4 x float>, <4 x float>* %arg1, align 16
17 %call1 = call spir_func <4 x i8> @_Z13__spirv_IsNanIDv4_aDv4_fET_T0_(<4 x float> %0)
18 ; CHECK-SPIRV: %[[#IsNanRes:]] = OpIsNan %[[#TBoolVec]]
19 ; CHECK-SPIRV: %[[#SelectRes:]] = OpSelect %[[#]] %[[#IsNanRes]]
20 ; CHECK-SPIRV: OpStore %[[#]] %[[#SelectRes]]
21 store <4 x i8> %call1, <4 x i8>* %ret, align 4
22 %call2 = call spir_func <4 x i8> @_Z13__spirv_IsInfIDv4_aDv4_fET_T0_(<4 x float> %0)
23 ; CHECK-SPIRV: %[[#IsInfRes:]] = OpIsInf %[[#TBoolVec]]
24 ; CHECK-SPIRV: %[[#Select1Res:]] = OpSelect %[[#]] %[[#IsInfRes]]
25 ; CHECK-SPIRV: OpStore %[[#]] %[[#Select1Res]]
26 store <4 x i8> %call2, <4 x i8>* %ret, align 4
27 %call3 = call spir_func <4 x i8> @_Z16__spirv_IsFiniteIDv4_aDv4_fET_T0_(<4 x float> %0)
28 ; CHECK-SPIRV: %[[#IsFiniteRes:]] = OpIsFinite %[[#TBoolVec]]
29 ; CHECK-SPIRV: %[[#Select2Res:]] = OpSelect %[[#]] %[[#IsFiniteRes]]
30 ; CHECK-SPIRV: OpStore %[[#]] %[[#Select2Res]]
31 store <4 x i8> %call3, <4 x i8>* %ret, align 4
32 %call4 = call spir_func <4 x i8> @_Z16__spirv_IsNormalIDv4_aDv4_fET_T0_(<4 x float> %0)
33 ; CHECK-SPIRV: %[[#IsNormalRes:]] = OpIsNormal %[[#TBoolVec]]
34 ; CHECK-SPIRV: %[[#Select3Res:]] = OpSelect %[[#]] %[[#IsNormalRes]]
35 ; CHECK-SPIRV: OpStore %[[#]] %[[#Select3Res]]
36 store <4 x i8> %call4, <4 x i8>* %ret, align 4
37 %call5 = call spir_func <4 x i8> @_Z18__spirv_SignBitSetIDv4_aDv4_fET_T0_(<4 x float> %0)
38 ; CHECK-SPIRV: %[[#SignBitSetRes:]] = OpSignBitSet %[[#TBoolVec]]
39 ; CHECK-SPIRV: %[[#Select4Res:]] = OpSelect %[[#]] %[[#SignBitSetRes]]
40 ; CHECK-SPIRV: OpStore %[[#]] %[[#Select4Res]]
41 store <4 x i8> %call5, <4 x i8>* %ret, align 4