Skip to content

Commit 3fa5900

Browse files
vmaksimosys-ce-bb
authored andcommitted
Removed OpAtomicCompareExchangeWeak (#2665)
Verified locally by changing the version from `65536` to `66560` in `test/transcoding/atomics.spt`. Original commit: KhronosGroup/SPIRV-LLVM-Translator@62ea823e64307e8
1 parent 9479076 commit 3fa5900

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,6 +2799,12 @@ class SPIRVAtomicInstBase : public SPIRVInstTemplateBase {
27992799
for (auto RC : getRequiredCapability())
28002800
Module->addCapability(RC);
28012801
}
2802+
2803+
void validate() const override {
2804+
if (OpCode == OpAtomicCompareExchangeWeak)
2805+
assert(this->getModule()->getSPIRVVersion() < VersionNumber::SPIRV_1_4 &&
2806+
"OpAtomicCompareExchangeWeak is removed starting from SPIR-V 1.4");
2807+
}
28022808
};
28032809

28042810
class SPIRVAtomicStoreInst : public SPIRVAtomicInstBase {

0 commit comments

Comments
 (0)