在c ++下调用asm sqrtsd [英] call asm sqrtsd under a c++
本文介绍了在c ++下调用asm sqrtsd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在visual 2012下如何在c ++项目中调用sqrtsd asm函数
Under visual 2012 how can I call the sqrtsd asm function in a c++ project
我无法通过google找到它
I can't find it via google
例如:
double mySqrt(double val)
{
__asm
{
...
sqrstd...
}
}
编辑:
在32位模式下
推荐答案
我认为这是一个有点学术的练习,因为它不可能有任何实际的好处,很可能是一个惩罚。但是:
I think doing this is a somewhat academic excercise, as it's unlikely to have any actual benefit, and quite likely a penalty. However:
double mySqrt(double val)
{
double retu;
__asm
{
sqrtsd xmm1, val
movsd retu, xmm1
}
return retu;
}
这篇关于在c ++下调用asm sqrtsd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文