|
| 1 | +; RUN: llvm-as %s -o %t.bc |
| 2 | +; RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 3 | +; RUN: llvm-spirv %t.bc -o %t.spv |
| 4 | +; RUN: spirv-val %t.spv |
| 5 | + |
| 6 | +target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" |
| 7 | +target triple = "spir" |
| 8 | + |
| 9 | +declare dso_local spir_func <4 x i8> @_Z13__spirv_IsNanIDv4_aDv4_fET_T0_(<4 x float>) |
| 10 | +declare dso_local spir_func <4 x i8> @_Z13__spirv_IsInfIDv4_aDv4_fET_T0_(<4 x float>) |
| 11 | +declare dso_local spir_func <4 x i8> @_Z16__spirv_IsFiniteIDv4_aDv4_fET_T0_(<4 x float>) |
| 12 | +declare dso_local spir_func <4 x i8> @_Z16__spirv_IsNormalIDv4_aDv4_fET_T0_(<4 x float>) |
| 13 | +declare dso_local spir_func <4 x i8> @_Z18__spirv_SignBitSetIDv4_aDv4_fET_T0_(<4 x float>) |
| 14 | + |
| 15 | +; CHECK-SPIRV: {{[0-9]+}} TypeBool [[TBool:[0-9]+]] |
| 16 | +; CHECK-SPIRV: {{[0-9]+}} TypeVector [[TBoolVec:[0-9]+]] [[TBool]] |
| 17 | + |
| 18 | +; Function Attrs: nounwind readnone |
| 19 | +define spir_kernel void @k() #0 !kernel_arg_addr_space !0 !kernel_arg_access_qual !0 !kernel_arg_type !0 !kernel_arg_base_type !0 !kernel_arg_type_qual !0 { |
| 20 | +entry: |
| 21 | + %arg1 = alloca <4 x float>, align 16 |
| 22 | + %ret = alloca <4 x i8>, align 4 |
| 23 | + %0 = load <4 x float>, <4 x float>* %arg1, align 16 |
| 24 | + %call1 = call spir_func <4 x i8> @_Z13__spirv_IsNanIDv4_aDv4_fET_T0_(<4 x float> %0) |
| 25 | +; CHECK-SPIRV: {{[0-9]+}} IsNan [[TBoolVec]] [[IsNanRes:[0-9]+]] |
| 26 | +; CHECK-SPIRV: {{[0-9]+}} Select {{[0-9]+}} [[SelectRes:[0-9]+]] [[IsNanRes]] |
| 27 | +; CHECK-SPIRV: {{[0-9]+}} Store {{[0-9]+}} [[SelectRes]] |
| 28 | + store <4 x i8> %call1, <4 x i8>* %ret, align 4 |
| 29 | + %call2 = call spir_func <4 x i8> @_Z13__spirv_IsInfIDv4_aDv4_fET_T0_(<4 x float> %0) |
| 30 | +; CHECK-SPIRV: {{[0-9]+}} IsInf [[TBoolVec]] [[IsInfRes:[0-9]+]] |
| 31 | +; CHECK-SPIRV: {{[0-9]+}} Select {{[0-9]+}} [[Select1Res:[0-9]+]] [[IsInfRes]] |
| 32 | +; CHECK-SPIRV: {{[0-9]+}} Store {{[0-9]+}} [[Select1Res]] |
| 33 | + store <4 x i8> %call2, <4 x i8>* %ret, align 4 |
| 34 | + %call3 = call spir_func <4 x i8> @_Z16__spirv_IsFiniteIDv4_aDv4_fET_T0_(<4 x float> %0) |
| 35 | +; CHECK-SPIRV: {{[0-9]+}} IsFinite [[TBoolVec]] [[IsFiniteRes:[0-9]+]] |
| 36 | +; CHECK-SPIRV: {{[0-9]+}} Select {{[0-9]+}} [[Select2Res:[0-9]+]] [[IsFiniteRes]] |
| 37 | +; CHECK-SPIRV: {{[0-9]+}} Store {{[0-9]+}} [[Select2Res]] |
| 38 | + store <4 x i8> %call3, <4 x i8>* %ret, align 4 |
| 39 | + %call4 = call spir_func <4 x i8> @_Z16__spirv_IsNormalIDv4_aDv4_fET_T0_(<4 x float> %0) |
| 40 | +; CHECK-SPIRV: {{[0-9]+}} IsNormal [[TBoolVec]] [[IsNormalRes:[0-9]+]] |
| 41 | +; CHECK-SPIRV: {{[0-9]+}} Select {{[0-9]+}} [[Select3Res:[0-9]+]] [[IsNormalRes]] |
| 42 | +; CHECK-SPIRV: {{[0-9]+}} Store {{[0-9]+}} [[Select3Res]] |
| 43 | + store <4 x i8> %call4, <4 x i8>* %ret, align 4 |
| 44 | + %call5 = call spir_func <4 x i8> @_Z18__spirv_SignBitSetIDv4_aDv4_fET_T0_(<4 x float> %0) |
| 45 | +; CHECK-SPIRV: {{[0-9]+}} SignBitSet [[TBoolVec]] [[SignBitSetRes:[0-9]+]] |
| 46 | +; CHECK-SPIRV: {{[0-9]+}} Select {{[0-9]+}} [[Select4Res:[0-9]+]] [[SignBitSetRes]] |
| 47 | +; CHECK-SPIRV: {{[0-9]+}} Store {{[0-9]+}} [[Select4Res]] |
| 48 | + store <4 x i8> %call5, <4 x i8>* %ret, align 4 |
| 49 | + ret void |
| 50 | +} |
| 51 | + |
| 52 | +!llvm.module.flags = !{!1} |
| 53 | +!opencl.spir.version = !{!2} |
| 54 | + |
| 55 | +!0 = !{} |
| 56 | +!1 = !{i32 1, !"wchar_size", i32 4} |
| 57 | +!2 = !{i32 1, i32 2} |
0 commit comments