Advertisement

sinf and and libm on msc

Started by June 23, 2014 11:24 AM
0 comments, last by HappyCoder 10 years, 7 months ago

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?

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.

My current game project Platform RPG

This topic is closed to new replies.

Advertisement