windows - 为什么 Windows x64 调用约定不使用 XMM 寄存器来传递超过 4 个整数参数?

标签 windows assembly x86-64 sse calling-convention

(微软)x64 calling convention状态:

The arguments are passed in registers RCX, RDX, R8, and R9. If the arguments are float/double, they are passed in XMM0L, XMM1L, XMM2L, and XMM3L.

这很好,但为什么只是 float /加倍?为什么整数(可能还有指针)不也通过 XMM 寄存器传递?
似乎有点浪费可用空间,不是吗?

最佳答案

因为大多数对非 FP 值(即整数和地址)的操作都设计为使用通用寄存器。

有整数 SSE 运算,但它们只是算术运算。

因此,如果调用约定支持通过 SSE 寄存器传递整数和地址,则几乎总是需要将值复制到通用寄存器。

关于windows - 为什么 Windows x64 调用约定不使用 XMM 寄存器来传递超过 4 个整数参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6274917/

相关文章:

string - 字符串中 2 个字符之间的汇编切换

gcc - Linux kernel 5.4 GCC 9.1.0 不显示代码覆盖率

assembly - 有没有办法让 sbcl 打印出 CPU 寄存器的值?

assembly - 如何让 gdb 反汇编整个函数?

windows - 如何方便地推断Azure SDK csrun.exe的路径?

android - genymotion 蓝屏死机 windows 10

c++ - 来自数组 0 初始化的奇怪程序集

windows - QPainter::drawPixmap 在 Windows 和 Linux 上表现不同

windows - 尽管 WinMobile 上有足够的物理内存,VirtualAlloc 怎么会失败(没有内存)?

assembly - PTX "bit bucket"寄存器