Skip to content

Commit 367d160

Browse files
MrSidimsdbudanov-cmplr
authored andcommitted
Add SPV_INTEL_masked_gather_scatter extension (#1580)
This extension allows TypeVector to have a Physical Pointer Type Component Type and introduces gather/scatter instructions. It will be useful for explicitly vectorized kernels. Spec: #6613 Signed-off-by: Sidorov, Dmitry <[email protected] Original commit: KhronosGroup/SPIRV-LLVM-Translator@49b08e8
1 parent e91c9da commit 367d160

File tree

13 files changed

+411
-10
lines changed

13 files changed

+411
-10
lines changed

llvm-spirv/include/LLVMSPIRVExtensions.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ EXT(SPV_INTEL_global_variable_decorations)
5454
EXT(SPV_INTEL_non_constant_addrspace_printf)
5555
EXT(SPV_INTEL_complex_float_mul_div)
5656
EXT(SPV_INTEL_split_barrier)
57+
EXT(SPV_INTEL_masked_gather_scatter)

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,12 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21312131
case OpInBoundsPtrAccessChain: {
21322132
auto AC = static_cast<SPIRVAccessChainBase *>(BV);
21332133
auto Base = transValue(AC->getBase(), F, BB);
2134-
Type *BaseTy = transType(AC->getBase()->getType()->getPointerElementType());
2134+
SPIRVType *BaseSPVTy = AC->getBase()->getType();
2135+
Type *BaseTy =
2136+
BaseSPVTy->isTypeVector()
2137+
? transType(
2138+
BaseSPVTy->getVectorComponentType()->getPointerElementType())
2139+
: transType(BaseSPVTy->getPointerElementType());
21352140
auto Index = transValue(AC->getIndices(), F, BB);
21362141
if (!AC->hasPtrIndex())
21372142
Index.insert(Index.begin(), getInt32(M, 0));
@@ -2544,6 +2549,29 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
25442549
return mapValue(
25452550
BV, Builder.CreateIntrinsic(Intrinsic::arithmetic_fence, RetTy, Val));
25462551
}
2552+
case internal::OpMaskedGatherINTEL: {
2553+
IRBuilder<> Builder(BB);
2554+
auto *Inst = static_cast<SPIRVMaskedGatherINTELInst *>(BV);
2555+
Type *RetTy = transType(Inst->getType());
2556+
Value *PtrVector = transValue(Inst->getOperand(0), F, BB);
2557+
uint32_t Alignment = Inst->getOpWord(1);
2558+
Value *Mask = transValue(Inst->getOperand(2), F, BB);
2559+
Value *FillEmpty = transValue(Inst->getOperand(3), F, BB);
2560+
return mapValue(BV, Builder.CreateMaskedGather(RetTy, PtrVector,
2561+
Align(Alignment), Mask,
2562+
FillEmpty));
2563+
}
2564+
2565+
case internal::OpMaskedScatterINTEL: {
2566+
IRBuilder<> Builder(BB);
2567+
auto *Inst = static_cast<SPIRVMaskedScatterINTELInst *>(BV);
2568+
Value *InputVector = transValue(Inst->getOperand(0), F, BB);
2569+
Value *PtrVector = transValue(Inst->getOperand(1), F, BB);
2570+
uint32_t Alignment = Inst->getOpWord(2);
2571+
Value *Mask = transValue(Inst->getOperand(3), F, BB);
2572+
return mapValue(BV, Builder.CreateMaskedScatter(InputVector, PtrVector,
2573+
Align(Alignment), Mask));
2574+
}
25472575

25482576
default: {
25492577
auto OC = BV->getOpCode();
@@ -3128,7 +3156,11 @@ std::string getSPIRVFuncSuffix(SPIRVInstruction *BI) {
31283156
}
31293157
if (BI->getOpCode() == OpGenericCastToPtrExplicit) {
31303158
Suffix += kSPIRVPostfix::Divider;
3131-
auto GenericCastToPtrInst = BI->getType()->getPointerStorageClass();
3159+
auto *Ty = BI->getType();
3160+
auto GenericCastToPtrInst =
3161+
Ty->isTypeVectorPointer()
3162+
? Ty->getVectorComponentType()->getPointerStorageClass()
3163+
: Ty->getPointerStorageClass();
31323164
switch (GenericCastToPtrInst) {
31333165
case StorageClassCrossWorkgroup:
31343166
Suffix += std::string(kSPIRVPostfix::ToGlobal);

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,19 @@ bool SPIRVRegularizeLLVMBase::regularize() {
549549
// Add an additional bitcast in case address space cast also changes
550550
// pointer element type.
551551
if (auto *ASCast = dyn_cast<AddrSpaceCastInst>(&II)) {
552-
PointerType *DestTy = cast<PointerType>(ASCast->getDestTy());
553-
PointerType *SrcTy = cast<PointerType>(ASCast->getSrcTy());
554-
if (!DestTy->hasSameElementTypeAs(SrcTy)) {
555-
PointerType *InterTy = PointerType::getWithSamePointeeType(
556-
DestTy, SrcTy->getPointerAddressSpace());
552+
Type *DestTy = ASCast->getDestTy();
553+
Type *SrcTy = ASCast->getSrcTy();
554+
if (!II.getContext().supportsTypedPointers())
555+
continue;
556+
if (DestTy->getScalarType()->getNonOpaquePointerElementType() !=
557+
SrcTy->getScalarType()->getNonOpaquePointerElementType()) {
558+
Type *InterTy = PointerType::getWithSamePointeeType(
559+
cast<PointerType>(DestTy->getScalarType()),
560+
cast<PointerType>(SrcTy->getScalarType())
561+
->getPointerAddressSpace());
562+
if (DestTy->isVectorTy())
563+
InterTy = VectorType::get(
564+
InterTy, cast<VectorType>(DestTy)->getElementCount());
557565
BitCastInst *NewBCast = new BitCastInst(
558566
ASCast->getPointerOperand(), InterTy, /*NameStr=*/"", ASCast);
559567
AddrSpaceCastInst *NewASCast =

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,28 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
346346
return transPointerType(ET, AddrSpc);
347347
}
348348

349-
if (auto *VecTy = dyn_cast<FixedVectorType>(T))
349+
if (auto *VecTy = dyn_cast<FixedVectorType>(T)) {
350+
if (VecTy->getElementType()->isPointerTy()) {
351+
// SPV_INTEL_masked_gather_scatter extension changes 2.16.1. Universal
352+
// Validation Rules:
353+
// Vector types must be parameterized only with numerical types,
354+
// [Physical Pointer Type] types or the [OpTypeBool] type.
355+
// Without it vector of pointers is not allowed in SPIR-V.
356+
if (!BM->isAllowedToUseExtension(
357+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
358+
BM->getErrorLog().checkError(
359+
false, SPIRVEC_RequiresExtension,
360+
"SPV_INTEL_masked_gather_scatter\n"
361+
"NOTE: LLVM module contains vector of pointers, translation "
362+
"of which requires this extension");
363+
return nullptr;
364+
}
365+
BM->addExtension(ExtensionID::SPV_INTEL_masked_gather_scatter);
366+
BM->addCapability(internal::CapabilityMaskedGatherScatterINTEL);
367+
}
350368
return mapType(T, BM->addVectorType(transType(VecTy->getElementType()),
351369
VecTy->getNumElements()));
370+
}
352371

353372
if (T->isArrayTy()) {
354373
// SPIR-V 1.3 s3.32.6: Length is the number of elements in the array.
@@ -3847,6 +3866,47 @@ SPIRVValue *LLVMToSPIRVBase::transIntrinsicInst(IntrinsicInst *II,
38473866
}
38483867
return Op;
38493868
}
3869+
case Intrinsic::masked_gather: {
3870+
if (!BM->isAllowedToUseExtension(
3871+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
3872+
BM->getErrorLog().checkError(
3873+
BM->isUnknownIntrinsicAllowed(II), SPIRVEC_InvalidFunctionCall, II,
3874+
"Translation of llvm.masked.gather intrinsic requires "
3875+
"SPV_INTEL_masked_gather_scatter extension or "
3876+
"-spirv-allow-unknown-intrinsics option.");
3877+
return nullptr;
3878+
}
3879+
SPIRVType *Ty = transType(II->getType());
3880+
auto *PtrVector = transValue(II->getArgOperand(0), BB);
3881+
uint32_t Alignment =
3882+
cast<ConstantInt>(II->getArgOperand(1))->getZExtValue();
3883+
auto *Mask = transValue(II->getArgOperand(2), BB);
3884+
auto *FillEmpty = transValue(II->getArgOperand(3), BB);
3885+
std::vector<SPIRVWord> Ops = {PtrVector->getId(), Alignment, Mask->getId(),
3886+
FillEmpty->getId()};
3887+
return BM->addInstTemplate(internal::OpMaskedGatherINTEL, Ops, BB, Ty);
3888+
}
3889+
case Intrinsic::masked_scatter: {
3890+
if (!BM->isAllowedToUseExtension(
3891+
ExtensionID::SPV_INTEL_masked_gather_scatter)) {
3892+
BM->getErrorLog().checkError(
3893+
BM->isUnknownIntrinsicAllowed(II), SPIRVEC_InvalidFunctionCall, II,
3894+
"Translation of llvm.masked.scatter intrinsic requires "
3895+
"SPV_INTEL_masked_gather_scatter extension or "
3896+
"-spirv-allow-unknown-intrinsics option.");
3897+
return nullptr;
3898+
}
3899+
auto *InputVector = transValue(II->getArgOperand(0), BB);
3900+
auto *PtrVector = transValue(II->getArgOperand(1), BB);
3901+
uint32_t Alignment =
3902+
cast<ConstantInt>(II->getArgOperand(2))->getZExtValue();
3903+
auto *Mask = transValue(II->getArgOperand(3), BB);
3904+
std::vector<SPIRVWord> Ops = {InputVector->getId(), PtrVector->getId(),
3905+
Alignment, Mask->getId()};
3906+
return BM->addInstTemplate(internal::OpMaskedScatterINTEL, Ops, BB,
3907+
nullptr);
3908+
}
3909+
38503910
default:
38513911
if (BM->isUnknownIntrinsicAllowed(II))
38523912
return BM->addCallInst(

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3413,6 +3413,154 @@ class SPIRVComplexFloatInst
34133413
_SPIRV_OP(ComplexFMulINTEL)
34143414
_SPIRV_OP(ComplexFDivINTEL)
34153415
#undef _SPIRV_OP
3416+
3417+
class SPIRVMaskedGatherScatterINTELInstBase : public SPIRVInstTemplateBase {
3418+
protected:
3419+
SPIRVCapVec getRequiredCapability() const override {
3420+
return getVec(internal::CapabilityMaskedGatherScatterINTEL);
3421+
}
3422+
llvm::Optional<ExtensionID> getRequiredExtension() const override {
3423+
return ExtensionID::SPV_INTEL_masked_gather_scatter;
3424+
}
3425+
};
3426+
3427+
class SPIRVMaskedGatherINTELInst
3428+
: public SPIRVMaskedGatherScatterINTELInstBase {
3429+
void validate() const override {
3430+
SPIRVInstruction::validate();
3431+
SPIRVErrorLog &SPVErrLog = this->getModule()->getErrorLog();
3432+
std::string InstName = "MaskedGatherINTEL";
3433+
3434+
SPIRVType *ResTy = this->getType();
3435+
SPVErrLog.checkError(ResTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3436+
InstName + "\nResult must be a vector type\n");
3437+
SPIRVWord ResCompCount = ResTy->getVectorComponentCount();
3438+
SPIRVType *ResCompTy = ResTy->getVectorComponentType();
3439+
3440+
SPIRVValue *PtrVec =
3441+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(0);
3442+
SPIRVType *PtrVecTy = PtrVec->getType();
3443+
SPVErrLog.checkError(
3444+
PtrVecTy->isTypeVectorPointer(), SPIRVEC_InvalidInstruction,
3445+
InstName + "\nPtrVector must be a vector of pointers type\n");
3446+
SPIRVWord PtrVecCompCount = PtrVecTy->getVectorComponentCount();
3447+
SPIRVType *PtrVecCompTy = PtrVecTy->getVectorComponentType();
3448+
SPIRVType *PtrElemTy = PtrVecCompTy->getPointerElementType();
3449+
3450+
SPVErrLog.checkError(
3451+
this->isOperandLiteral(1), SPIRVEC_InvalidInstruction,
3452+
InstName + "\nAlignment must be a constant expression integer\n");
3453+
const uint32_t Align =
3454+
static_cast<SPIRVConstant *>(
3455+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(2))
3456+
->getZExtIntValue();
3457+
SPVErrLog.checkError(
3458+
((Align & (Align - 1)) == 0), SPIRVEC_InvalidInstruction,
3459+
InstName + "\nAlignment must be 0 or power-of-two integer\n");
3460+
3461+
SPIRVValue *Mask =
3462+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(2);
3463+
SPIRVType *MaskTy = Mask->getType();
3464+
SPVErrLog.checkError(MaskTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3465+
InstName + "\nMask must be a vector type\n");
3466+
SPIRVType *MaskCompTy = MaskTy->getVectorComponentType();
3467+
SPVErrLog.checkError(MaskCompTy->isTypeBool(), SPIRVEC_InvalidInstruction,
3468+
InstName + "\nMask must be a boolean vector type\n");
3469+
SPIRVWord MaskCompCount = MaskTy->getVectorComponentCount();
3470+
3471+
SPIRVValue *FillEmpty =
3472+
const_cast<SPIRVMaskedGatherINTELInst *>(this)->getOperand(3);
3473+
SPIRVType *FillEmptyTy = FillEmpty->getType();
3474+
SPVErrLog.checkError(FillEmptyTy->isTypeVector(),
3475+
SPIRVEC_InvalidInstruction,
3476+
InstName + "\nFillEmpty must be a vector type\n");
3477+
SPIRVWord FillEmptyCompCount = FillEmptyTy->getVectorComponentCount();
3478+
SPIRVType *FillEmptyCompTy = FillEmptyTy->getVectorComponentType();
3479+
3480+
SPVErrLog.checkError(
3481+
ResCompCount == PtrVecCompCount &&
3482+
PtrVecCompCount == FillEmptyCompCount &&
3483+
FillEmptyCompCount == MaskCompCount,
3484+
SPIRVEC_InvalidInstruction,
3485+
InstName + "\nResult, PtrVector, Mask and FillEmpty vectors must have "
3486+
"the same size\n");
3487+
3488+
SPVErrLog.checkError(
3489+
ResCompTy == PtrElemTy && PtrElemTy == FillEmptyCompTy,
3490+
SPIRVEC_InvalidInstruction,
3491+
InstName + "\nComponent Type of Result and FillEmpty vector must be "
3492+
"same as base type of PtrVector the same base type\n");
3493+
}
3494+
};
3495+
3496+
class SPIRVMaskedScatterINTELInst
3497+
: public SPIRVMaskedGatherScatterINTELInstBase {
3498+
void validate() const override {
3499+
SPIRVInstruction::validate();
3500+
SPIRVErrorLog &SPVErrLog = this->getModule()->getErrorLog();
3501+
std::string InstName = "MaskedScatterINTEL";
3502+
3503+
SPIRVValue *InputVec =
3504+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(0);
3505+
SPIRVType *InputVecTy = InputVec->getType();
3506+
SPVErrLog.checkError(
3507+
InputVecTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3508+
InstName + "\nInputVector must be a vector of pointers type\n");
3509+
SPIRVWord InputVecCompCount = InputVecTy->getVectorComponentCount();
3510+
SPIRVType *InputVecCompTy = InputVecTy->getVectorComponentType();
3511+
3512+
SPIRVValue *PtrVec =
3513+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(1);
3514+
SPIRVType *PtrVecTy = PtrVec->getType();
3515+
SPVErrLog.checkError(
3516+
PtrVecTy->isTypeVectorPointer(), SPIRVEC_InvalidInstruction,
3517+
InstName + "\nPtrVector must be a vector of pointers type\n");
3518+
SPIRVWord PtrVecCompCount = PtrVecTy->getVectorComponentCount();
3519+
SPIRVType *PtrVecCompTy = PtrVecTy->getVectorComponentType();
3520+
SPIRVType *PtrElemTy = PtrVecCompTy->getPointerElementType();
3521+
3522+
SPVErrLog.checkError(
3523+
this->isOperandLiteral(2), SPIRVEC_InvalidInstruction,
3524+
InstName + "\nAlignment must be a constant expression integer\n");
3525+
const uint32_t Align =
3526+
static_cast<SPIRVConstant *>(
3527+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(2))
3528+
->getZExtIntValue();
3529+
SPVErrLog.checkError(
3530+
((Align & (Align - 1)) == 0), SPIRVEC_InvalidInstruction,
3531+
InstName + "\nAlignment must be 0 or power-of-two integer\n");
3532+
3533+
SPIRVValue *Mask =
3534+
const_cast<SPIRVMaskedScatterINTELInst *>(this)->getOperand(2);
3535+
SPIRVType *MaskTy = Mask->getType();
3536+
SPVErrLog.checkError(MaskTy->isTypeVector(), SPIRVEC_InvalidInstruction,
3537+
InstName + "\nMask must be a vector type\n");
3538+
SPIRVType *MaskCompTy = MaskTy->getVectorComponentType();
3539+
SPVErrLog.checkError(MaskCompTy->isTypeBool(), SPIRVEC_InvalidInstruction,
3540+
InstName + "\nMask must be a boolean vector type\n");
3541+
SPIRVWord MaskCompCount = MaskTy->getVectorComponentCount();
3542+
3543+
SPVErrLog.checkError(
3544+
InputVecCompCount == PtrVecCompCount &&
3545+
PtrVecCompCount == MaskCompCount,
3546+
SPIRVEC_InvalidInstruction,
3547+
InstName + "\nInputVector, PtrVector and Mask vectors must have "
3548+
"the same size\n");
3549+
3550+
SPVErrLog.checkError(
3551+
InputVecCompTy == PtrElemTy, SPIRVEC_InvalidInstruction,
3552+
InstName + "\nComponent Type of InputVector must be "
3553+
"same as base type of PtrVector the same base type\n");
3554+
}
3555+
};
3556+
3557+
#define _SPIRV_OP(x, ...) \
3558+
typedef SPIRVInstTemplate<SPIRVMaskedGatherScatterINTELInstBase, \
3559+
internal::Op##x##INTEL, __VA_ARGS__> \
3560+
SPIRV##x##INTEL;
3561+
_SPIRV_OP(MaskedGather, true, 7)
3562+
_SPIRV_OP(MaskedScatter, false, 5)
3563+
#undef _SPIRV_OP
34163564
} // namespace SPIRV
34173565

34183566
#endif // SPIRV_LIBSPIRV_SPIRVINSTRUCTION_H

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ template <> inline void SPIRVMap<Capability, std::string>::init() {
619619
add(internal::CapabilityNonConstantAddrspacePrintfINTEL,
620620
"NonConstantAddrspacePrintfINTEL");
621621
add(internal::CapabilityComplexFloatMulDivINTEL, "ComplexFloatMulDivINTEL");
622+
add(internal::CapabilityMaskedGatherScatterINTEL, "MaskedGatherScatterINTEL");
622623
}
623624
SPIRV_DEF_NAMEMAP(Capability, SPIRVCapabilityNameMap)
624625

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVOpCodeEnumInternal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ _SPIRV_OP_INTERNAL(JointMatrixWorkItemLengthINTEL,
1313
internal::OpJointMatrixWorkItemLengthINTEL)
1414
_SPIRV_OP_INTERNAL(ComplexFMulINTEL, internal::ComplexFMulINTEL)
1515
_SPIRV_OP_INTERNAL(ComplexFDivINTEL, internal::ComplexFDivINTEL)
16+
_SPIRV_OP_INTERNAL(MaskedGatherINTEL, internal::OpMaskedGatherINTEL)
17+
_SPIRV_OP_INTERNAL(MaskedScatterINTEL, internal::OpMaskedScatterINTEL)

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ bool SPIRVType::isTypeVectorOrScalarBool() const {
218218
return isTypeBool() || isTypeVectorBool();
219219
}
220220

221+
bool SPIRVType::isTypeVectorPointer() const {
222+
return isTypeVector() && getVectorComponentType()->isTypePointer();
223+
}
224+
221225
bool SPIRVType::isTypeSubgroupAvcINTEL() const {
222226
return isSubgroupAvcINTELTypeOpCode(OpCode);
223227
}

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVType.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class SPIRVType : public SPIRVEntry {
102102
bool isTypeVectorOrScalarInt() const;
103103
bool isTypeVectorOrScalarFloat() const;
104104
bool isTypeVectorOrScalarBool() const;
105+
bool isTypeVectorPointer() const;
105106
bool isTypeSubgroupAvcINTEL() const;
106107
bool isTypeSubgroupAvcMceINTEL() const;
107108
};

llvm-spirv/lib/SPIRV/libSPIRV/spirv_internal.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ enum InternalOp {
4646
IOpJointMatrixWorkItemLengthINTEL = 6410,
4747
IOpComplexFMulINTEL = 6415,
4848
IOpComplexFDivINTEL = 6416,
49+
IOpMaskedGatherINTEL = 6428,
50+
IOpMaskedScatterINTEL = 6429,
4951
IOpPrev = OpMax - 2,
5052
IOpForward
5153
};
@@ -78,7 +80,8 @@ enum InternalCapability {
7880
ICapFPArithmeticFenceINTEL = 6144,
7981
ICapGlobalVariableDecorationsINTEL = 6146,
8082
ICapabilityNonConstantAddrspacePrintfINTEL = 6411,
81-
ICapabilityComplexFloatMulDivINTEL = 6414
83+
ICapabilityComplexFloatMulDivINTEL = 6414,
84+
ICapabilityMaskedGatherScatterINTEL = 6427
8285
};
8386

8487
enum InternalFunctionControlMask { IFunctionControlOptNoneINTELMask = 0x10000 };
@@ -126,6 +129,10 @@ _SPIRV_OP(Capability, NonConstantAddrspacePrintfINTEL)
126129
_SPIRV_OP(Capability, ComplexFloatMulDivINTEL)
127130
_SPIRV_OP(Op, ComplexFMulINTEL)
128131
_SPIRV_OP(Op, ComplexFDivINTEL)
132+
133+
_SPIRV_OP(Capability, MaskedGatherScatterINTEL)
134+
_SPIRV_OP(Op, MaskedGatherINTEL)
135+
_SPIRV_OP(Op, MaskedScatterINTEL)
129136
#undef _SPIRV_OP
130137

131138
constexpr Op OpForward = static_cast<Op>(IOpForward);

llvm-spirv/test/transcoding/SPV_INTEL_function_pointers/vector_elem.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llvm-as < %s | llvm-spirv -spirv-text --spirv-ext=+SPV_INTEL_function_pointers | FileCheck %s --check-prefix=CHECK-SPIRV
1+
; RUN: llvm-as < %s | llvm-spirv -spirv-text --spirv-ext=+SPV_INTEL_function_pointers,+SPV_INTEL_masked_gather_scatter | FileCheck %s --check-prefix=CHECK-SPIRV
22

33
; CHECK-SPIRV-DAG: 6 Name [[F1:[0-9+]]] "_Z2f1u2CMvb32_j"
44
; CHECK-SPIRV-DAG: 6 Name [[F2:[0-9+]]] "_Z2f2u2CMvb32_j"

0 commit comments

Comments
 (0)