This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Constant fold round, roundf and roundl


On Thu, Jan 22, 2004 at 08:03:32PM -0700, Roger Sayle wrote:
> 	* real.c (real_floor, real_ceil): Tweak to allow input and output
> 	arguments to overlap.
> 	(real_round): New function to implement round(3m) semantics.
> 	* real.h (real_round): Prototype here.
> 	* builtins.c (fold_builtin_round): New function to constant fold
> 	round, roundf and roundl.
> 	(fold_builtin): Call fold_builtin_round for BUILT_IN_ROUND{,F,L}.
> 
> 	* gcc.dg/builtins-29.c: New test case.

Ok.

> ! /* Round X to the nearest integer, away from zero, i.e. round to the
> !    nearest integer, but round halfway cases away from zero.  */

I think the i.e. clause is clearer than the first clause, and should
be used on its own.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]