本文介绍了如何将浮点常量值移动到 xmm 寄存器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是将值移动到 xmm 寄存器的唯一方法,首先将值移动到整数寄存器,不知道它们叫什么,然后再移动到 xmm 寄存器,例如

Is the only way to move a value into an xmm register by first moving the value into an integer register, dunno what they are called, and then into the xmm register e.g.

mov   [eax], (float)1000   ; store to memory
movss xmm1,[eax]           ; reload

mov        eax,  1000       ; move-immediate integer
cvtsi2ss   xmm1,eax         ; and convert

或者有其他方法吗?有没有办法直接将值移动到 xmm 寄存器中,类似于:movss xmm1,(float)1000?

or is there another way? Is there a way to directly move a value into a xmm register, something along the lines of: movss xmm1,(float)1000?

推荐答案

没有使用立即数加载 SSE 寄存器的说明.常见的习惯用法是从全局常量加载您需要的值:

There are no instructions to load an SSE register with an immediate. The common idiom is to load the value you need from a global constant:

const   dd 1000.0

...

        movss xmm0,[const]

这篇关于如何将浮点常量值移动到 xmm 寄存器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-15 23:27