# Sema: avoid \`@intToFloat\` for f80 which breaks on non-x86 targets · gitcafe/zig

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

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

Visibility: public

Requested revision: 65b6faa0485253b284f7a63601dc7d0f5858515a

Requested commit: 65b6faa0485253b284f7a63601dc7d0f5858515a

Commit: 65b6faa0485253b284f7a63601dc7d0f5858515a

Tree: 33e527cab9dc08c381046ec6199424fc3a6e24dd

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

````
Sema: avoid `@intToFloat` for f80 which breaks on non-x86 targets

Currently Zig lowers `@intToFloat` for f80 incorrectly on non-x86
targets:

```
broken LLVM module found:
UIToFP result must be FP or FP vector
  %62 = uitofp i64 %61 to i128
SIToFP result must be FP or FP vector
  %66 = sitofp i64 %65 to i128
```

This happens because on such targets, we use i128 instead of x86_fp80 in
order to avoid "LLVM ERROR: Cannot select". `@intToFloat` must be
lowered differently to account for this difference as well.

````

## Parents

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

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