This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] avoid horrible union access



On Feb 4, 2006, at 6:22 PM, Alan Modra wrote:

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.

I wonder if there is a way to say a subregister in inline-asm (this would be better than what you are doing): Something like: __asm__ ("" : "=f" (ld) : "0l" (hi), "0h" (lo));

And that would cause the code gen to be right.
Though there is no way and the reason why the union trick
does not work is because we don't turn

union {long double a; double b[2];}
a.c = in;
hi = a.b[1];

into:

hi = VIEW_CONVERT_EXPR(double[2])<in>[1];

which would really fix the whole issue.

-- Pinski


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