@@ -4037,6 +4037,44 @@ _SPIRV_OP(ConvertHandleToSamplerINTEL)
40374037_SPIRV_OP(ConvertHandleToSampledImageINTEL)
40384038#undef _SPIRV_OP
40394039
4040+ class SPIRVSubgroupBlockPrefetchINTELInst : public SPIRVInstTemplateBase {
4041+ public:
4042+ llvm::Optional<ExtensionID> getRequiredExtension () const override {
4043+ return ExtensionID::SPV_INTEL_subgroup_buffer_prefetch;
4044+ }
4045+ SPIRVCapVec getRequiredCapability () const override {
4046+ return getVec (CapabilitySubgroupBufferPrefetchINTEL);
4047+ }
4048+ // Operand 2, if present, is the Memory Operands bitmask.
4049+ bool isOperandLiteral (unsigned I) const override { return I == 2 ; }
4050+
4051+ protected:
4052+ void validate () const override {
4053+ SPIRVInstruction::validate ();
4054+ if (getValue (Ops[0 ])->isForward ())
4055+ return ;
4056+ SPIRVErrorLog &SPVErrLog = getModule ()->getErrorLog ();
4057+ SPIRVType *PtrType = getValueType (Ops[0 ]);
4058+ const std::string InstName = " OpSubgroupBlockPrefetchINTEL" ;
4059+ SPVErrLog.checkError (PtrType->isTypePointer (), SPIRVEC_InvalidInstruction,
4060+ InstName + " \n Ptr must be a pointer\n " );
4061+ SPVErrLog.checkError (
4062+ PtrType->getPointerStorageClass () == StorageClassCrossWorkgroup,
4063+ SPIRVEC_InvalidInstruction,
4064+ InstName + " \n Ptr must be in CrossWorkgroup storage class\n " );
4065+ SPVErrLog.checkError (PtrType->getPointerElementType ()->isTypeInt (),
4066+ SPIRVEC_InvalidInstruction,
4067+ InstName +
4068+ " \n Ptr must point to a scalar integer type\n " );
4069+ SPVErrLog.checkError (
4070+ getValueType (Ops[1 ])->isTypeInt (32 ), SPIRVEC_InvalidInstruction,
4071+ InstName + " \n NumBytes must be a 32-bit integer scalar\n " );
4072+ }
4073+ };
4074+ typedef SPIRVInstTemplate<SPIRVSubgroupBlockPrefetchINTELInst,
4075+ OpSubgroupBlockPrefetchINTEL, false , 3 , true >
4076+ SPIRVSubgroupBlockPrefetchINTEL;
4077+
40404078class SPIRVSubgroup2DBlockIOINTELInst : public SPIRVInstTemplateBase {
40414079public:
40424080 llvm::Optional<ExtensionID> getRequiredExtension () const override {
0 commit comments