# make f80 less hacky; lower as u80 on non-x86 · gitcafe/zig

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

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

Visibility: public

Requested revision: a024aff9324e827d6595e44f922d87f8ed2dbd0d

Requested commit: a024aff9324e827d6595e44f922d87f8ed2dbd0d

Commit: a024aff9324e827d6595e44f922d87f8ed2dbd0d

Tree: 2c0557a4e57acd198ca57deb7cc387109d96c26d

Author: Andrew Kelley

Committer: Jakub Konka

## Message

```
make f80 less hacky; lower as u80 on non-x86

Get rid of `std.math.F80Repr`. Instead of trying to match the memory
layout of f80, we treat it as a value, same as the other floating point
types. The functions `make_f80` and `break_f80` are introduced to
compose an f80 value out of its parts, and the inverse operation.

stage2 LLVM backend: fix pointer to zero length array tripping LLVM
assertion. It now checks for when the element type is a zero-bit type
and lowers such thing the same way that pointers to other zero-bit types
are lowered.

Both stage1 and stage2 LLVM backends are adjusted so that f80 is lowered
as x86_fp80 on x86_64 and i386 architectures, and identical to a u80 on
others. LLVM constants are lowered in a less hacky way now that #10860
is fixed, by using the expression `(exp << 64) | fraction` using llvm
constants.

Sema is improved to handle c_longdouble by recursively handling it
correctly for whatever the float bit width is. In both stage1 and
stage2.

```

## Parents

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

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