On 1 Dec 2011, at 20:20, Richard Henderson wrote:

On 12/01/2011 10:47 AM, Joseph S. Myers wrote:
As I previously noted in the ARM discussion, C specifically says that
setjmp/longjmp should *not* save/restore floating-point exceptions and
rounding modes.  Think of the floating-point state as being a global
variable (well, thread-local).

Exactly.

If the fpscr _were_ a TLS variable, seen to be modified inside a transaction, we would log its initial value so that we could restore that original value on a transaction restart or transaction cancel.\

well, I saw ...

        mffs    f0
        stfd    f14,  0+OFS_FR+BASE(r1)

[snip]

        stfd    f0, OFS_FPSCR+BASE(r1)

in your posted  code ... and wondered ..

So, as you say the ARM libc setjmp/longjmp implementation is wrong, but we do need that save and restore here.

now I'm slightly confused - do we need to preserve if across the call or not?

cheers
Iain

Reply via email to