-
Notifications
You must be signed in to change notification settings - Fork 253
Start preparing for TypeJointMatrixINTEL switch #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,7 +199,8 @@ bool SPIRVType::isTypeStruct() const { return OpCode == OpTypeStruct; } | |
| bool SPIRVType::isTypeVector() const { return OpCode == OpTypeVector; } | ||
|
|
||
| bool SPIRVType::isTypeJointMatrixINTEL() const { | ||
| return OpCode == internal::OpTypeJointMatrixINTEL; | ||
| return OpCode == internal::OpTypeJointMatrixINTEL || | ||
| OpCode == internal::OpTypeJointMatrixINTELv2; | ||
| } | ||
|
|
||
| bool SPIRVType::isTypeVectorBool() const { | ||
|
|
@@ -279,13 +280,19 @@ void SPIRVTypeForwardPointer::decode(std::istream &I) { | |
| } | ||
|
|
||
| SPIRVTypeJointMatrixINTEL::SPIRVTypeJointMatrixINTEL( | ||
| SPIRVModule *M, SPIRVId TheId, SPIRVType *CompType, | ||
| SPIRVModule *M, SPIRVId TheId, Op OC, SPIRVType *CompType, | ||
| std::vector<SPIRVValue *> Args) | ||
| : SPIRVType(M, FixedWC + Args.size(), OC, TheId), CompType(CompType), | ||
| Args(Args) {} | ||
|
|
||
| SPIRVTypeJointMatrixINTEL::SPIRVTypeJointMatrixINTEL( | ||
| SPIRVModule *M, SPIRVId TheId, SPIRVType *CompType, | ||
| std::vector<SPIRVValue *> Args) | ||
| : SPIRVType(M, FixedWC + Args.size(), internal::OpTypeJointMatrixINTEL, | ||
| TheId), CompType(CompType), Args(Args) {} | ||
|
||
|
|
||
| SPIRVTypeJointMatrixINTEL::SPIRVTypeJointMatrixINTEL() | ||
| : SPIRVType(OC), CompType(nullptr), | ||
| : SPIRVType(internal::OpTypeJointMatrixINTEL), CompType(nullptr), | ||
| Args({nullptr, nullptr, nullptr, nullptr}) {} | ||
|
|
||
| void SPIRVTypeJointMatrixINTEL::encode(spv_ostream &O) const { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1060,13 +1060,18 @@ class SPIRVTypeTokenINTEL : public SPIRVType { | |
| }; | ||
|
|
||
| class SPIRVTypeJointMatrixINTEL : public SPIRVType { | ||
| Op OC; | ||
| SPIRVType *CompType; | ||
| std::vector<SPIRVValue *> Args; | ||
|
|
||
| public: | ||
| const static Op OC = internal::OpTypeJointMatrixINTEL; | ||
| const static SPIRVWord FixedWC = 3; | ||
| // Complete constructor | ||
| // Complete constructor with non-default OC | ||
| SPIRVTypeJointMatrixINTEL(SPIRVModule *M, SPIRVId TheId, Op OC, | ||
| SPIRVType *CompType, | ||
| std::vector<SPIRVValue *> Args); | ||
|
|
||
| // Incomplete constructor for default OC | ||
| SPIRVTypeJointMatrixINTEL(SPIRVModule *M, SPIRVId TheId, SPIRVType *CompType, | ||
| std::vector<SPIRVValue *> Args); | ||
| // Incomplete constructor | ||
|
|
@@ -1085,11 +1090,25 @@ class SPIRVTypeJointMatrixINTEL : public SPIRVType { | |
| SPIRVType *getCompType() const { return CompType; } | ||
| SPIRVValue *getRows() const { return Args[0]; } | ||
| SPIRVValue *getColumns() const { return Args[1]; } | ||
| SPIRVValue *getLayout() const { return Args[2]; } | ||
| SPIRVValue *getScope() const { return Args[3]; } | ||
| SPIRVValue *getUse() const { return Args.size() > 4 ? Args[4] : nullptr; } | ||
| SPIRVValue *getLayout() const { | ||
| if (this->getOpCode() == internal::OpTypeJointMatrixINTEL) | ||
| return Args[2]; | ||
| return nullptr; | ||
| } | ||
| SPIRVValue *getScope() const { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please separate this methods by blank lines?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied |
||
| if (this->getOpCode() == internal::OpTypeJointMatrixINTEL) | ||
| return Args[3]; | ||
| return Args[2]; | ||
| } | ||
| SPIRVValue *getUse() const { | ||
| if (this->getOpCode() == internal::OpTypeJointMatrixINTEL) | ||
| return Args.size() > 4 ? Args[4] : nullptr; | ||
| return Args[3]; | ||
| } | ||
| SPIRVValue *getComponentTypeInterpretation() const { | ||
| return Args.size() > 5 ? Args[5] : nullptr; | ||
| if (this->getOpCode() == internal::OpTypeJointMatrixINTEL) | ||
| return Args.size() > 5 ? Args[5] : nullptr; | ||
| return Args.size() > 4 ? Args[4] : nullptr; | ||
| } | ||
| }; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maksimsab move of scope parameter happens here (see the second 'true').
Note, that 'scope' according to old spec is mandatory parameter and per new spec is removed at all. So to balance it here making both representations translatable we have to add is as optional for a while.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.