This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH]: Add some folding of builtins fmin/fmax
- From: Roger Sayle <roger at eyesopen dot com>
- To: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 18 Nov 2006 12:41:17 -0700 (MST)
- Subject: Re: [PATCH]: Add some folding of builtins fmin/fmax
On Tue, 14 Nov 2006, Kaveh R. GHAZI wrote:
> I'm not able to implement Roger's more elaborate solution here:
Not to worry. That's a longer term plan, and if anything this
patch gets us a big step closer.
> 2006-11-13 Kaveh R. Ghazi <email@example.com>
> * builtins.c (integer_valued_real_p): Handle fmin/fmax.
> (fold_builtin_fmin_fmax): New.
> (fold_builtin_1): Use it.
> * gcc.dg/builtins-20.c: Add fmin/fmax cases.
> * gcc.dg/torture/builtin-minmax-1.c: New.
This is OK for mainline.
I'm sure you've already got it queued, but you can now easily add
fmin(x,NaN) -> x and fmin(NaN,y) -> y to your new fold_builtin_fmin_fmax.