@@ -4392,6 +4392,46 @@ class SPIRVUntypedPrefetchKHR : public SPIRVInstruction {
43924392 std::vector<SPIRVId> CacheTy;
43934393};
43944394
4395+ class SPIRVSubgroupBlockPrefetchINTELInst : public SPIRVInstTemplateBase {
4396+ public:
4397+ std::optional<ExtensionID> getRequiredExtension () const override {
4398+ return ExtensionID::SPV_INTEL_subgroup_buffer_prefetch;
4399+ }
4400+ SPIRVCapVec getRequiredCapability () const override {
4401+ return getVec (CapabilitySubgroupBufferPrefetchINTEL);
4402+ }
4403+ // Operand 2, if present, is the Memory Operands bitmask.
4404+ bool isOperandLiteral (unsigned I) const override { return I == 2 ; }
4405+
4406+ protected:
4407+ void validate () const override {
4408+ SPIRVInstruction::validate ();
4409+ if (getValue (Ops[0 ])->isForward ())
4410+ return ;
4411+ SPIRVErrorLog &SPVErrLog = getModule ()->getErrorLog ();
4412+ SPIRVType *PtrType = getValueType (Ops[0 ]);
4413+ std::string InstName = " OpSubgroupBlockPrefetchINTEL" ;
4414+ SPVErrLog.checkError (
4415+ PtrType->isTypePointer () || PtrType->isTypeUntypedPointerKHR (),
4416+ SPIRVEC_InvalidInstruction, InstName + " \n Ptr must be a pointer\n " );
4417+ SPVErrLog.checkError (
4418+ PtrType->getPointerStorageClass () == StorageClassCrossWorkgroup,
4419+ SPIRVEC_InvalidInstruction,
4420+ InstName + " \n Ptr must be in CrossWorkgroup storage class\n " );
4421+ if (!PtrType->isTypeUntypedPointerKHR ())
4422+ SPVErrLog.checkError (PtrType->getPointerElementType ()->isTypeInt (),
4423+ SPIRVEC_InvalidInstruction,
4424+ InstName +
4425+ " \n Ptr must point to a scalar integer type\n " );
4426+ SPVErrLog.checkError (
4427+ getValueType (Ops[1 ])->isTypeInt (32 ), SPIRVEC_InvalidInstruction,
4428+ InstName + " \n NumBytes must be a 32-bit integer scalar\n " );
4429+ }
4430+ };
4431+ typedef SPIRVInstTemplate<SPIRVSubgroupBlockPrefetchINTELInst,
4432+ OpSubgroupBlockPrefetchINTEL, false , 3 , true >
4433+ SPIRVSubgroupBlockPrefetchINTEL;
4434+
43954435class SPIRVSubgroup2DBlockIOINTELInst : public SPIRVInstTemplateBase {
43964436public:
43974437 std::optional<ExtensionID> getRequiredExtension () const override {
0 commit comments