Skip to main content

fpu_context

Macro fpu_context 

Source
macro_rules! fpu_context {
    ("save") => { ... };
    ("restore") => { ... };
}
Expand description

This macro expands to code for saving/restoring FPU context in an exception handler. It pushes a multiple of eight bytes to preserve AAPCS alignment. It may damage R0-R3.

On entry to this block, we assume that we are in exception context.

This version saves FPU state, assuming 16 DP registers (a ‘D16’ or ‘D16SP’ FPU configuration). Note that SP-only FPUs still have DP registers

  • each DP register holds two SP values.

EABI specifies D8-D15 as callee-save, and so we don’t preserve them because any C function we call to handle the exception will preserve/restore them itself as required.