Subject: Re: Powerpc signal handler with floating point registers
To: Matt Thomas <>
From: chris zhang <>
List: port-powerpc
Date: 02/28/2005 14:26:27
One of my colleagues found another restriction. This
appears to mean you can't do 64bit arithmetic in
signal handler without setting SA_SIGINFO in

Apparently, gcc generates code by using FP when
handling "long long" arithmatics. We couldn't find
compiler flags to turn off this yet.

Something like this,

  long long a, b;

  int foo()
        a = b;

GCC generates the following code for the above:

        lis 9,a@ha
        la 11,a@l(9)
        lis 9,b@ha
        la 9,b@l(9)
        lfd 0,0(9)
        stfd 0,0(11)

So it's trashing f0.

--- Matt Thomas <> wrote:

> At 06:02 PM 2/25/2005, you wrote:
> >Just tried -current (NetBSD 2.99.16). Still doesn't
> >seem to work.
> You need use sigaction and specify SA_SIGINFO.
> Only in that case will FP (or AltiVec) registers be
> preserved.
> -- 
> Matt Thomas                     email:
> 3am Software Foundry              www:
> Cupertino, CA              disclaimer: I avow all
> knowledge of this message.

Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we.