what's the point of using xmm registers when they'll get clobbered (or have to be moved back to memory) whenever you need to do a floating point operation? at least with ymm/zmm you can hope that you're not using AVX.
>The reason why we won't be considering other operating systems is because the System V ABI doesn't preserve any of the XMM registers between calls and puts the burden on the caller to save them on the stack. If you think about it, this sort of defeats the purpose of using a register buffer if we're always going to be pushing our bytes to memory in user space.
as opposed to windows? regardless of whether it's the caller/callee's job to preserve registers, the result is the same.
> what's the point of using xmm registers when they'll get clobbered (or have to be moved back to memory) whenever you need to do a floating point operation? at least with ymm/zmm you can hope that you're not using AVX.
Nope, because SSE operations are explictly defined as setting the upper bits of the ymm/zmm registers to zero.
> as opposed to windows? regardless of whether it's the caller/callee's job to preserve registers, the result is the same.
There is a huge difference, with caller saved registers, the caller must compulsively save all registers it's using to the stack before it calls a function. With callee saved registers, if the callee doesn't use the registers, then it doesn't need to save them and a bunch of extra push/pops are saved.
It is optimal to have a mixture of caller and callee saved registers, so the compiler pick what type it uses for each function/variable.
>The reason why we won't be considering other operating systems is because the System V ABI doesn't preserve any of the XMM registers between calls and puts the burden on the caller to save them on the stack. If you think about it, this sort of defeats the purpose of using a register buffer if we're always going to be pushing our bytes to memory in user space.
as opposed to windows? regardless of whether it's the caller/callee's job to preserve registers, the result is the same.