Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-08 Thread Richard Guenther
On 7/8/07, Kaveh R. GHAZI <[EMAIL PROTECTED]> wrote: On Sun, 8 Jul 2007, Richard Guenther wrote: > So type-generic is supposed to apply to scalar floating point types > only? So far, yes. I don't see anything that requires or prohibits changing that for the initial implementation. If later a

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-08 Thread Kaveh R. GHAZI
On Sun, 8 Jul 2007, Richard Guenther wrote: > So type-generic is supposed to apply to scalar floating point types > only? So far, yes. I don't see anything that requires or prohibits changing that for the initial implementation. If later a GCC developer wants to change it to not promote e.g. ch

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-08 Thread Richard Guenther
On 7/8/07, Kaveh R. GHAZI <[EMAIL PROTECTED]> wrote: On Sat, 7 Jul 2007, Joseph S. Myers wrote: > No, that's something else entirely (a "float" old-style parameter > declaration corresponds to a "double" argument in a prototype). It's > convert_arguments that handles converting to prototype typ

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-07 Thread Kaveh R. GHAZI
On Sat, 7 Jul 2007, Joseph S. Myers wrote: > No, that's something else entirely (a "float" old-style parameter > declaration corresponds to a "double" argument in a prototype). It's > convert_arguments that handles converting to prototype types and default > argument promotions for arguments not

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-07 Thread Joseph S. Myers
On Sat, 7 Jul 2007, Kaveh R. GHAZI wrote: > Ok, here's a patch which adds the attribute named as you suggest and > applies it to the relevant builtins. I'm stuck now on how and where we > would intervene to honor it. I think we need to do it in c-decl.c: > grokdeclarator(), where it says "promot

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-07 Thread Kaveh R. GHAZI
On Sat, 7 Jul 2007, Joseph S. Myers wrote: > On Sat, 7 Jul 2007, Kaveh R. GHAZI wrote: > > > Ok, how about e.g. __attribute__ ((__type_generic__)), which would only be > > allowed on variadic functions? > > I don't think we want this available to user code, just to builtins, so a > name such as "t

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-07 Thread Joseph S. Myers
On Sat, 7 Jul 2007, Kaveh R. GHAZI wrote: > Ok, how about e.g. __attribute__ ((__type_generic__)), which would only be > allowed on variadic functions? I don't think we want this available to user code, just to builtins, so a name such as "type generic" that can't be used as an identifier would

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-07 Thread Kaveh R. GHAZI
On Fri, 6 Jul 2007, Joseph S. Myers wrote: > On Fri, 6 Jul 2007, Kaveh R. GHAZI wrote: > > > So how do we detect or work around this promotion issue and discriminate > > between the case where a float is promoted because of the variadic > > prototype vs a user supplied cast or other user code? > >

Re: Q: middle-end problem when variadic builtins promote float to double

2007-07-06 Thread Joseph S. Myers
On Fri, 6 Jul 2007, Kaveh R. GHAZI wrote: > So how do we detect or work around this promotion issue and discriminate > between the case where a float is promoted because of the variadic > prototype vs a user supplied cast or other user code? I think we may need to tag these builtins in some way t

Q: middle-end problem when variadic builtins promote float to double

2007-07-06 Thread Kaveh R. GHAZI
I have a question relating to variadic builtins and floating point arguments. I'm trying to implement "isnormal" like so: http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01292.html Basically, I change __builtin_isnormal(x) -> isgreaterequal(fabs(x),FP_MIN) & islessequal(fabs(x),FP_MAX) (where FP_M