[PATCH] D114964: [DAG] Create fptoui.sat from clamped fptoui
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 3 10:53:24 PST 2021
dmgreen added a comment.
> My use case for these were to related to the Embedded-C support, to implement conversion between fixed point types and floating point types. This was added in https://reviews.llvm.org/D86632. In that patch the intrinsics are used directly when producing IR in the frontend.
>
> Downstream we set FP_TO_SINT_SAT as "custom" as we can do optimized lowering in some situation (depending on involved types and saturation width). I realize that we probably want to override shouldConvertFpToSat to avoid any conversion to these saturated intrinsics when it isn't beneficial for our target.
I believe they may be used in rust too.
I know that scalable vectors are not supported for all cases (they can try to unroll) - that is on my list of things to look at.
Yeah, making an shouldConvertFpToSat override can be important - for example only converting them when the operations are available like we do on Arm. You may be able to copy one of the existing fpclamptosat.ll test cases as a starting point.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114964/new/
https://reviews.llvm.org/D114964
More information about the llvm-commits
mailing list