# 2019q1 Homework2 (kcalc) contributed by < `guojiun` > ## 實驗環境 ```shell $ uname -r 4.15.0-45-generic ``` ## 自我檢查清單 * 解釋浮點運算在 Linux 核心中為何需要特別對待 * FPU state ? register * user space 使用 floating point 時需要透過 kernel : `If a program attempts an FPU op, the program will trap into the kernel, the kernel will turn the FPU on, restore any saved state that may already exist, and then return to re-execute the FPU op.` * When using floating-point instructions kernel normally catches a trap and then initiates the transition from integer to floating point mode. * The kernel can trap into itself and does so for many things. (Timers, page faults, device interrupts, others.) * but.. it cannot easily trap itself. * Using a floating point inside the kernel requires manually saving and restoring the floating point registers. * kernel doesn't particularly need FPU ops * needs to run on architectures without an FPU at all. * there are always other software solutions. ex: fixed-point