Difference between MOVDQA and MOVAPS x86 instructions?

爷,独闯天下 提交于 2019-11-26 20:35:54

问题


I'm looking Intel datasheet: Intel® 64 and IA-32 Architectures Software Developer’s Manual and I can't find the difference between

  • MOVDQA: Move Aligned Double Quadword
  • MOVAPS: Move Aligned Packed Single-Precision

In Intel datasheet I can find for both instructions:

This instruction can be used to load an XMM register from a 128-bit memory location, to store the contents of an XMM register into a 128-bit memory location, or to move data between two XMM registers.

The only difference is:

To move a double quadword to or from unaligned memory locations, use the MOVDQU instruction.

and

To move packed single-precision floating-point values to or from unaligned memory locations, use the MOVUPS instruction.

But I can't find the reason why two different instructions?

So can anybody explain the difference?


回答1:


In functionality, they are identical.

On some (but not all) micro-architectures, there are timing differences due to "domain crossing penalties". For this reason, one should generally use movdqa when the data is being used with integer SSE instructions, and movaps when the data is being used with floating-point instructions. For more information on this subject, consult the Intel Optimization Manual, or Agner Fog's excellent microarchitecture guide. Note that these delays are most often associated with register-register moves instead of loads or stores.



来源:https://stackoverflow.com/questions/6678073/difference-between-movdqa-and-movaps-x86-instructions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!