KhronosGroup/SPIRV-LLVM

Translation of OpAtomicCompareExchange is done incorrectly

Closed this issue · 3 comments

There are 2 issues seen during translation of atomic_compare_exchange_strong and atomic_compare_exchange_weak calls to SPIR-V:

  1. 5th operand of Inst is value, and its type should be scalar value not the pointer
  2. AtomicCompareExchange must return the same type as Value but it returns bool
  3. Operands are incorrectly ordered
    Fix for the issues mentioned above were implemented in pull request #26.
    Translation of OpAtomicCompareExchange[Weak] instruction to atomic_compare_exchange_[strong|weak] call has to be fixed. Argument types, argument order and different semantics of the operation in SPIR-V and OpenCL 2.0 have to be taken into account.

Thanks for opening the issue. To fix the issue both the writer and the reader paths need change.

I noticed pull request #26 was closed. Are you going to continue working on this issue? Thanks.

Right now I have some other tasks with high priority. I(or @AndreyE) will work on it later. If you want, feel free to fix it.

Should be fixed by #58