[all-commits] [llvm/llvm-project] 169292: AMDGPU: Add tonearest and towardzero roundings for...

Changpeng Fang via All-commits all-commits at lists.llvm.org
Sat Aug 17 11:23:08 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 16929219b056fdbf9e0c93092904f2c5cac8a66f
      https://github.com/llvm/llvm-project/commit/16929219b056fdbf9e0c93092904f2c5cac8a66f
  Author: Changpeng Fang <changpeng.fang at amd.com>
  Date:   2024-08-17 (Sat, 17 Aug 2024)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUGISel.td
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h
    M llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
    M llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.h
    M llvm/lib/Target/AMDGPU/SIInstrInfo.td
    M llvm/lib/Target/AMDGPU/SIInstructions.td
    M llvm/lib/Target/AMDGPU/SIModeRegister.cpp
    M llvm/test/CodeGen/AMDGPU/fail.llvm.fptrunc.round.ll
    M llvm/test/CodeGen/AMDGPU/llvm.fptrunc.round.ll
    M llvm/test/CodeGen/AMDGPU/mode-register-fptrunc.mir

  Log Message:
  -----------
  AMDGPU: Add tonearest and towardzero roundings for intrinsic llvm.fptrunc.round (#104486)

This work simplifies and generalizes the instruction definition for
intrinsic llvm.fptrunc.round. We no longer name the instruction with the
rounding mode. Instead, we introduce an immediate operand for the
rounding mode for the pseudo instruction. This immediate will be used to
set up the hardware mode register at the time the real instruction is
generated. We name the pseudo instruction as FPTRUNC_ROUND_F16_F32 (for
f32 -> f16), which is easy to generalize for other types.

"round.towardzero" and "round.tonearest" are added for f32 -> f16
truncating, in addition to the existing "round.upward" and
"round.downward". Other rounding modes are not supported by hardware at
this moment.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list