This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Constant fold round, roundf and roundl
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Jan 2004 23:09:53 -0800
- Subject: Re: [PATCH] Constant fold round, roundf and roundl
- References: <Pine.LNX.4.44.0401221943200.13205-100000@www.eyesopen.com>
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~