[SelectionDAG] Implement soft FP legalisation for bf16 FP_EXTEND and BF16_TO_FP
authorAlex Bradbury <asb@igalia.com>
Mon, 29 May 2023 09:32:28 +0000 (10:32 +0100)
committerAlex Bradbury <asb@igalia.com>
Mon, 29 May 2023 09:32:28 +0000 (10:32 +0100)
commit061e368fe213bd0701261a3e59f796c7439484fc
tree539af1e2407f3bf0c3f8e82c4d390014d355c2a9
parent6cf7fe4a9a715bcdf3f4913753109e22dfc9940b
[SelectionDAG] Implement soft FP legalisation for bf16 FP_EXTEND and BF16_TO_FP

As discussed in D151436, it's safe to do this as a simple shift (as is
done in LegalizeDAG.cpp) rather than needing a libcall. The added test
cases for RISC-V previously just triggered an assertion.

Codegen for bfloat_to_double will be slightly improved by D151434.

Differential Revision: https://reviews.llvm.org/D151563
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
llvm/test/CodeGen/RISCV/bfloat.ll [new file with mode: 0644]