163 lines · plain
1; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}3 4;; This test checks following SYCL relational builtins with float and float25;; types:6;; isfinite, isinf, isnan, isnormal, signbit, isequal, isnotequal, isgreater7;; isgreaterequal, isless, islessequal, islessgreater, isordered, isunordered8 9; CHECK-SPIRV: %[[#BoolTypeID:]] = OpTypeBool10; CHECK-SPIRV: %[[#BoolVectorTypeID:]] = OpTypeVector %[[#BoolTypeID]] 211 12; CHECK-SPIRV: OpIsFinite %[[#BoolTypeID]]13; CHECK-SPIRV: OpIsInf %[[#BoolTypeID]]14; CHECK-SPIRV: OpIsNan %[[#BoolTypeID]]15; CHECK-SPIRV: OpIsNormal %[[#BoolTypeID]]16; CHECK-SPIRV: OpSignBitSet %[[#BoolTypeID]]17; CHECK-SPIRV: OpFOrdEqual %[[#BoolTypeID]]18; CHECK-SPIRV: OpFUnordNotEqual %[[#BoolTypeID]]19; CHECK-SPIRV: OpFOrdGreaterThan %[[#BoolTypeID]]20; CHECK-SPIRV: OpFOrdGreaterThanEqual %[[#BoolTypeID]]21; CHECK-SPIRV: OpFOrdLessThan %[[#BoolTypeID]]22; CHECK-SPIRV: OpFOrdLessThanEqual %[[#BoolTypeID]]23; CHECK-SPIRV: OpFOrdNotEqual %[[#BoolTypeID]]24; CHECK-SPIRV: OpOrdered %[[#BoolTypeID]]25; CHECK-SPIRV: OpUnordered %[[#BoolTypeID]]26 27; CHECK-SPIRV: OpIsFinite %[[#BoolVectorTypeID]]28; CHECK-SPIRV: OpIsInf %[[#BoolVectorTypeID]]29; CHECK-SPIRV: OpIsNan %[[#BoolVectorTypeID]]30; CHECK-SPIRV: OpIsNormal %[[#BoolVectorTypeID]]31; CHECK-SPIRV: OpSignBitSet %[[#BoolVectorTypeID]]32; CHECK-SPIRV: OpFOrdEqual %[[#BoolVectorTypeID]]33; CHECK-SPIRV: OpFUnordNotEqual %[[#BoolVectorTypeID]]34; CHECK-SPIRV: OpFOrdGreaterThan %[[#BoolVectorTypeID]]35; CHECK-SPIRV: OpFOrdGreaterThanEqual %[[#BoolVectorTypeID]]36; CHECK-SPIRV: OpFOrdLessThan %[[#BoolVectorTypeID]]37; CHECK-SPIRV: OpFOrdLessThanEqual %[[#BoolVectorTypeID]]38; CHECK-SPIRV: OpFOrdNotEqual %[[#BoolVectorTypeID]]39; CHECK-SPIRV: OpOrdered %[[#BoolVectorTypeID]]40; CHECK-SPIRV: OpUnordered %[[#BoolVectorTypeID]]41 42define dso_local spir_func void @test_scalar(i32 addrspace(4)* nocapture writeonly %out, float %f) local_unnamed_addr {43entry:44 %call = tail call spir_func i32 @_Z8isfinitef(float %f)45 %call1 = tail call spir_func i32 @_Z5isinff(float %f)46 %add = add nsw i32 %call1, %call47 %call2 = tail call spir_func i32 @_Z5isnanf(float %f)48 %add3 = add nsw i32 %add, %call249 %call4 = tail call spir_func i32 @_Z8isnormalf(float %f)50 %add5 = add nsw i32 %add3, %call451 %call6 = tail call spir_func i32 @_Z7signbitf(float %f)52 %add7 = add nsw i32 %add5, %call653 %call8 = tail call spir_func i32 @_Z7isequalff(float %f, float %f)54 %add9 = add nsw i32 %add7, %call855 %call10 = tail call spir_func i32 @_Z10isnotequalff(float %f, float %f)56 %add11 = add nsw i32 %add9, %call1057 %call12 = tail call spir_func i32 @_Z9isgreaterff(float %f, float %f)58 %add13 = add nsw i32 %add11, %call1259 %call14 = tail call spir_func i32 @_Z14isgreaterequalff(float %f, float %f)60 %add15 = add nsw i32 %add13, %call1461 %call16 = tail call spir_func i32 @_Z6islessff(float %f, float %f)62 %add17 = add nsw i32 %add15, %call1663 %call18 = tail call spir_func i32 @_Z11islessequalff(float %f, float %f)64 %add19 = add nsw i32 %add17, %call1865 %call20 = tail call spir_func i32 @_Z13islessgreaterff(float %f, float %f)66 %add21 = add nsw i32 %add19, %call2067 %call22 = tail call spir_func i32 @_Z9isorderedff(float %f, float %f)68 %add23 = add nsw i32 %add21, %call2269 %call24 = tail call spir_func i32 @_Z11isunorderedff(float %f, float %f)70 %add25 = add nsw i32 %add23, %call2471 store i32 %add25, i32 addrspace(4)* %out, align 472 ret void73}74 75declare spir_func i32 @_Z8isfinitef(float) local_unnamed_addr76 77declare spir_func i32 @_Z5isinff(float) local_unnamed_addr78 79declare spir_func i32 @_Z5isnanf(float) local_unnamed_addr80 81declare spir_func i32 @_Z8isnormalf(float) local_unnamed_addr82 83declare spir_func i32 @_Z7signbitf(float) local_unnamed_addr84 85declare spir_func i32 @_Z7isequalff(float, float) local_unnamed_addr86 87declare spir_func i32 @_Z10isnotequalff(float, float) local_unnamed_addr88 89declare spir_func i32 @_Z9isgreaterff(float, float) local_unnamed_addr90 91declare spir_func i32 @_Z14isgreaterequalff(float, float) local_unnamed_addr92 93declare spir_func i32 @_Z6islessff(float, float) local_unnamed_addr94 95declare spir_func i32 @_Z11islessequalff(float, float) local_unnamed_addr96 97declare spir_func i32 @_Z13islessgreaterff(float, float) local_unnamed_addr98 99declare spir_func i32 @_Z9isorderedff(float, float) local_unnamed_addr100 101declare spir_func i32 @_Z11isunorderedff(float, float) local_unnamed_addr102 103define dso_local spir_func void @test_vector(<2 x i32> addrspace(4)* nocapture writeonly %out, <2 x float> %f) local_unnamed_addr {104entry:105 %call = tail call spir_func <2 x i32> @_Z8isfiniteDv2_f(<2 x float> %f)106 %call1 = tail call spir_func <2 x i32> @_Z5isinfDv2_f(<2 x float> %f)107 %add = add <2 x i32> %call1, %call108 %call2 = tail call spir_func <2 x i32> @_Z5isnanDv2_f(<2 x float> %f)109 %add3 = add <2 x i32> %add, %call2110 %call4 = tail call spir_func <2 x i32> @_Z8isnormalDv2_f(<2 x float> %f)111 %add5 = add <2 x i32> %add3, %call4112 %call6 = tail call spir_func <2 x i32> @_Z7signbitDv2_f(<2 x float> %f)113 %add7 = add <2 x i32> %add5, %call6114 %call8 = tail call spir_func <2 x i32> @_Z7isequalDv2_fS_(<2 x float> %f, <2 x float> %f)115 %add9 = add <2 x i32> %add7, %call8116 %call10 = tail call spir_func <2 x i32> @_Z10isnotequalDv2_fS_(<2 x float> %f, <2 x float> %f)117 %add11 = add <2 x i32> %add9, %call10118 %call12 = tail call spir_func <2 x i32> @_Z9isgreaterDv2_fS_(<2 x float> %f, <2 x float> %f)119 %add13 = add <2 x i32> %add11, %call12120 %call14 = tail call spir_func <2 x i32> @_Z14isgreaterequalDv2_fS_(<2 x float> %f, <2 x float> %f)121 %add15 = add <2 x i32> %add13, %call14122 %call16 = tail call spir_func <2 x i32> @_Z6islessDv2_fS_(<2 x float> %f, <2 x float> %f)123 %add17 = add <2 x i32> %add15, %call16124 %call18 = tail call spir_func <2 x i32> @_Z11islessequalDv2_fS_(<2 x float> %f, <2 x float> %f)125 %add19 = add <2 x i32> %add17, %call18126 %call20 = tail call spir_func <2 x i32> @_Z13islessgreaterDv2_fS_(<2 x float> %f, <2 x float> %f)127 %add21 = add <2 x i32> %add19, %call20128 %call22 = tail call spir_func <2 x i32> @_Z9isorderedDv2_fS_(<2 x float> %f, <2 x float> %f)129 %add23 = add <2 x i32> %add21, %call22130 %call24 = tail call spir_func <2 x i32> @_Z11isunorderedDv2_fS_(<2 x float> %f, <2 x float> %f)131 %add25 = add <2 x i32> %add23, %call24132 store <2 x i32> %add25, <2 x i32> addrspace(4)* %out, align 8133 ret void134}135 136declare spir_func <2 x i32> @_Z8isfiniteDv2_f(<2 x float>) local_unnamed_addr137 138declare spir_func <2 x i32> @_Z5isinfDv2_f(<2 x float>) local_unnamed_addr139 140declare spir_func <2 x i32> @_Z5isnanDv2_f(<2 x float>) local_unnamed_addr141 142declare spir_func <2 x i32> @_Z8isnormalDv2_f(<2 x float>) local_unnamed_addr143 144declare spir_func <2 x i32> @_Z7signbitDv2_f(<2 x float>) local_unnamed_addr145 146declare spir_func <2 x i32> @_Z7isequalDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr147 148declare spir_func <2 x i32> @_Z10isnotequalDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr149 150declare spir_func <2 x i32> @_Z9isgreaterDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr151 152declare spir_func <2 x i32> @_Z14isgreaterequalDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr153 154declare spir_func <2 x i32> @_Z6islessDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr155 156declare spir_func <2 x i32> @_Z11islessequalDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr157 158declare spir_func <2 x i32> @_Z13islessgreaterDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr159 160declare spir_func <2 x i32> @_Z9isorderedDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr161 162declare spir_func <2 x i32> @_Z11isunorderedDv2_fS_(<2 x float>, <2 x float>) local_unnamed_addr163