[PATCH] D83880: AMDGPU/GlobalISel: Legalize s64->s16 G_SITOFP/G_UITOFP

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 09:20:04 PDT 2020


foad added a comment.

In D83880#2153414 <https://reviews.llvm.org/D83880#2153414>, @foad wrote:

> > Legailize as s64->s32 G_SITOFP/G_UITOFP followed by s32->s16 G_FPTRUNC.
>
> It seems like this would give the wrong result in some cases because of the double rounding.


The range of a half is only about +/- 65536, and any integer in that range will convert to float exactly without rounding, so there is no double rounding problem.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83880/new/

https://reviews.llvm.org/D83880





More information about the llvm-commits mailing list