How do you move 128-bit values ​​between XMM registers?

It seems like a trivial problem in the assembly: I want to copy the entire XMM0 register to XMM3. I tried

movdq xmm3, xmm0 

but MOVDQ cannot be used to move values ​​between two XMM registers. What should I do instead?

+6
source share
1 answer

Is it movapd , movaps or movdqa

 movaps xmm3, xmm0 

They all do the same, but there is a catch:

  • movapd and movaps work in a floating point domain.
  • movdqa works in integer area

Use the appropriate one according to your data type to avoid domain changes.

There is also no reason to use movapd . Always use movaps instead, because movapd takes an extra byte for encoding.

+10
source

Source: https://habr.com/ru/post/904691/


All Articles