@@ -4186,6 +4186,44 @@ _SPIRV_OP(ConvertHandleToSamplerINTEL)
41864186_SPIRV_OP(ConvertHandleToSampledImageINTEL)
41874187#undef _SPIRV_OP
41884188
4189+ class SPIRVSubgroupBlockPrefetchINTELInst : public SPIRVInstTemplateBase {
4190+ public:
4191+ std::optional<ExtensionID> getRequiredExtension () const override {
4192+ return ExtensionID::SPV_INTEL_subgroup_buffer_prefetch;
4193+ }
4194+ SPIRVCapVec getRequiredCapability () const override {
4195+ return getVec (CapabilitySubgroupBufferPrefetchINTEL);
4196+ }
4197+ // Operand 2, if present, is the Memory Operands bitmask.
4198+ bool isOperandLiteral (unsigned I) const override { return I == 2 ; }
4199+
4200+ protected:
4201+ void validate () const override {
4202+ SPIRVInstruction::validate ();
4203+ if (getValue (Ops[0 ])->isForward ())
4204+ return ;
4205+ SPIRVErrorLog &SPVErrLog = getModule ()->getErrorLog ();
4206+ SPIRVType *PtrType = getValueType (Ops[0 ]);
4207+ std::string InstName = " OpSubgroupBlockPrefetchINTEL" ;
4208+ SPVErrLog.checkError (PtrType->isTypePointer (), SPIRVEC_InvalidInstruction,
4209+ InstName + " \n Ptr must be a pointer\n " );
4210+ SPVErrLog.checkError (
4211+ PtrType->getPointerStorageClass () == StorageClassCrossWorkgroup,
4212+ SPIRVEC_InvalidInstruction,
4213+ InstName + " \n Ptr must be in CrossWorkgroup storage class\n " );
4214+ SPVErrLog.checkError (PtrType->getPointerElementType ()->isTypeInt (),
4215+ SPIRVEC_InvalidInstruction,
4216+ InstName +
4217+ " \n Ptr must point to a scalar integer type\n " );
4218+ SPVErrLog.checkError (
4219+ getValueType (Ops[1 ])->isTypeInt (32 ), SPIRVEC_InvalidInstruction,
4220+ InstName + " \n NumBytes must be a 32-bit integer scalar\n " );
4221+ }
4222+ };
4223+ typedef SPIRVInstTemplate<SPIRVSubgroupBlockPrefetchINTELInst,
4224+ OpSubgroupBlockPrefetchINTEL, false , 3 , true >
4225+ SPIRVSubgroupBlockPrefetchINTEL;
4226+
41894227class SPIRVSubgroup2DBlockIOINTELInst : public SPIRVInstTemplateBase {
41904228public:
41914229 std::optional<ExtensionID> getRequiredExtension () const override {
0 commit comments