1; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV 2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} 3 4; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV 5; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %} 6 7; CHECK-SPIRV-DAG: %[[#TyFloat:]] = OpTypeFloat 32 8; CHECK-SPIRV-DAG: %[[#TyHalf:]] = OpTypeFloat 16 9 10;; The OpDot operands must be vectors; check that translating dot with 11;; scalar arguments does not result in OpDot. 12; CHECK-SPIRV-LABEL: %[[#]] = OpFunction %[[#]] None %[[#]] 13; CHECK-SPIRV: %[[#]] = OpFMul %[[#]] %[[#]] %[[#]] 14; CHECK-SPIRV-NOT: %[[#]] = OpDot %[[#]] %[[#]] %[[#]] 15; CHECK-SPIRV: OpFunctionEnd 16 17define spir_kernel void @testScalar(float %f) { 18entry: 19 %call = tail call spir_func float @_Z3dotff(float %f, float %f) 20 ret void 21} 22 23;; The OpDot operands must be vectors; check that translating dot with 24;; vector arguments results in OpDot. 25; CHECK-SPIRV-LABEL: %[[#]] = OpFunction %[[#]] None %[[#]] 26; CHECK-SPIRV: %[[#]] = OpDot %[[#TyFloat]] %[[#]] %[[#]] 27; CHECK-SPIRV: %[[#]] = OpDot %[[#TyFloat]] %[[#]] %[[#]] 28; CHECK-SPIRV: %[[#]] = OpDot %[[#TyHalf]] %[[#]] %[[#]] 29; CHECK-SPIRV: OpFunctionEnd 30 31define spir_kernel void @testVector(<2 x float> %f, <2 x half> %h) { 32entry: 33 %call = tail call spir_func float @_Z3dotDv2_fS_(<2 x float> %f, <2 x float> %f) 34 %call2 = tail call spir_func float @__spirv_Dot(<2 x float> %f, <2 x float> %f) 35 %call3 = tail call spir_func half @_Z11__spirv_DotDv2_DF16_S_(<2 x half> %h, <2 x half> %h) 36 ret void 37} 38 39declare spir_func float @_Z3dotff(float, float) 40 41declare spir_func float @_Z3dotDv2_fS_(<2 x float>, <2 x float>) 42declare spir_func float @__spirv_Dot(<2 x float>, <2 x float>) 43declare spir_func half @_Z11__spirv_DotDv2_DF16_S_(<2 x half>, <2 x half>) 44