Re: powerpc: avoiding lfd/stfd for 64 bit integer load/stores

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rasmus,

On Wed, Nov 21, 2018 at 11:05:38AM +0000, Rasmus Villemoes wrote:
> I'm trying to build the VxWorks kernel using gcc 7.3. It builds and
> boots, but I'm having a problem with use of fpr f0 from interrupt context.
> 
> An ISR ends up calling a function taking an unsigned long long, which is
> passed on to another function; the assembly code for shuffling that
> argument around is
> 
>   153698:       c8 01 00 68     lfd     f0,104(r1)
>   15369c:       d8 01 00 18     stfd    f0,24(r1)
> 
> and the first instruction triggers an exception. This is apparently gcc
> being clever and using just two instructions for loading/storing 64
> bits. It seems I can avoid the generation of these instructions with
> -msoft-float, but that's somewhat of a big hammer, as I do want to use
> the FPU for the stuff running in task context. I suppose I could try to
> apply -msoft-float just to the TUs that might be called from interrupts,
> but what I'm looking for is a switch to avoid using FPRs for integers
> (i.e., it's fine to use the FPU when the source code actually works on
> floats or doubles). Is there such a switch I'm overlooking?

There is no such switch.  Implementing such a switch would be hard; for
example, the convert-float-to-integer instructions need to store an integer
in a floating point register.

Compiling translation units with different needs, with different flags, is
the way to go.  -msoft-float means "do not use the FPRs".


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux