Re: Suffix for __float128 FP constants

2007-06-25 Thread H. J. Lu
On Mon, Jun 18, 2007 at 02:08:15PM -0700, H. J. Lu wrote:
> On Mon, Jun 18, 2007 at 11:10:43AM -0700, Steve Ellcey wrote:
> > > BTW: IA64 has the same issues with two FP types (long double XFmode and 
> > > "longer double" TFmode). How is this solved for IA64?
> > > 
> > > Uros.
> > 
> > This is different on IA64 HP-UX and IA64 Linux.  On HP-UX, 128 bits is
> > the standard long double and 80 bits is __float80.  We use the 'W'
> > suffix for a __float80 constant on HP-UX.  HP-UX also uses a lower case
> > 'w' in math names for functions (e.g.  sqrtw) for __float80 functions.
> > 
> > Since __float128 == long double on HP-UX we can just use 'L' and 'l' for
> > those.
> > 
> 

BTW, icc uses the same suffix for __float128 constant as HP-UX.


H.J.


Re: Suffix for __float128 FP constants

2007-06-18 Thread H. J. Lu
On Mon, Jun 18, 2007 at 02:33:07PM -0700, Steve Ellcey wrote:
> > We need a standard for __float128. Otherwise, a program using
> > __float128 may generate different results with different
> > compilers on different platforms.
> > 
> > BTW, I had a __float128 patch for glibc. Because there is no
> > __float128 standard, it wasn't accepted.
> > 
> > 
> > H.J.
> 
> The HP compiler has an option that allows it to accept 'extended' as a
> type that is equivalent to __float80 and 'quad' as equivalent to 'long
> double' which is __float128 on HP-UX.  For the quad type it uses the Q
> suffix for quad constants (and a lower case q for quad functions like
> sqrtq).  I don't think this is a standard, but it is a precedent.

I used `q' as suffix for __float128 functions like __isinfq/__isnanq.
But I used strtoqd since we have strtold. I like `Q' suffix in
__float128 constants.



H.J.


Re: Suffix for __float128 FP constants

2007-06-18 Thread Steve Ellcey
> We need a standard for __float128. Otherwise, a program using
> __float128 may generate different results with different
> compilers on different platforms.
> 
> BTW, I had a __float128 patch for glibc. Because there is no
> __float128 standard, it wasn't accepted.
> 
> 
> H.J.

The HP compiler has an option that allows it to accept 'extended' as a
type that is equivalent to __float80 and 'quad' as equivalent to 'long
double' which is __float128 on HP-UX.  For the quad type it uses the Q
suffix for quad constants (and a lower case q for quad functions like
sqrtq).  I don't think this is a standard, but it is a precedent.

Steve Ellcey
[EMAIL PROTECTED]


Re: Suffix for __float128 FP constants

2007-06-18 Thread H. J. Lu
On Mon, Jun 18, 2007 at 11:10:43AM -0700, Steve Ellcey wrote:
> > BTW: IA64 has the same issues with two FP types (long double XFmode and 
> > "longer double" TFmode). How is this solved for IA64?
> > 
> > Uros.
> 
> This is different on IA64 HP-UX and IA64 Linux.  On HP-UX, 128 bits is
> the standard long double and 80 bits is __float80.  We use the 'W'
> suffix for a __float80 constant on HP-UX.  HP-UX also uses a lower case
> 'w' in math names for functions (e.g.  sqrtw) for __float80 functions.
> 
> Since __float128 == long double on HP-UX we can just use 'L' and 'l' for
> those.
> 

We need a standard for __float128. Otherwise, a program using
__float128 may generate different results with different
compilers on different platforms.

BTW, I had a __float128 patch for glibc. Because there is no
__float128 standard, it wasn't accepted.


H.J.


Re: Suffix for __float128 FP constants

2007-06-18 Thread Steve Ellcey
> BTW: IA64 has the same issues with two FP types (long double XFmode and 
> "longer double" TFmode). How is this solved for IA64?
> 
> Uros.

