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 %}
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 %}
7 ; CHECK-SPIRV-DAG: %[[#TyFloat:]] = OpTypeFloat 32
8 ; CHECK-SPIRV-DAG: %[[#TyHalf:]] = OpTypeFloat 16
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
17 define spir_kernel void @testScalar(float %f) {
19 %call = tail call spir_func float @_Z3dotff(float %f, float %f)
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
31 define spir_kernel void @testVector(<2 x float> %f, <2 x half> %h) {
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)
39 declare spir_func float @_Z3dotff(float, float)
41 declare spir_func float @_Z3dotDv2_fS_(<2 x float>, <2 x float>)
42 declare spir_func float @__spirv_Dot(<2 x float>, <2 x float>)
43 declare spir_func half @_Z11__spirv_DotDv2_DF16_S_(<2 x half>, <2 x half>)