使用 XMM 寄存器保存通用寄存器是否安全


        pushf       //couldnt store this in other registers 
        movd xmm0,eax//storing in xmm registers instead of   pushing
        movd xmm1,ebx//
        movd xmm2,ecx//
        movd xmm3,edx//
        movd xmm4,edi//end of push backups
        .
        .//doing work
        .
        movd edi,xmm4//pop edi
        movd edx,xmm3//pop edx
        movd ecx,xmm2//pop ecx
        movd ebx,xmm1//pop ebx
        movd eax,xmm0//pop eax
        popf

比我的计算机中的推送EAX版本快%50。这安全吗?

是的,只要您(或您正在调用的某些代码(在此期间不使用 XMM regs 进行任何其他操作。事实上,这个技巧在 RAM 初始化之前的 BIOS 代码中常用。

最新更新