Re: AES assembler optimizations

David S. Miller
2004-08-11T01:26:06Z

On Wed, 11 Aug 2004 11:02:48 +1000
Paul Mackerras <paulus@samba.org> wrote:

> David S. Miller writes:
>
> > On sparc64, we:
> >
> > 1) Always save the full FPU state at context switch time if it
> > is active.
> >
> > 2) On entry to a FPU-using kernel routine, we save the FPU if
> > it is active.
>
> How is that implemented? Do you have some magic to make gcc emit a
> call to an fpu-save routine in the prolog if the function uses the
> FPU? Or are you only talking about functions written in assembler?

All FPU usage is explicit, and VISEntry (if using the full FPU register
set) or VISEntryHalf (if using only the lower 32 registers) calls
are made to enter an FPU usage area, and VISExit/VISExitHalf is invoked
afterwards.

We could do it with traps, but there is no reason when we know
exactly where these places are and the save code is only a
handful of instructions.