Sign in to follow this  

sinf and and libm on msc

Recommended Posts

after compiling 

float x = sinf(y);//y is a float result is the same if i use std::sin

The output dissasembly for msvc is: 

00B61018  push        esi  
00B61019  call        __libm_sse2_sin_precise (0B6192Ah)  
00B6101E  cvtsd2ss    xmm0,xmm0  
00B61022  movss       dword ptr [ebp-38h],xmm0  

Well I'm using floats and it is calling double precision sin(). Compiling the same code with gcc calls "..libm_sincosf". 

Why MS aren't calling single precision equivalents? How can i fix this?

Share this post

Link to post
Share on other sites

Why isn't MS using single precision? I'm not sure. Personally, I don't think its that big a deal. If you don't want it to do the double precision routine you could try using the LibM library AMD. I'm not sure how it will cooperate with the built in sinf when it comes to linking the program.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this