进程启动时,谁设置浮点控制注册表MXCSR = 00001F80? [英] When a process starts, who sets the floating-point control registry MXCSR = 00001F80 ?

查看:77
本文介绍了进程启动时,谁设置浮点控制注册表MXCSR = 00001F80?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道浮点控制注册表的状态在哪个时间点设置?


例如,在x64中,MXCSR的状态为00001F80(对于此cas中的SSE指令)。但是谁设定了它?进程创建时的OS加载程序(kernel32.dll,ntdll.dll,crt初始化?)?或线程创建时间?


可以使用control_fp_s手动修改此状态,但我感兴趣的是:谁设置了给定进程的默认值?


此外,它与.NET"托管进程"的行为是否相同? ?


提前感谢任何相关信息。


 

解决方案

Steve Massicotte,


感谢您在这里发帖。


>>我想知道在哪个时间点漂浮的状态设置了点控制注册表?


例如,在x64中,MXCSR的状态为00001F80(对于此cas中的SSE指令)。但是谁设定了它?进程创建时的OS加载程序(kernel32.dll,ntdll.dll,crt初始化?)?或线程创建时间?


可以使用control_fp_s手动修改此状态,但我感兴趣的是:谁设置了给定进程的默认值?


鉴于扩展的寄存器集,x64使用
__ fastcall
调用约定和基于RISC的异常处理模型。
__ fastcall约定使用前四个参数的寄存器和堆栈帧来传递其他参数。所有浮点运算都使用16 XMM寄存器完成。整数参数在寄存器RCX,RDX,R8和
R9中传递。浮点参数在XMM0L,XMM1L,XMM2L和XMM3L中传递。 16个字节的参数通过引用传递。参数传递在
参数传递中有详细描述 。除了这些寄存器之外,RAX,R10,R11,XMM4和XMM5被认为是易失性的。所有其他寄存器都是非易失性的。注册
用法详细记录在
注册用法

Caller-Callee保存的注册表


有关详细信息,请参阅此文档。


https://msdn.microsoft.com/en-us/library/ms235286.aspx


希望这对您有所帮助。


最好的问候,


Sera Yu




I wonder at which point in time the state of the floating-point control registry is set ?

For example, in x64, the state of MXCSR is 00001F80 (for SSE instructions in this cas). But who sets it ? The OS loader (kernel32.dll, ntdll.dll, the crt initialization ?) at process creation time ? or thread creation time ?

This state can be manually modified using control_fp_s, but what I'm interested in is: who sets the default for a given process ?

Also, is it the same behaviour for a .NET "managed process" ?

Thanks in advance for any related information.

 

解决方案

Hi Steve Massicotte,

thanks for posting here.

>>I wonder at which point in time the state of the floating-point control registry is set ?

For example, in x64, the state of MXCSR is 00001F80 (for SSE instructions in this cas). But who sets it ? The OS loader (kernel32.dll, ntdll.dll, the crt initialization ?) at process creation time ? or thread creation time ?

This state can be manually modified using control_fp_s, but what I'm interested in is: who sets the default for a given process ?

Given the expanded register set, x64 uses the __fastcall calling convention and a RISC-based exception-handling model. The __fastcall convention uses registers for the first four arguments and the stack frame to pass additional arguments. All floating point operations are done using the 16 XMM registers. Integer arguments are passed in registers RCX, RDX, R8, and R9. Floating point arguments are passed in XMM0L, XMM1L, XMM2L, and XMM3L. 16-byte arguments are passed by reference. Parameter passing is described in detail in Parameter Passing. In addition to these registers, RAX, R10, R11, XMM4, and XMM5 are considered volatile. All other registers are non-volatile. Register usage is documented in detail in Register Usage and Caller-Callee Saved Registers.

For more information, please refer to this document.

https://msdn.microsoft.com/en-us/library/ms235286.aspx

Hope this could be help of you.

Best Regards,

Sera Yu


这篇关于进程启动时,谁设置浮点控制注册表MXCSR = 00001F80?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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