是可以安全使用XMM寄存器保存通用的呢? [英] is it safe to use xmm registers to save the general-purpose ones?

查看:1110
本文介绍了是可以安全使用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

为50%,比我的电脑推EAX版本速度更快。这安全吗?

is %50 faster than push eax version in my computer. Is this safe?

推荐答案

是的,只要你(或code你打电话)不使用XMM暂存器在此期间其他任何东西。事实上,这一招通常在BIOS中code初始化内存之前使用。

Yes, as long as you (or some code you're calling) doesn't use XMM regs for anything else in the meantime. In fact, this trick is commonly used in BIOS code before RAM init.

这篇关于是可以安全使用XMM寄存器保存通用的呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