On Tue, Jun 23, 2020 at 06:51:22AM -0400, Bryan Steele wrote:
> On Mon, Jun 22, 2020 at 11:10:10PM -0700, jo...@armadilloaerospace.com wrote:
> > Are SSE instructions allowed in the AMD64 kernel?  Is #ifdef __SSE__
> > a sufficient guard?
> > 
> > I have a rasops32 putchar with SSE that is 2x faster.
> 
> No, in general you cannot using FP instructions in the kernel, also the
> kernel is often compiled with -msoft-float on platforms that support it.

More specifically using the FP instructions the kernel incurs a
performance penalty from having to save and restore the FP registers.
There are some helper functions for that in the very limited cases
where it's done, see fpu_kernel_enter/exit() in arch/amd64/amd64/fpu.c.
But these are i386/amd64-only.

Reply via email to