Saving to 32 bits of GPRs in signal context

Felix Domke tmbinc at elitedvb.net
Wed May 30 21:52:29 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.)

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.  (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)

Yes, those hwcap-bits should care for this. Are they portable/usable, 
even on older systems?

Felix



More information about the Linuxppc-dev mailing list