diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2022-06-03 10:47:22 +0200 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2022-06-15 12:56:31 +0200 |
commit | fb34d531af953119593be74753b89baf99fbc194 (patch) | |
tree | 9081dac67c376f4fde9303c4b3090a7cac7db575 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 43e7ba6495359bcc14580725468e7736e97edcc6 (diff) | |
download | llvm-fb34d531af953119593be74753b89baf99fbc194.zip llvm-fb34d531af953119593be74753b89baf99fbc194.tar.gz llvm-fb34d531af953119593be74753b89baf99fbc194.tar.bz2 |
Promote bf16 to f32 when the target doesn't support it
This is modeled after the half-precision fp support. Two new nodes are
introduced for casting from and to bf16. Since casting from bf16 is a
simple operation I opted to always directly lower it to integer
arithmetic. The other way round is more complicated if you want to
preserve IEEE semantics, so it's handled by a new __truncsfbf2
compiler-rt builtin.
This is of course very bare bones, but sufficient to get a semi-softened
fadd on x86.
Possible future improvements:
- Targets with bf16 conversion instructions can now make fp_to_bf16 legal
- The software conversion to bf16 can be replaced by a trivial
implementation under fast math.
Differential Revision: https://reviews.llvm.org/D126953
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions