[PATCH] D54749: Saturating float to int casts.
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 10:53:57 PDT 2020
rjmccall added a comment.
> I was originally planning on adding such an intrinsic (with a scaling factor) but dropped the idea when I found this patch. You are right in that the small exponent of half precision is problematic, though. Not sure what to do about that.
It'd be a problem with `float` and `bfloat`, too, if we ever have to support any 128-bit fixed-point formats. I think planning around this is probably the better approach.
At least for the IEEE formats, you should be able to just destructure the bit-pattern of the float, right? Normalize and do some extends and shifts.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54749/new/
https://reviews.llvm.org/D54749
More information about the llvm-commits
mailing list