Skip to content

Commit 62ea823

Browse files
authored
[SPIR-V 1.4] Removed OpAtomicCompareExchangeWeak (#2665)
Verified locally by changing the version from `65536` to `66560` in `test/transcoding/atomics.spt`.
1 parent 9560547 commit 62ea823

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SPIRV/libSPIRV/SPIRVInstruction.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,12 @@ class SPIRVAtomicInstBase : public SPIRVInstTemplateBase {
28242824
for (auto RC : getRequiredCapability())
28252825
Module->addCapability(RC);
28262826
}
2827+
2828+
void validate() const override {
2829+
if (OpCode == OpAtomicCompareExchangeWeak)
2830+
assert(this->getModule()->getSPIRVVersion() < VersionNumber::SPIRV_1_4 &&
2831+
"OpAtomicCompareExchangeWeak is removed starting from SPIR-V 1.4");
2832+
}
28272833
};
28282834

28292835
class SPIRVAtomicStoreInst : public SPIRVAtomicInstBase {

0 commit comments

Comments
 (0)