Saving to 32 bits of GPRs in signal context

Segher Boessenkool segher at kernel.crashing.org
Wed May 30 23:14:06 EST 2007


>>>  Anyway, please don't. It is *not* portable.
>> What are you talking about ? Really, I mean, I'm not sure I understand
>> what you mean :-)
> Segher stated that there is no portable way of detecting whether 64bit
> instructions are available, and said that just trying a 64bit insn (and
> catching the SIGILL if thre cpu is 32bit) is probably the most portable
> way to do so. (Or did i got *that* wrong? If so, please ignore.)

That is exactly what I said.  Note I didn't say it
is the *best* method, just the most portable one :-)

> Now my objection is that the "SIGILL"-way is not only ugly, but can be
> easily *wrong*, as there are certain possibilities (Book-E 64bit,
> non-64bit-aware OS, ...) when the CPU might not throw an exception.

All those cases would throw an exception.

> (My
> "ffmpeg with vmx"-experience shows this is a real world issue, although
> the situation is a bit different there, i agree, since vmx opcodes are
> not exclusively reserved for vmx)

Yeah nasty business.


Segher




More information about the Linuxppc-dev mailing list