Where is the code created for sqrt and __CIsqrt?

I installed VC ++ to create ASM for a method that calls sqrt to find out if it generates FPU or SSE instructions. However, when sqrt is called, I do not see ASM. I only see a call to some __CIsqrt function that I assume is some sqrt system function. I do not see ASM to know what it is doing?

+4
source share
2 answers

This is because the compiler does not generate code - the code already exists in the library. If you want to see it, the easiest way is to often track the library function call in the debugger in assembler mode.

+5
source

Mathematical functions are implemented in the library. The library contains FPU / SSE2 instructions, but compilation requires additional code to implement the / fp option. Although most CRT code is available as source code in the vc \ crt \ src subdirectory of the VS installation directory, this is not so for mathematical functions. It is written by Intel, they probably did not allow the publication of the source. The library is in vc \ crt \ src \ intel \ mt_lib \ tran.lib. There are too many megabytes to ever consider disassembling.

If you want to see the assembly, you must create your project using / MT and go to the function using the debugger.

+2
source

Source: https://habr.com/ru/post/1307346/


All Articles