Skip to content

Commit 1ed74b1

Browse files
MrSidimsmateuszchudyk
authored andcommitted
[Backport to 15] Split JointMatrixMadINTEL instruction into 4 (KhronosGroup#1833)
JointMatrixMadINTEL will stand for signed/signed Matrix type JointMatrixSUMadINTEL will stand for signed/signed Matrix type JointMatrixUSMadINTEL will stand for unsigned/signed Matrix type JointMatrixUUMadINTEL will stand for unsigned/unsigned Matrix type Spec update: intel/llvm#8175 Signed-off-by: Dmitry Sidorov dmitry.sidorov@intel.com
1 parent 5be08b8 commit 1ed74b1

File tree

5 files changed

+53
-26
lines changed

5 files changed

+53
-26
lines changed

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -606,14 +606,9 @@ SPIRVType *LLVMToSPIRVBase::transPointerType(SPIRVType *ET, unsigned AddrSpc) {
606606
return TranslatedTy;
607607
}
608608

609-
// Representation in LLVM IR before the translator is a pointer array wrapped
610-
// in a structure:
611-
// %struct.__spirv_JointMatrixINTEL = type { [R x [C x [L x [S x type]]]]* }
612-
// where R = Rows, C = Columnts, L = Layout + 1, S = Scope + 1
613-
// this '+1' for the Layout and Scope is required because both of them can
614-
// be '0', but array size can not be '0'.
615-
// The result should look like SPIR-V friendly LLVM IR:
616-
// %spirv.JointMatrixINTEL._char_2_2_0_3
609+
// Representation in LLVM IR before the translator is a pointer to an opaque
610+
// structure:
611+
// %spirv.JointMatrixINTEL._%element_type%_%rows%_%cols%_%scope%_%use%
617612
// Here we check the structure name yet again. Another option would be to
618613
// check SPIR-V friendly function calls (by their name) and obtain return
619614
// or their parameter types, assuming, that the appropriate types are Matrix

lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3330,6 +3330,9 @@ class SPIRVJointMatrixINTELInst : public SPIRVJointMatrixINTELInstBase {
33303330
_SPIRV_OP(JointMatrixLoad, true, 6, true)
33313331
_SPIRV_OP(JointMatrixStore, false, 5, true)
33323332
_SPIRV_OP(JointMatrixMad, true, 7)
3333+
_SPIRV_OP(JointMatrixSUMad, true, 7)
3334+
_SPIRV_OP(JointMatrixUSMad, true, 7)
3335+
_SPIRV_OP(JointMatrixUUMad, true, 7)
33333336
_SPIRV_OP(JointMatrixWorkItemLength, true, 4)
33343337
#undef _SPIRV_OP
33353338

lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ _SPIRV_OP_INTERNAL(TypeJointMatrixINTEL, internal::OpTypeJointMatrixINTEL)
99
_SPIRV_OP_INTERNAL(JointMatrixLoadINTEL, internal::OpJointMatrixLoadINTEL)
1010
_SPIRV_OP_INTERNAL(JointMatrixStoreINTEL, internal::OpJointMatrixStoreINTEL)
1111
_SPIRV_OP_INTERNAL(JointMatrixMadINTEL, internal::OpJointMatrixMadINTEL)
12+
_SPIRV_OP_INTERNAL(JointMatrixSUMadINTEL, internal::OpJointMatrixSUMadINTEL)
13+
_SPIRV_OP_INTERNAL(JointMatrixUSMadINTEL, internal::OpJointMatrixUSMadINTEL)
14+
_SPIRV_OP_INTERNAL(JointMatrixUUMadINTEL, internal::OpJointMatrixUUMadINTEL)
1215
_SPIRV_OP_INTERNAL(JointMatrixWorkItemLengthINTEL,
1316
internal::OpJointMatrixWorkItemLengthINTEL)
1417
_SPIRV_OP_INTERNAL(ComplexFMulINTEL, internal::ComplexFMulINTEL)

lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ enum InternalOp {
6565
IOpJointMatrixLoadINTEL = 6120,
6666
IOpJointMatrixStoreINTEL = 6121,
6767
IOpJointMatrixMadINTEL = 6122,
68+
IOpJointMatrixSUMadINTEL = 6128,
69+
IOpJointMatrixUSMadINTEL = 6129,
70+
IOpJointMatrixUUMadINTEL = 6130,
6871
IOpArithmeticFenceINTEL = 6145,
6972
IOpJointMatrixWorkItemLengthINTEL = 6410,
7073
IOpComplexFMulINTEL = 6415,
@@ -138,6 +141,9 @@ _SPIRV_OP(Op, TypeJointMatrixINTEL)
138141
_SPIRV_OP(Op, JointMatrixLoadINTEL)
139142
_SPIRV_OP(Op, JointMatrixStoreINTEL)
140143
_SPIRV_OP(Op, JointMatrixMadINTEL)
144+
_SPIRV_OP(Op, JointMatrixSUMadINTEL)
145+
_SPIRV_OP(Op, JointMatrixUSMadINTEL)
146+
_SPIRV_OP(Op, JointMatrixUUMadINTEL)
141147
_SPIRV_OP(Op, JointMatrixWorkItemLengthINTEL)
142148
_SPIRV_OP(Capability, HWThreadQueryINTEL)
143149
_SPIRV_OP(BuiltIn, SubDeviceIDINTEL)

0 commit comments

Comments
 (0)