Andrew Pinski <pins...@gmail.com> wrote:
> I am trying to understand the difference between this option and
> -mgeneral-regs-only since you mentioned that FPU will be disabled for
> those cases.

Thanks for taking a look at the patch; I was also surprised that there
wasn't some existing option that I could use.

This new option only disables FPU registers when used implicitly by
memory options, such as struct copies and calls to memset, memmove or
memcpy. Unlike -mgeneral-regs-only, other uses, like explicit floating
point or SIMD operations will still use those registers. The goal is to
let code which doesn't "obviously" use the FPU avoid unintentional
usage. These memory operations were the only place I found which used
them for non-SIMD/FP data.

> Also I am not sure aarch64-elf should turn off this by default since
> there are some bare metal env which support the full SIMD registers
> for interrupt save/restoring.

The impetus for this series was use of va_start from an interrupt
handler in Zephyr. Zephyr fully supports save/restore of SIMD registers
in task context, but if used in an interrupt handler, the OS needs to
disable interrupts as there's no place to save the registers in a nested
handler.

So, the existing compiler generates code that "mostly works", but it
changes the semantics of interrupt processing. Fortunately, the Zephyr
test suite includes an explicit check to verify correct operation of
nested interrupt handlers which failed on aarch64 with gcc 14.3.

The previous compiler version in use by Zephyr (12.2) didn't use SIMD
registers for these memory operations, so this test appears as a
regression.

-- 
-keith

Attachment: signature.asc
Description: PGP signature

Reply via email to