[PATCH] D60021: InstSimplify: Fold round intrinsics from sitofp

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 12:01:17 PDT 2019


lebedev.ri added a comment.

In D60021#1450313 <https://reviews.llvm.org/D60021#1450313>, @efriedma wrote:

> > I'm not sure where or if there are official docs for libm
>
> The official definitions of all the libm floating-point functions for IEEE754 floating-point are in the C standard, Annex F.
>
> As far as I can tell, your reasoning is right.  sitofp/uitofp must produce either an integral finite result, or +inf/-inf. If sitofp/uitofp produces an integral finite result, all these rounding functions do nothing.




> And if sitofp produces an infinity, all these rounding functions also do nothing, as explicitly stated in Annex F.

That is the bit i was missing, thank you.

Looks good to me then.



================
Comment at: test/Transforms/InstSimplify/round-intrinsics.ll:43
 }
 
 define float @sitofp_round(i32 %arg) {
----------------
spatel wrote:
> Missing tests for llvm.ceil?
(please precommit)


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

https://reviews.llvm.org/D60021





More information about the llvm-commits mailing list