# fix invalid const bitcast of f80 · gitcafe/zig

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

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

Visibility: public

Requested revision: 3c827be876a39cbe199e5cd7c6e90edef3a090b5

Requested commit: 3c827be876a39cbe199e5cd7c6e90edef3a090b5

Commit: 3c827be876a39cbe199e5cd7c6e90edef3a090b5

Tree: d13e5cec6df861361d523201ed922c5f6010af71

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fix invalid const bitcast of f80

LLVM bitcast wants integers that match the number of bits. So the const
bitcast has to use an i80, not an i128.

This commit makes the behavior tests fail for me, so it seems I did not
correctly construct the type. But it gets rid of the LLVM segfault.

I noticed that the strategy of memcpy the buf worked if I simply did an
LLVMConstTrunc() on the i128 to make it into an i80 before the
LLVMConstBitCast().

But is that correct in the face of different endianness? I'm not sure.

```

## Parents

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

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