MOVDQA 和 MOVAPS x86 指令之间的区别? [英] Difference between MOVDQA and MOVAPS x86 instructions?

查看:32
本文介绍了MOVDQA 和 MOVAPS x86 指令之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看英特尔数据表:英特尔® 64 和 IA-32 架构Software Developer's Manual 和我找不到

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

  • MOVDQA:移动对齐双四字
  • MOVAPS:移动对齐打包单精度
  • MOVDQA: Move Aligned Double Quadword
  • MOVAPS: Move Aligned Packed Single-Precision

在英特尔数据表中,我可以找到这两个指令:

In Intel datasheet I can find for both instructions:

此指令可用于从 128 位内存位置,将 XMM 寄存器的内容存储到128 位内存位置,或在两个 XMM 寄存器之间移动数据.

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.

唯一的区别是:

要将双四字移入或移出未对齐的内存位置,请使用MOVDQU 指令.

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

将压缩的单精度浮点值移入或移出未对齐的内存位置,使用 MOVUPS 指令.

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?

那么谁能解释一下其中的区别?

推荐答案

在功能上,它们是相同的.

In functionality, they are identical.

某些(但不是全部)微架构上,由于跨域惩罚"而存在时间差异.因此,当数据与整数 SSE 指令一起使用时,通常应该使用 movdqa,而当数据与浮点指令一起使用时,应该使用 movaps.有关此主题的更多信息,请参阅英特尔优化手册或 Agner Fog 的优秀微体系结构指南.请注意,这些延迟通常与寄存器寄存器移动相关,而不是与加载或存储相关.

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.

这篇关于MOVDQA 和 MOVAPS x86 指令之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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