[all-commits] [llvm/llvm-project] 690b1c: [RISCV] Implement support for bf16 truncate/extend...

Alex Bradbury via All-commits all-commits at lists.llvm.org
Fri Jun 23 06:19:20 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 690b1c847f0b188202a86dc25a0a76fd8c4618f4
      https://github.com/llvm/llvm-project/commit/690b1c847f0b188202a86dc25a0a76fd8c4618f4
  Author: Alex Bradbury <asb at igalia.com>
  Date:   2023-06-23 (Fri, 23 Jun 2023)

  Changed paths:
    M llvm/lib/Support/RISCVISAInfo.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/bfloat.ll

  Log Message:
  -----------
  [RISCV] Implement support for bf16 truncate/extend on hard FP targets

For the same reasons as D151284, this requires custom lowering of the
truncate libcall on hard float ABIs (the normal libcall code path is
used on soft ABIs).

The extend operation is implemented by a shift just as in the standard
legalisation, but needs to be custom lowered because i32 isn't a legal
type on RV64.

This patch aims to make the minimal changes that result in correct
codegen for the bfloat.ll tests.

Differential Revision: https://reviews.llvm.org/D151663




More information about the All-commits mailing list