This is different on IA64 HP-UX and IA64 Linux.  On HP-UX, 128 bits is
the standard long double and 80 bits is __float80.  We use the 'W'
suffix for a __float80 constant on HP-UX.  HP-UX also uses a lower case
'w' in math names for functions (e.g.  sqrtw) for __float80 functions.

Since __float128 == long double on HP-UX we can just use 'L' and 'l' for
those.

None of which helps on Linux.

Steve Ellcey
[EMAIL PROTECTED]


Re: Suffix for __float128 FP constants

2007-06-18 Thread H. J. Lu
On Mon, Jun 18, 2007 at 07:25:06PM +0200, Uros Bizjak wrote:
> H. J. Lu wrote:
> 
> >>>I was trying to load a full 128 bit constant into __float128 variable, 
> >>>but
> >>>with "L" suffix, I was able to load only XFmode constant. Is there a 
> >>>special
> >>>suffix for __float128 available in gcc?
> >>>  
> >>No; since the x86-64 ABI is what defines the __float128 name, you could 
> >>ask the associated mailing list about a standard suffix to associate with 
> >>it.
> >>
> >Lack of standard for __float128 is always a problem. Suffix for
> >__float128 constant is one, scanf/printf specifier for __float128
> >is another. We also don't have a name for string to __float128
> >function.
> >  
> 
> While the __float128 scanf/printf specifier is part of library (and this 
> way, a custom library can provide these functions), the suffix for 
> constant should be covered by the compiler. Otherwise there is no 
> (clear) way to load the 128bit register with a 128bit constant value.
> 
> BTW: IA64 has the same issues with two FP types (long double XFmode and 
> "longer double" TFmode). How is this solved for IA64?

The same as x86-64 :-(. That is there is __float128 in ia64 psABI.
But it isn't fully implemented in gcc and glibc.


H.J.


Re: Suffix for __float128 FP constants

2007-06-18 Thread Uros Bizjak

H. J. Lu wrote:


I was trying to load a full 128 bit constant into __float128 variable, but
with "L" suffix, I was able to load only XFmode constant. Is there a special
suffix for __float128 available in gcc?
  
No; since the x86-64 ABI is what defines the __float128 name, you could 
ask the associated mailing list about a standard suffix to associate with 
it.


Lack of standard for __float128 is always a problem. Suffix for
__float128 constant is one, scanf/printf specifier for __float128
is another. We also don't have a name for string to __float128
function.
  


While the __float128 scanf/printf specifier is part of library (and this 
way, a custom library can provide these functions), the suffix for 
constant should be covered by the compiler. Otherwise there is no 
(clear) way to load the 128bit register with a 128bit constant value.


BTW: IA64 has the same issues with two FP types (long double XFmode and 
"longer double" TFmode). How is this solved for IA64?


Uros.



Re: Suffix for __float128 FP constants

2007-06-18 Thread H. J. Lu
On Sun, Jun 17, 2007 at 09:06:36PM +, Joseph S. Myers wrote:
> On Sun, 17 Jun 2007, Uros Bizjak wrote:
> 
> > I was trying to load a full 128 bit constant into __float128 variable, but
> > with "L" suffix, I was able to load only XFmode constant. Is there a special
> > suffix for __float128 available in gcc?
> 
> No; since the x86-64 ABI is what defines the __float128 name, you could 
> ask the associated mailing list about a standard suffix to associate with 
> it.
> 

Lack of standard for __float128 is always a problem. Suffix for
__float128 constant is one, scanf/printf specifier for __float128
is another. We also don't have a name for string to __float128
function.


H.J.


Re: Suffix for __float128 FP constants

2007-06-17 Thread Joseph S. Myers
On Sun, 17 Jun 2007, Uros Bizjak wrote:

> I was trying to load a full 128 bit constant into __float128 variable, but
> with "L" suffix, I was able to load only XFmode constant. Is there a special
> suffix for __float128 available in gcc?

No; since the x86-64 ABI is what defines the __float128 name, you could 
ask the associated mailing list about a standard suffix to associate with 
it.

-- 
Joseph S. Myers
[EMAIL PROTECTED]