This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PowerPC] avoid horrible union access
On Sat, Feb 04, 2006 at 10:08:03PM +0000, Paul Brook wrote:
> > > + register double hi __asm__ ("fr1");
> > > + register double lo __asm__ ("fr2");
> > > + register long double ld __asm__ ("fr1");
> > > + hi = a;
> > > + lo = aa;
> > > + __asm__ ("" : "=f" (ld) : "f" (hi), "f" (lo));
> > > + return ld;
> > > +}
> >
> > Isn't this one of the uses of 'register asm' which are not guaranteed
> > to work?
>
> I thought this was the only case that is guaranteed to work. That's what the
> docs say anyway.
Yes, see node "Extended Asm". pack() even works when called from a
function which is itself inlined, although of course it's not ideal to
have the function return forced into fr1/fr2 in that case.
--
Alan Modra
IBM OzLabs - Linux Technology Centre