Skip to content

Commit

Permalink
[SPIR-V 1.4] Removed OpAtomicCompareExchangeWeak (#2665)
Browse files Browse the repository at this point in the history
Verified locally by changing the version from `65536` to `66560` in `test/transcoding/atomics.spt`.
  • Loading branch information
vmaksimo committed Aug 9, 2024
1 parent 9560547 commit 62ea823
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/SPIRV/libSPIRV/SPIRVInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -2824,6 +2824,12 @@ class SPIRVAtomicInstBase : public SPIRVInstTemplateBase {
for (auto RC : getRequiredCapability())
Module->addCapability(RC);
}

void validate() const override {
if (OpCode == OpAtomicCompareExchangeWeak)
assert(this->getModule()->getSPIRVVersion() < VersionNumber::SPIRV_1_4 &&
"OpAtomicCompareExchangeWeak is removed starting from SPIR-V 1.4");
}
};

class SPIRVAtomicStoreInst : public SPIRVAtomicInstBase {
Expand Down

0 comments on commit 62ea823

Please sign in to comment.