[PATCH] D84324: AMDGPU/GlobalISel: Lower G_FREM

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 07:26:48 PDT 2020


foad added a comment.

In D84324#2169293 <https://reviews.llvm.org/D84324#2169293>, @arsenm wrote:

> In D84324#2169289 <https://reviews.llvm.org/D84324#2169289>, @foad wrote:
>
> > > I'd still like to understand why this is failing conformance if I use frem for opencl fmod.
> >
> > What is the alternative to using frem, that passes conformance?
>
>
> A huge expansion that involves loops:
>  https://github.com/RadeonOpenCompute/ROCm-Device-Libs/blob/amd-stg-open/ocml/src/remainderF_base.h#L38


Then it needs debugging. Perhaps there are cases where the simple expansion gives fmod(x,y)==y, even though the result is supposed to have magnitude strictly less than y. Or perhaps it doesn't handle nans or infinities correctly.


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

https://reviews.llvm.org/D84324





More information about the llvm-commits mailing list