brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.5 KiB · 38ec4db Raw
191 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}3 4; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_function_pointers %s -o - | FileCheck %s5; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}6 7; CHECK-DAG: %[[Half:.*]] = OpTypeFloat 168; CHECK-DAG: %[[HalfVec2:.*]] = OpTypeVector %[[Half]] 29; CHECK-DAG: %[[HalfVec3:.*]] = OpTypeVector %[[Half]] 310 11; CHECK-DAG: %[[Float:.*]] = OpTypeFloat 3212; CHECK-DAG: %[[FloatVec2:.*]] = OpTypeVector %[[Float]] 213; CHECK-DAG: %[[FloatVec3:.*]] = OpTypeVector %[[Float]] 314 15; CHECK-DAG: %[[Double:.*]] = OpTypeFloat 6416; CHECK-DAG: %[[DoubleVec2:.*]] = OpTypeVector %[[Double]] 217; CHECK-DAG: %[[DoubleVec3:.*]] = OpTypeVector %[[Double]] 318 19; CHECK: OpFunction20; CHECK: %[[Param2Half:.*]] = OpFunctionParameter %[[Half]]21; CHECK: %[[ParamVec2Half:.*]] = OpFunctionParameter %[[HalfVec2]]22; CHECK: %[[Vec2HalfItem0:.*]] = OpCompositeExtract %[[Half]] %[[ParamVec2Half]] 023; CHECK: %[[Vec2HalfR1:.*]] = OpFAdd %[[Half]] %[[Param2Half]] %[[Vec2HalfItem0]]24; CHECK: %[[Vec2HalfItem1:.*]] = OpCompositeExtract %[[Half]] %[[ParamVec2Half]] 125; CHECK: %[[Vec2HalfR2:.*]] = OpFAdd %[[Half]] %[[Vec2HalfR1]] %[[Vec2HalfItem1]]26; CHECK: OpReturnValue %[[Vec2HalfR2]]27; CHECK: OpFunctionEnd28 29; CHECK: OpFunction30; CHECK: %[[Param2Half:.*]] = OpFunctionParameter %[[Half]]31; CHECK: %[[ParamVec3Half:.*]] = OpFunctionParameter %[[HalfVec3]]32; CHECK: %[[Vec3HalfItem0:.*]] = OpCompositeExtract %[[Half]] %[[ParamVec3Half]] 033; CHECK: %[[Vec3HalfR1:.*]] = OpFAdd %[[Half]] %[[Param2Half]] %[[Vec3HalfItem0]]34; CHECK: %[[Vec3HalfItem1:.*]] = OpCompositeExtract %[[Half]] %[[ParamVec3Half]] 135; CHECK: %[[Vec3HalfR2:.*]] = OpFAdd %[[Half]] %[[Vec3HalfR1]] %[[Vec3HalfItem1]]36; CHECK: %[[Vec3HalfItem2:.*]] = OpCompositeExtract %[[Half]] %[[ParamVec3Half]] 237; CHECK: %[[Vec3HalfR3:.*]] = OpFAdd %[[Half]] %[[Vec3HalfR2]] %[[Vec3HalfItem2]]38; CHECK: OpReturnValue %[[Vec3HalfR3]]39; CHECK: OpFunctionEnd40 41; CHECK: OpFunction42; CHECK: %[[Param2Float:.*]] = OpFunctionParameter %[[Float]]43; CHECK: %[[ParamVec2Float:.*]] = OpFunctionParameter %[[FloatVec2]]44; CHECK: %[[Vec2FloatItem0:.*]] = OpCompositeExtract %[[Float]] %[[ParamVec2Float]] 045; CHECK: %[[Vec2FloatR1:.*]] = OpFAdd %[[Float]] %[[Param2Float]] %[[Vec2FloatItem0]]46; CHECK: %[[Vec2FloatItem1:.*]] = OpCompositeExtract %[[Float]] %[[ParamVec2Float]] 147; CHECK: %[[Vec2FloatR2:.*]] = OpFAdd %[[Float]] %[[Vec2FloatR1]] %[[Vec2FloatItem1]]48; CHECK: OpReturnValue %[[Vec2FloatR2]]49; CHECK: OpFunctionEnd50 51; CHECK: OpFunction52; CHECK: %[[Param2Float:.*]] = OpFunctionParameter %[[Float]]53; CHECK: %[[ParamVec3Float:.*]] = OpFunctionParameter %[[FloatVec3]]54; CHECK: %[[Vec3FloatItem0:.*]] = OpCompositeExtract %[[Float]] %[[ParamVec3Float]] 055; CHECK: %[[Vec3FloatR1:.*]] = OpFAdd %[[Float]] %[[Param2Float]] %[[Vec3FloatItem0]]56; CHECK: %[[Vec3FloatItem1:.*]] = OpCompositeExtract %[[Float]] %[[ParamVec3Float]] 157; CHECK: %[[Vec3FloatR2:.*]] = OpFAdd %[[Float]] %[[Vec3FloatR1]] %[[Vec3FloatItem1]]58; CHECK: %[[Vec3FloatItem2:.*]] = OpCompositeExtract %[[Float]] %[[ParamVec3Float]] 259; CHECK: %[[Vec3FloatR3:.*]] = OpFAdd %[[Float]] %[[Vec3FloatR2]] %[[Vec3FloatItem2]]60; CHECK: OpReturnValue %[[Vec3FloatR3]]61; CHECK: OpFunctionEnd62 63; CHECK: OpFunction64; CHECK: %[[Param2Double:.*]] = OpFunctionParameter %[[Double]]65; CHECK: %[[ParamVec2Double:.*]] = OpFunctionParameter %[[DoubleVec2]]66; CHECK: %[[Vec2DoubleItem0:.*]] = OpCompositeExtract %[[Double]] %[[ParamVec2Double]] 067; CHECK: %[[Vec2DoubleR1:.*]] = OpFAdd %[[Double]] %[[Param2Double]] %[[Vec2DoubleItem0]]68; CHECK: %[[Vec2DoubleItem1:.*]] = OpCompositeExtract %[[Double]] %[[ParamVec2Double]] 169; CHECK: %[[Vec2DoubleR2:.*]] = OpFAdd %[[Double]] %[[Vec2DoubleR1]] %[[Vec2DoubleItem1]]70; CHECK: OpReturnValue %[[Vec2DoubleR2]]71; CHECK: OpFunctionEnd72 73; CHECK: OpFunction74; CHECK: %[[Param2Double:.*]] = OpFunctionParameter %[[Double]]75; CHECK: %[[ParamVec3Double:.*]] = OpFunctionParameter %[[DoubleVec3]]76; CHECK: %[[Vec3DoubleItem0:.*]] = OpCompositeExtract %[[Double]] %[[ParamVec3Double]] 077; CHECK: %[[Vec3DoubleR1:.*]] = OpFAdd %[[Double]] %[[Param2Double]] %[[Vec3DoubleItem0]]78; CHECK: %[[Vec3DoubleItem1:.*]] = OpCompositeExtract %[[Double]] %[[ParamVec3Double]] 179; CHECK: %[[Vec3DoubleR2:.*]] = OpFAdd %[[Double]] %[[Vec3DoubleR1]] %[[Vec3DoubleItem1]]80; CHECK: %[[Vec3DoubleItem2:.*]] = OpCompositeExtract %[[Double]] %[[ParamVec3Double]] 281; CHECK: %[[Vec3DoubleR3:.*]] = OpFAdd %[[Double]] %[[Vec3DoubleR2]] %[[Vec3DoubleItem2]]82; CHECK: OpReturnValue %[[Vec3DoubleR3]]83; CHECK: OpFunctionEnd84 85define spir_func half @test_vector_reduce_fadd_v2half(half %sp, <2 x half> %v) {86entry:87  %res = call half @llvm.vector.reduce.fadd.v2half(half %sp, <2 x half> %v)88  ret half %res89}90 91define spir_func half @test_vector_reduce_fadd_v3half(half %sp, <3 x half> %v) {92entry:93  %res = call half @llvm.vector.reduce.fadd.v3half(half %sp, <3 x half> %v)94  ret half %res95}96 97define spir_func half @test_vector_reduce_fadd_v4half(half %sp, <4 x half> %v) {98entry:99  %res = call half @llvm.vector.reduce.fadd.v4half(half %sp, <4 x half> %v)100  ret half %res101}102 103define spir_func half @test_vector_reduce_fadd_v8half(half %sp, <8 x half> %v) {104entry:105  %res = call half @llvm.vector.reduce.fadd.v8half(half %sp, <8 x half> %v)106  ret half %res107}108 109define spir_func half @test_vector_reduce_fadd_v16half(half %sp, <16 x half> %v) {110entry:111  %res = call half @llvm.vector.reduce.fadd.v16half(half %sp, <16 x half> %v)112  ret half %res113}114 115define spir_func float @test_vector_reduce_fadd_v2float(float %sp, <2 x float> %v) {116entry:117  %res = call float @llvm.vector.reduce.fadd.v2float(float %sp, <2 x float> %v)118  ret float %res119}120 121define spir_func float @test_vector_reduce_fadd_v3float(float %sp, <3 x float> %v) {122entry:123  %res = call float @llvm.vector.reduce.fadd.v3float(float %sp, <3 x float> %v)124  ret float %res125}126 127define spir_func float @test_vector_reduce_fadd_v4float(float %sp, <4 x float> %v) {128entry:129  %res = call float @llvm.vector.reduce.fadd.v4float(float %sp, <4 x float> %v)130  ret float %res131}132 133define spir_func float @test_vector_reduce_fadd_v8float(float %sp, <8 x float> %v) {134entry:135  %res = call float @llvm.vector.reduce.fadd.v8float(float %sp, <8 x float> %v)136  ret float %res137}138 139define spir_func float @test_vector_reduce_fadd_v16float(float %sp, <16 x float> %v) {140entry:141  %res = call float @llvm.vector.reduce.fadd.v16float(float %sp, <16 x float> %v)142  ret float %res143}144 145 146define spir_func double @test_vector_reduce_fadd_v2double(double %sp, <2 x double> %v) {147entry:148  %res = call double @llvm.vector.reduce.fadd.v2double(double %sp, <2 x double> %v)149  ret double %res150}151 152define spir_func double @test_vector_reduce_fadd_v3double(double %sp, <3 x double> %v) {153entry:154  %res = call double @llvm.vector.reduce.fadd.v3double(double %sp, <3 x double> %v)155  ret double %res156}157 158define spir_func double @test_vector_reduce_fadd_v4double(double %sp, <4 x double> %v) {159entry:160  %res = call double @llvm.vector.reduce.fadd.v4double(double %sp, <4 x double> %v)161  ret double %res162}163 164define spir_func double @test_vector_reduce_fadd_v8double(double %sp, <8 x double> %v) {165entry:166  %res = call double @llvm.vector.reduce.fadd.v8double(double %sp, <8 x double> %v)167  ret double %res168}169 170define spir_func double @test_vector_reduce_fadd_v16double(double %sp, <16 x double> %v) {171entry:172  %res = call double @llvm.vector.reduce.fadd.v16double(double %sp, <16 x double> %v)173  ret double %res174}175 176declare half @llvm.vector.reduce.fadd.v2half(half, <2 x half>)177declare half @llvm.vector.reduce.fadd.v3half(half, <3 x half>)178declare half @llvm.vector.reduce.fadd.v4half(half, <4 x half>)179declare half @llvm.vector.reduce.fadd.v8half(half, <8 x half>)180declare half @llvm.vector.reduce.fadd.v16half(half, <16 x half>)181declare float @llvm.vector.reduce.fadd.v2float(float, <2 x float>)182declare float @llvm.vector.reduce.fadd.v3float(float, <3 x float>)183declare float @llvm.vector.reduce.fadd.v4float(float, <4 x float>)184declare float @llvm.vector.reduce.fadd.v8float(float, <8 x float>)185declare float @llvm.vector.reduce.fadd.v16float(float, <16 x float>)186declare double @llvm.vector.reduce.fadd.v2double(double, <2 x double>)187declare double @llvm.vector.reduce.fadd.v3double(double, <3 x double>)188declare double @llvm.vector.reduce.fadd.v4double(double, <4 x double>)189declare double @llvm.vector.reduce.fadd.v8double(double, <8 x double>)190declare double @llvm.vector.reduce.fadd.v16double(double, <16 x double>)191