[PATCH] Add ISD::FROUND for libm round()

Nadav Rotem nrotem at apple.com
Mon Jul 15 00:16:54 PDT 2013


Hi Hal, 

I think that the round intrinsic should support all of the popular rounding mode, and not only nearest integer. 

Thanks,
Nadav

On Jul 7, 2013, at 9:04 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> Hello!
> 
> round() has been feeling a little left out; all of its friends (like rint() and nearbyint()) have their own ISD nodes, and round() doesn't. Recent PowerPC cores have an instruction for round(), and so I'd like to correct this injustice and add ISD::FROUND.
> 
> For the most part, this is extremely straightforward. I've added an intrinsic and matching ISD node just like those for nearbyint() and friends. The SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed fround); obviously we can use a different name if someone has a better suggestion. Please review.
> 
> Thanks again,
> Hal
> 
> --
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory
> <isd_round.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130715/2c2dc839/attachment.html>


More information about the llvm-commits mailing list