This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerPC's math_ldbl.h


On 02/21/2013 09:57 AM, Thomas Schwinge wrote:
> Hi!
>
> I just noticed that PowerPC's sysdeps/powerpc/fpu/math_ldbl.h is slightly
> different from the generic sysdeps/ieee754/ldbl-128ibm/math_ldbl.h.
>
> Is especially the assertion that Âgcc generates disgusting code to pack
> and unpack long doubles still true in today's world?
>
> Also, it seems to me that Anton's spelling fix commit
> 2ccdea26f290f6990606f4a43de5272afa1a784d should be applied to the generic
> file, too, and vice versa Adhemerval's bug fix commit
> 34ae0b3270c67cae0c54ac98b693fdf7d010a206 might be needed for the
> PowerPC-specific file, too?
>
> In the end, can we perhaps completely get rid of the PowerPC-specific
> file?
>
>
> GrÃÃe,
>  Thomas

I just checked with GCC 4.4.6, 4.6.4, and 4.7.3 and neither of them can infer that
the 'ldbl_pack' does not need to spill the double registers and load them back from stack.
As the comment pointed out, the ldbl_pack is just a nop while the foo_unpack just need
to issue two 'stfd'. From what I could check, even at -O3 GCC spills and reloads the
double value from stack.

I believe that's why the pack/unpack function was redefined for PowerPC. Maybe we can
do something more clever and make 'sysdeps/powerpc/fpu/math_ldbl.h' include 
'sysdeps/ieee754/ldbl-128ibm/math_ldbl.h' and just redefine 'pack/unpack'. What do
you think?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]