<p dir="auto">I think these should probably be done with generics, and can handle type checking internally like <code class="notranslate">transmute</code>.</p>
<p dir="auto">Currently they only take an <code class="notranslate">int</code> which is fine, but makes using them awkward in many cases.</p>
<p dir="auto">Also, many systems have a <code class="notranslate">dwcas</code> (<em>double word compare-and-swap</em>) operation that could be used when trying to CAS a <code class="notranslate">u64</code> on a 32-bit system. I'm pretty sure LLVM will take care of much of it itself, and these intrinsics are inherently unsafe anyway.</p>