Lines Matching +full:point +full:- +full:to +full:- +full:point

1 .. SPDX-License-Identifier: GPL-2.0+
3 Floating-point API
6 Kernel code is normally prohibited from using floating-point (FP) registers or
8 system call overhead, because the kernel does not need to save and restore the
9 userspace floating-point register state.
11 However, occasionally drivers or library functions may need to include FP code.
12 This is supported by isolating the functions containing FP code to a separate
14 state around calls to those functions. This creates "critical sections" of
15 floating-point usage.
17 The reason for this isolation is to prevent the compiler from generating code
19 use FP registers to optimize inlined ``memcpy`` or variable assignment, as
20 floating-point registers may be wider than general-purpose registers.
22 Usability of floating-point code within the kernel is architecture-specific.
23 Additionally, because a single kernel may be configured to support platforms
24 both with and without a floating-point unit, FPU availability must be checked
27 Several architectures implement the generic kernel floating-point API from
31 Build-time API
32 --------------
34 Floating-point code may be built if the option ``ARCH_HAS_KERNEL_FPU_SUPPORT``
41 Architectures are expected to define one or both of these variables in their
42 top-level Makefile as needed. For example::
44 CC_FLAGS_FPU := -mhard-float
48 CC_FLAGS_NO_FPU := -msoft-float
50 Normal kernel code is assumed to use the equivalent of ``CC_FLAGS_NO_FPU``.
53 -----------
61 This function reports if floating-point code can be used on this CPU or
62 platform. The value returned by this function is not expected to change
63 at runtime, so it only needs to be called once, not before every
69 These functions create a floating-point critical section. It is only
70 valid to call ``kernel_fpu_begin()`` after a previous call to
72 guaranteed to be callable from (preemptible or non-preemptible) process
76 should be minimized. They are *not* required to be reentrant. If the
77 caller expects to nest critical sections, it must implement its own