# stage2: implement comptime \`@atomicRmw\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b9d3527e0ed53c4796ab64b4df7daf0909739807)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b9d3527e0ed53c4796ab64b4df7daf0909739807

Requested commit: b9d3527e0ed53c4796ab64b4df7daf0909739807

Commit: b9d3527e0ed53c4796ab64b4df7daf0909739807

Tree: 6cb29ce60e606fc4cfd30dad8b6f88c07a6bf8a7

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: implement comptime `@atomicRmw`

 * introduce float_to_int and int_to_float AIR instructionts and
   implement for the LLVM backend and C backend.
 * Sema: implement `zirIntToFloat`.
 * Sema: implement `@atomicRmw` comptime evaluation
   - introduce `storePtrVal` for when one needs to store a Value to a
     pointer which is a Value, and assert it happens at comptime.
 * Value: introduce new functionality:
   - intToFloat
   - numberAddWrap
   - numberSubWrap
   - numberMax
   - numberMin
   - bitwiseAnd
   - bitwiseNand (not implemented yet)
   - bitwiseOr
   - bitwiseXor
 * Sema: hook up `zirBitwise` to the new Value bitwise implementations
 * Type: rename `isFloat` to `isRuntimeFloat` because it returns `false`
   for `comptime_float`.

```

## Parents

- [5dc251747b4ea65b1c8d3f2b5af62ca83c6d1196](https://git.cafe/gitcafe/zig/commit/5dc251747b4ea65b1c8d3f2b5af62ca83c6d1196?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b9d3527e0ed53c4796ab64b4df7daf0909739807?format=markdown)
