| 1 |
119734787 65536 458752 21 0 |
| 2 |
2 Capability Addresses |
| 3 |
2 Capability Linkage |
| 4 |
2 Capability Kernel |
| 5 |
2 Capability Float64 |
| 6 |
2 Capability Matrix |
| 7 |
3 MemoryModel 2 2 |
| 8 |
8 EntryPoint 6 20 "matrix_times_vector" |
| 9 |
3 Source 3 102000 |
| 10 |
3 Name 12 "res" |
| 11 |
3 Name 13 "lhs" |
| 12 |
3 Name 14 "rhs" |
| 13 |
|
| 14 |
2 TypeVoid 5 |
| 15 |
3 TypeFloat 6 32 |
| 16 |
4 TypeVector 7 6 4 |
| 17 |
4 TypeMatrix 8 7 4 |
| 18 |
4 TypePointer 9 7 8 |
| 19 |
4 TypePointer 10 7 7 |
| 20 |
6 TypeFunction 11 5 10 9 10 |
| 21 |
|
| 22 |
5 Function 5 20 0 11 |
| 23 |
3 FunctionParameter 10 12 |
| 24 |
3 FunctionParameter 9 13 |
| 25 |
3 FunctionParameter 10 14 |
| 26 |
|
| 27 |
2 Label 15 |
| 28 |
4 Load 8 16 13 |
| 29 |
4 Load 7 17 14 |
| 30 |
5 MatrixTimesVector 7 18 16 17 |
| 31 |
3 Store 12 18 |
| 32 |
1 Return |
| 33 |
|
| 34 |
1 FunctionEnd |
| 35 |
|
| 36 |
; RUN: llvm-spirv %s -to-binary -o %t.spv |
| 37 |
; RUN: spirv-val %t.spv |
| 38 |
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc |
| 39 |
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM |
| 40 |
|
| 41 |
; CHECK-LLVM: %1 = load [4 x <4 x float>], ptr %lhs |
| 42 |
; CHECK-LLVM: %2 = load <4 x float>, ptr %rhs |
| 43 |
; CHECK-LLVM: %3 = extractelement <4 x float> %2, i32 0 |
| 44 |
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i64 0 |
| 45 |
; CHECK-LLVM: %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer |
| 46 |
; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %1, 0 |
| 47 |
; CHECK-LLVM: %5 = fmul <4 x float> %.splat, %4 |
| 48 |
; CHECK-LLVM: %6 = fadd <4 x float> zeroinitializer, %5 |
| 49 |
; CHECK-LLVM: %7 = extractelement <4 x float> %2, i32 1 |
| 50 |
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %7, i64 0 |
| 51 |
; CHECK-LLVM: %.splat2 = shufflevector <4 x float> %.splatinsert1, <4 x float> poison, <4 x i32> zeroinitializer |
| 52 |
; CHECK-LLVM: %8 = extractvalue [4 x <4 x float>] %1, 1 |
| 53 |
; CHECK-LLVM: %9 = fmul <4 x float> %.splat2, %8 |
| 54 |
; CHECK-LLVM: %10 = fadd <4 x float> %6, %9 |
| 55 |
; CHECK-LLVM: %11 = extractelement <4 x float> %2, i32 2 |
| 56 |
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %11, i64 0 |
| 57 |
; CHECK-LLVM: %.splat4 = shufflevector <4 x float> %.splatinsert3, <4 x float> poison, <4 x i32> zeroinitializer |
| 58 |
; CHECK-LLVM: %12 = extractvalue [4 x <4 x float>] %1, 2 |
| 59 |
; CHECK-LLVM: %13 = fmul <4 x float> %.splat4, %12 |
| 60 |
; CHECK-LLVM: %14 = fadd <4 x float> %10, %13 |
| 61 |
; CHECK-LLVM: %15 = extractelement <4 x float> %2, i32 3 |
| 62 |
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %15, i64 0 |
| 63 |
; CHECK-LLVM: %.splat6 = shufflevector <4 x float> %.splatinsert5, <4 x float> poison, <4 x i32> zeroinitializer |
| 64 |
; CHECK-LLVM: %16 = extractvalue [4 x <4 x float>] %1, 3 |
| 65 |
; CHECK-LLVM: %17 = fmul <4 x float> %.splat6, %16 |
| 66 |
; CHECK-LLVM: %18 = fadd <4 x float> %14, %17 |
| 67 |
; CHECK-LLVM: store <4 x float> %18, ptr %res |
| 68 |
; CHECK-LLVM: ret void |