# wasm: lower min/max for floats to compiler_rt · gitcafe/zig

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

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

Visibility: public

Requested revision: 9c20449cc5be5da0458556e143980b40d51e8776

Requested commit: 9c20449cc5be5da0458556e143980b40d51e8776

Commit: 9c20449cc5be5da0458556e143980b40d51e8776

Tree: cfa8ddf891494b237ba3e9a5268f222c90821c0f

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
wasm: lower min/max for floats to compiler_rt

The min and max builtins in Zig have some intricate behavior
related to floats, that is not replicated with the min and max
wasm instructions or using simple select operations. By lowering
these instructions to compiler_rt, handling around NaNs is done
correctly.

See also https://github.com/WebAssembly/design/issues/214

```

## Parents

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

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