# codegen/llvm: add workarounds to loadTruncate\(\) for llvm codegen bugs · gitcafe/zig

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

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

Visibility: public

Requested revision: 40528b8a9348fc615cc36a85eebd8cc6ee184333

Requested commit: 40528b8a9348fc615cc36a85eebd8cc6ee184333

Commit: 40528b8a9348fc615cc36a85eebd8cc6ee184333

Tree: 23d07b8f001f6c545b957d195f31e5f410e7cc75

Author: Xavier Bouchoux

Committer: Xavier Bouchoux

## Message

```
codegen/llvm: add workarounds to loadTruncate() for llvm codegen bugs

for wasm, as a heuritic, only enable truncation for values smaller than 32bits.
 -> the bug is no longer triggered in most use cases (or at least the test suite...)

as for powerpc, adding a redundant `and mask` produces working code.

```

## Parents

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

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