[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #14 from hjl dot tools at gmail dot com  2009-02-18 23:42 
---
Fixed.


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl at gcc dot gnu dot org


--- Comment #13 from hjl at gcc dot gnu dot org  2009-02-18 21:40 ---
Subject: Bug 39224

Author: hjl
Date: Wed Feb 18 21:40:08 2009
New Revision: 144272

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144272
Log:
2009-02-18  H.J. Lu  

PR target/39224
* config/i386/i386.c (ix86_return_in_memory): Properly check
ABI.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #12 from hjl dot tools at gmail dot com  2009-02-18 19:50 
---
The updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00871.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL|http://gcc.gnu.org/ml/gcc-  |http://gcc.gnu.org/ml/gcc-
   |patches/2009-   |patches/2009-
   |02/msg00870.html|02/msg00871.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #11 from hjl dot tools at gmail dot com  2009-02-18 19:22 
---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-02/msg00870.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2009-
   ||02/msg00870.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #10 from hjl dot tools at gmail dot com  2009-02-18 18:53 
---
The problem is callee returns long double via a pointer to a structure.
But caller thinks callee returns long double in rax/edx.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #9 from hjl dot tools at gmail dot com  2009-02-18 15:50 ---
For sysv/x86-64, XFmode is 16byte with 16byte alignment. It is
passed in memory and returned in in %st0/%st1.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ktietz at gcc dot gnu dot org


--- Comment #8 from ktietz at gcc dot gnu dot org  2009-02-18 14:23 ---
(In reply to comment #7)
> (In reply to comment #6)
> > (In reply to comment #5)
> > > (In reply to comment #4)
> > > > ok, I found the issue, which causes here the problem.
> > > > The x86_64 abi returns TFmode in rax,edx which is stored in aligned 
> > > > stack
> > > 
> > > XFmode
> > > 
> > 
> > right, sorry I meant XFmode
> > 
> 
> w64 ABI doesn't cover XFmode. Why do you use integer registers for
> XFmode? It doesn't make any senses to me.
> 

As I said above there are two reasons. First 32-bit code supports XFmode, too.
Also the vendor specific library supports 96-bit floating point, too. But not
as native type, they use a struct for this (what is the current implementation
in gcc to pass them as memory reference). So there is no good reason for not 
supporting XFmode types for w64 IMHO.
This issue here seems to be more the store size in x86_64 abi. Hasn't x86_64
also the need to have those types store 16-bytes aligned?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread hjl dot tools at gmail dot com


--- Comment #7 from hjl dot tools at gmail dot com  2009-02-18 14:13 ---
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > ok, I found the issue, which causes here the problem.
> > > The x86_64 abi returns TFmode in rax,edx which is stored in aligned stack
> > 
> > XFmode
> > 
> 
> right, sorry I meant XFmode
> 

w64 ABI doesn't cover XFmode. Why do you use integer registers for
XFmode? It doesn't make any senses to me.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ktietz at gcc dot gnu dot org


--- Comment #6 from ktietz at gcc dot gnu dot org  2009-02-18 12:11 ---
(In reply to comment #5)
> (In reply to comment #4)
> > ok, I found the issue, which causes here the problem.
> > The x86_64 abi returns TFmode in rax,edx which is stored in aligned stack
> 
> XFmode
> 

right, sorry I meant XFmode


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ubizjak at gmail dot com


--- Comment #5 from ubizjak at gmail dot com  2009-02-18 12:06 ---
(In reply to comment #4)
> ok, I found the issue, which causes here the problem.
> The x86_64 abi returns TFmode in rax,edx which is stored in aligned stack

XFmode


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ktietz at gcc dot gnu dot org


--- Comment #4 from ktietz at gcc dot gnu dot org  2009-02-18 10:45 ---
ok, I found the issue, which causes here the problem.
The x86_64 abi returns TFmode in rax,edx which is stored in aligned stack
variable as 96 bits, but the upper 32-bits (which have to be zero initialized)
aren't set. For w64 there are stored 128-bit in this case as desired. So the
compare of those two results is failing, because on x86_64 abi the upper
32-bits have random values.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ktietz at gcc dot gnu dot org


--- Comment #3 from ktietz at gcc dot gnu dot org  2009-02-18 08:47 ---
(In reply to comment #2)
> I am verifying it at the moment for w64 target, if we have here same issues.
> 

Yes, on w64 targets we have the same issue. By adding print methods, it seems
that the return value of the foreign abi is passed/treated wrong.

This testcases were run by me last time about beginning of January this year
and they seem to work fine at this date.


-- 

ktietz at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-02-18 08:47:04
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-18 Thread ktietz at gcc dot gnu dot org


--- Comment #2 from ktietz at gcc dot gnu dot org  2009-02-18 08:18 ---
(In reply to comment #1)
> I think long double on w64 is the same as double. I am not sure if
> gcc.dg/callabi/func-1.c is a valid test.
> 

the long double is supported as 96-bit floating point for gcc. This isn't as
ms_abi declares it, but I follow here the 32-bit port. So we allow higher
precision, and by vendor specific headers it has not much affects, beside that
the vendor specific scanf/printf functions can't print it proper. Therefore the
mingw runtime provides C99 compliant (and gnu-style compiant) alternatives to
print/scan them.

I am verifying it at the moment for w64 target, if we have here same issues.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-17 Thread hjl dot tools at gmail dot com


--- Comment #1 from hjl dot tools at gmail dot com  2009-02-18 06:45 ---
I think long double on w64 is the same as double. I am not sure if
gcc.dg/callabi/func-1.c is a valid test.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224



[Bug target/39224] ABI attribute doesn't work with long double

2009-02-17 Thread hjl dot tools at gmail dot com


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

   Target Milestone|--- |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39224