GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.kernel.org — Floating-point API — The Linux Kernel documentation Floating-point API¶Kernel code is normally prohibited from using floating-point (FP) registers or instructions, including the C float and double data types. This rule reduces system call overhead, because the kernel does not need to save and restore the userspace floating-point register state. However, occasionally drivers or library functions may need to include FP code. This is supported by isolating the functions containing FP code to a separate translation unit (a separate source file), and saving/restoring the FP register state around calls to those functions. This creates “critical sections” of floating-point usage. The reason for this isolation is to prevent the compiler from generating code
touching the FP registers outside these critical sections. Compilers sometimes
use FP registers to optimize inlined Usability of floating-point code within the kernel is architecture-specific. Additionally, because a single kernel may be configured to support platforms both with and without a floating-point unit, FPU availability must be checked both at build time and at run time. Several architectures implement the generic kernel floating-point API from
Build-time API¶Floating-point code may be built if the option CFLAGS_foo.o += $(CC_FLAGS_FPU) CFLAGS_REMOVE_foo.o += $(CC_FLAGS_NO_FPU) Architectures are expected to define one or both of these variables in their top-level Makefile as needed. For example: CC_FLAGS_FPU := -mhard-float or: CC_FLAGS_NO_FPU := -msoft-float Normal kernel code is assumed to use the equivalent of Runtime API¶The runtime API is provided in
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |