[PATCH] D110579: [AMDGPU] Add two new intrinsics to control fp_trunc rounding mode
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 20 12:38:15 PDT 2021
arsenm added inline comments.
================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp:4500-4502
+ case Intrinsic::experimental_fptrunc_round_upward:
+ case Intrinsic::experimental_fptrunc_round_downward: {
+ unsigned Bank =
----------------
jpages wrote:
> arsenm wrote:
> > The backend should not directly consume generic intrinsics. These need to be routed through a generic opcode which is subject to normal legalization
> What is the reasoning behind this requirement?
>
> I guess I would need something like experimental_fptrunc_round_upward -> amdgpu_experimental_fptrunc_round_upward -> codegen?
>
No, you would just need G_FPTRUNC_ROUND_UPWARD etc. opcodes. We don't have a way to define legalization rules on intrinsics, so if you need type legalization the backend would have to take care of it manually. e.g. we would have to manually scalarize the vector overloads of these intrinsics. With the opcode you can just define legalization rules like normal
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110579/new/
https://reviews.llvm.org/D110579
More information about the llvm-commits
mailing list