Fix insertion into <4 x i8>
- Use Not rather than LogicalNot
- Register the last SPIR-V instruction ID for
the LLVM insertion.
Fixes https://github.com/google/clspv/issues/44
diff --git a/lib/SPIRVProducerPass.cpp b/lib/SPIRVProducerPass.cpp
index 3a03852..a0204c6 100644
--- a/lib/SPIRVProducerPass.cpp
+++ b/lib/SPIRVProducerPass.cpp
@@ -3946,7 +3946,7 @@
uint32_t InvMaskID = nextID;
- Inst = new SPIRVInstruction(4, spv::OpLogicalNot, nextID++, Ops);
+ Inst = new SPIRVInstruction(4, spv::OpNot, nextID++, Ops);
SPIRVInstList.push_back(Inst);
// Apply mask.
@@ -3998,6 +3998,8 @@
Op1IDOp = new SPIRVOperand(SPIRVOperandType::NUMBERID, Op1ID);
Ops.push_back(Op1IDOp);
+ VMap[&I] = nextID;
+
Inst = new SPIRVInstruction(5, spv::OpBitwiseOr, nextID++, Ops);
SPIRVInstList.push_back(Inst);
@@ -5795,6 +5797,7 @@
case spv::OpBitwiseOr:
case spv::OpBitwiseXor:
case spv::OpBitwiseAnd:
+ case spv::OpNot:
case spv::OpShiftLeftLogical:
case spv::OpShiftRightLogical:
case spv::OpShiftRightArithmetic:
@@ -6020,6 +6023,7 @@
case spv::OpBitwiseOr:
case spv::OpBitwiseXor:
case spv::OpBitwiseAnd:
+ case spv::OpNot:
case spv::OpShiftLeftLogical:
case spv::OpShiftRightLogical:
case spv::OpShiftRightArithmetic: