[LLVMdev] cmpxchg instruction with pointer operands

Philip Reames listmail at philipreames.com
Mon Sep 8 13:09:11 PDT 2014


This has been brought up a couple times now.  I don't believe anyone has 
voiced strong objection to having a variant which directly takes 
pointers, but no one has proposed a patch either.

p.s. I'm solidly in the "it would be nice to see" camp.  For much the 
same reasons as David.

Philip

On 09/06/2014 02:31 PM, Chuan Qiu wrote:
> 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
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

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


More information about the llvm-dev mailing list