| ... | @@ -6330,6 +6330,22 @@ comptime { | ... | @@ -6330,6 +6330,22 @@ comptime { |
| 6330 | TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe | 6330 | TODO right now bool is not accepted. Also I think we could make non powers of 2 work fine, maybe |
| 6331 | we can remove this restriction | 6331 | we can remove this restriction |
| 6332 | </p> | 6332 | </p> |
| | 6333 | <p> |
| | 6334 | Supported operations: |
| | 6335 | </p> |
| | 6336 | <ul> |
| | 6337 | <li>{#syntax#}.Xchg{#endsyntax#} - stores the operand unmodified.</li> |
| | 6338 | <li>{#syntax#}.Add{#endsyntax#} - for integers, twos complement wraparound addition. |
| | 6339 | Also supports {#link|Floats#}.</li> |
| | 6340 | <li>{#syntax#}.Sub{#endsyntax#} - for integers, twos complement wraparound subtraction. |
| | 6341 | Also supports {#link|Floats#}.</li> |
| | 6342 | <li>{#syntax#}.And{#endsyntax#} - bitwise and</li> |
| | 6343 | <li>{#syntax#}.Nand{#endsyntax#} - bitwise nand</li> |
| | 6344 | <li>{#syntax#}.Or{#endsyntax#} - bitwise or</li> |
| | 6345 | <li>{#syntax#}.Xor{#endsyntax#} - bitwise xor</li> |
| | 6346 | <li>{#syntax#}.Max{#endsyntax#} - stores the operand if it is larger. Supports integers and floats.</li> |
| | 6347 | <li>{#syntax#}.Min{#endsyntax#} - stores the operand if it is smaller. Supports integers and floats.</li> |
| | 6348 | </ul> |
| 6333 | {#header_close#} | 6349 | {#header_close#} |
| 6334 | {#header_open|@bitCast#} | 6350 | {#header_open|@bitCast#} |
| 6335 | <pre>{#syntax#}@bitCast(comptime DestType: type, value: var) DestType{#endsyntax#}</pre> | 6351 | <pre>{#syntax#}@bitCast(comptime DestType: type, value: var) DestType{#endsyntax#}</pre> |