在函数调用之前保存XMM寄存器 [英] Saving the XMM register before function call

查看:152
本文介绍了在函数调用之前保存XMM寄存器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在汇编函数调用之前是否需要将任何XMM寄存器保存/推入堆栈? 因为我正在使用发布模式进行64位开发(使用AVX2)时在我的代码中观察到崩溃问题.在调试模式下,它的工作正常.我尝试保存XMM8寄存器的内容,并在函数调用结束时将其恢复,然后其工作正常.

Is it required to save/push the any XMM registers to the stack before the assembly function call? Because am observing the crash issue in my code with release mode for 64-bit development(Using AVX2). In debug mode its working fine. I tried with saving the content of the XMM8 register and restoring it at end of function call then its working fine.

有任何想法或参考吗?

推荐答案

是的,在Microsoft Windows上,您需要保留XMM6-XMM15寄存器.请参阅 http://msdn.microsoft.com/en-us/library/7kcdt6fy. aspx -其中包括xmm8,因此请保留它们或在函数中不使用它们.

Yes, on Microsoft Windows you are required to preserve the XMM6-XMM15 registers. See http://msdn.microsoft.com/en-us/library/7kcdt6fy.aspx - this includes xmm8, so either preserve them, or not use them in your function.

但是,在Linux上,这些是临时寄存器,因此不必保留.参见 http://www.x86-64.org/documentation/abi.pdf第21页.

However on Linux those are temporary registers, and therefore don't have to be preserved. See http://www.x86-64.org/documentation/abi.pdf page 21.

这篇关于在函数调用之前保存XMM寄存器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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