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

Rasmus Villemoes rasmus.villemoes@prevas.dk
Wed Nov 21 11:05:00 GMT 2018


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?

Thanks,
Rasmus


More information about the Gcc-help mailing list