[LLVMdev] cmpxchg instruction with pointer operands

Chuan Qiu qiuc12 at gmail.com
Sat Sep 6 14:31:19 PDT 2014


cmpxchg only support exchange on int operands, but pointer values can be
very useful here, e.g. stack<T> in a linked-list, the top can be
atomic<Node<T>*>.
in clang++, cmpxchg operations on atomic<T*>  are bitcasted i64 and do the
operation, which is ugly.

Any reason or concern why cmpxchg doesn't support pointer operands?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140906/a816925b/attachment.html>


More information about the llvm-dev mailing list