News for hackers. Stuff that matters.
Re:Intel AVX10: The Successor to AVX-512 by adrian_b on Monday July 24, 2023 @08:50PM (#36856332)
> I didn't understand everything about the "caller-saved volatile"

Whenever new registers are added to a CPU, it may be necessary to modify the operating system in order to save the new registers across context switches, but it is possible to change the ABI (i.e. the conventions for calling functions) in such a way that will allow the new functions that use the new registers to be linked with old functions that are not aware of the existence of the new registers.

To achieve this goal, it is enough to define in the ABI all the new registers as "caller-saved volatile".

This means that any function that uses some of the new registers must not assume anything about the values of those registers upon function entry and it must save them before calling any other function.

This ensures that regardless what other functions do, intentionally or accidentally, the values stored in the new registers cannot be corrupted, so it is safe to mix new functions that are aware of them with old functions that ignore them.

Had the new registers been defined e.g. as registers that must be preserved across calls, i.e. which must be saved inside the invoked function, that would not have worked, because an old function would not have known how to save them.

Re:Intel AVX10: The Successor to AVX-512 by fweimer on Tuesday July 25, 2023 @02:38PM (#36867260)
The hardest part is probably <setjmp.h>. We tried once on s390x (after it introduced vector registers), and it didn't work: https://lwn.net/Articles/605607/ And was eventually reverted: https://lwn.net/Articles/606377/

Not every function boundary is an ABI boundary, and compilers can and will automatically use custom ABIs for static functions (and, with LTO, for unexported global functions, too).