mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 14:24:43 +00:00
docs: add atomicrmw operations list
This commit is contained in:
parent
1823a5979a
commit
e68fee3984
1 changed files with 16 additions and 0 deletions
|
|
@ -6330,6 +6330,22 @@ comptime {
|
||||||
TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe
|
TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe
|
||||||
we can remove this restriction
|
we can remove this restriction
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Supported operations:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>{#syntax#}.Xchg{#endsyntax#} - stores the operand unmodified.</li>
|
||||||
|
<li>{#syntax#}.Add{#endsyntax#} - for integers, twos complement wraparound addition.
|
||||||
|
Also supports {#link|Floats#}.</li>
|
||||||
|
<li>{#syntax#}.Sub{#endsyntax#} - for integers, twos complement wraparound subtraction.
|
||||||
|
Also supports {#link|Floats#}.</li>
|
||||||
|
<li>{#syntax#}.And{#endsyntax#} - bitwise and</li>
|
||||||
|
<li>{#syntax#}.Nand{#endsyntax#} - bitwise nand</li>
|
||||||
|
<li>{#syntax#}.Or{#endsyntax#} - bitwise or</li>
|
||||||
|
<li>{#syntax#}.Xor{#endsyntax#} - bitwise xor</li>
|
||||||
|
<li>{#syntax#}.Max{#endsyntax#} - stores the operand if it is larger. Supports integers and floats.</li>
|
||||||
|
<li>{#syntax#}.Min{#endsyntax#} - stores the operand if it is smaller. Supports integers and floats.</li>
|
||||||
|
</ul>
|
||||||
{#header_close#}
|
{#header_close#}
|
||||||
{#header_open|@bitCast#}
|
{#header_open|@bitCast#}
|
||||||
<pre>{#syntax#}@bitCast(comptime DestType: type, value: var) DestType{#endsyntax#}</pre>
|
<pre>{#syntax#}@bitCast(comptime DestType: type, value: var) DestType{#endsyntax#}</pre>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue