【问题标题】:How are AVX registers handled by the common calling conventions?常见的调用约定如何处理 AVX 寄存器?
【发布时间】:2012-01-13 08:12:28
【问题描述】:

我找不到任何定义调用者和被调用者如何处理 YMM 寄存器的文档。

为了集中我的问题,以下是我想知道的:

  1. 在返回给调用者之前,被调用者必须恢复哪些 YMM 寄存器?
  2. 由于 XMM 寄存器在 Linux 和 Windows 中存在差异,我假设 YMM 寄存器也不遵循相同的规则。每个操作系统的规则是什么?

编辑: 感谢下面的答案,我能够在提到的 Win64 文档中找到答案。我很确定 Linux 也遵循类似的规则:

"...
The YMM registers do not have callee-save status, except for the lower half
of YMM6-YMM15 in 64-bit Windows, where XMM6-XMM15 have callee-save status.
Possible future extensions of the vector registers to 512 bits or more will not have calleesave
status.
..."

【问题讨论】:

    标签: windows linux calling-convention avx


    【解决方案1】:

    您的两个问题的答案(假设您正在谈论 C++ 中的调用约定)在 Agner Fog 的 optimization guide 中:

    Calling conventions for different C++ compilers and operating systems

    请参阅第 10 页的第 6 节(寄存器用法)。第 22 页的第 7.2 节(传递和返回 SIMD 类型)也可能是相关的。

    【讨论】:

      猜你喜欢
      • 2020-10-06
      • 1970-01-01
      • 2011-07-14
      • 1970-01-01
      • 2015-08-18
      • 1970-01-01
      • 2016-11-22
      • 1970-01-01
      • 2016-10-03
      相关资源
      最近更新 更多