forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for reading OpMatrixTimesScalar
Consequently, reading for OpTypeMatrix is added as well. Signed-off-by: Qinglai Xiao <q.xiao@think-silicon.com>
- Loading branch information
1 parent
03389df
commit 9ed3c9d
Showing
8 changed files
with
232 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
119734787 65536 458752 21 0 | ||
2 Capability Addresses | ||
2 Capability Linkage | ||
2 Capability Kernel | ||
2 Capability Float64 | ||
2 Capability Matrix | ||
3 MemoryModel 2 2 | ||
8 EntryPoint 6 20 "matrix_times_scalar" | ||
3 Source 3 102000 | ||
3 Name 12 "res" | ||
3 Name 13 "lhs" | ||
3 Name 14 "rhs" | ||
|
||
2 TypeVoid 5 | ||
3 TypeFloat 6 32 | ||
4 TypeVector 7 6 4 | ||
4 TypeMatrix 8 7 4 | ||
4 TypePointer 9 7 8 | ||
4 TypePointer 10 7 6 | ||
6 TypeFunction 11 5 9 9 10 | ||
|
||
5 Function 5 20 0 11 | ||
3 FunctionParameter 9 12 | ||
3 FunctionParameter 9 13 | ||
3 FunctionParameter 10 14 | ||
|
||
2 Label 15 | ||
4 Load 8 16 13 | ||
4 Load 6 17 14 | ||
5 MatrixTimesScalar 8 18 16 17 | ||
3 Store 12 18 | ||
1 Return | ||
|
||
1 FunctionEnd | ||
|
||
; FIXME: LIT comments/commands are moved at the end because llvm-spirv stops | ||
; reading the file after first ';' symbol | ||
|
||
; RUN: llvm-spirv %s -to-binary -o %t.spv | ||
; RUN: spirv-val %t.spv | ||
; RUN: llvm-spirv -r %t.spv -o %t.bc | ||
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM | ||
|
||
; CHECK-LLVM: %1 = load [4 x <4 x float>], [4 x <4 x float>]* %lhs | ||
; CHECK-LLVM: %2 = load float, float* %rhs | ||
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> undef, float %2, i32 0 | ||
; CHECK-LLVM: %3 = shufflevector <4 x float> %.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer | ||
; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %1, 0 | ||
; CHECK-LLVM: %5 = fmul <4 x float> %4, %3 | ||
; CHECK-LLVM: %6 = insertvalue [4 x <4 x float>] undef, <4 x float> %5, 0 | ||
; CHECK-LLVM: %7 = extractvalue [4 x <4 x float>] %1, 1 | ||
; CHECK-LLVM: %8 = fmul <4 x float> %7, %3 | ||
; CHECK-LLVM: %9 = insertvalue [4 x <4 x float>] %6, <4 x float> %8, 1 | ||
; CHECK-LLVM: %10 = extractvalue [4 x <4 x float>] %1, 2 | ||
; CHECK-LLVM: %11 = fmul <4 x float> %10, %3 | ||
; CHECK-LLVM: %12 = insertvalue [4 x <4 x float>] %9, <4 x float> %11, 2 | ||
; CHECK-LLVM: %13 = extractvalue [4 x <4 x float>] %1, 3 | ||
; CHECK-LLVM: %14 = fmul <4 x float> %13, %3 | ||
; CHECK-LLVM: %15 = insertvalue [4 x <4 x float>] %12, <4 x float> %14, 3 | ||
; CHECK-LLVM: store [4 x <4 x float>] %15, [4 x <4 x float>]* %res |