On 01/12/2015 18:20, Richard Henderson wrote: >> >> X86XSaveArea will be used only when loading/saving state using >> xsave, not for executing regular instructions. > > ... like the regular instruction xsave? > > https://patchwork.ozlabs.org/patch/493318/
Right, but that's a helper anyway. >> In X86CPU, the >> data is already stored as XMMReg unions (the one with the >> XMM_[BWDQ] helpers). > > Of course. But those unions are arranged to be in big-endian format on > big-endian hosts. So we need to swap the data back to little-endian > format for storage into guest memory. Yes, you can use byte moves with XMM_B (more obvious), or stq_le_p with XMM_Q (faster I guess---though the compiler might optimize the former on little-endian hosts). Either works with an uint8_t[] destination. Paolo