Q:

how does .Net framework implement from int conversion to float?

I know int and float that each other aliases the System.Int32 and System.Float type in .Net framework.But i can't find the  implicit cast to float code in the System.Int32 code  System.Int32 source code in the .Net reference Source .Where can i find the implement code ? or should i search the Roslyn code to find how it check the implicit type conversion ?

A:

Let's take a step back and review how compilation in .net works. You start with a high level language, such as c#. In this language you write something like
float Convert(int i) { return (float) i; }

C# compiler takes this and compiles it to executable in clr binary format. In this binary all methods classes and other artifacts of your code are located, and method code is represented by bytecode in Intermediate Language or IL. The specification of CLR infrastructure including description of IL is readily available.
Your function will be converted to byte code that looks like the following, if we convert it back to human readable form:
ldarg.0 // load argument on stack
conv.r4 // take value from stack, convert it to 32bit float and put the result on stack
ret     //  return

This means that the conversion you are interested in is implemented in a single IL command, namely conv.r4. 
Now let's remember that .NET code can run on variety of CPUs. It can run on 64bit intel, on 32bit intel and on ARM. It's not difficult to understand, that the actual code that runs on a CPU is going to differ from CPU to CPU.
JIT (or just-in-time compiler) is responsible of converting the IL bytecode to the actual CPU instructions that the target CPU can run.
The source code of jit for .net core can be found in github for your perusal. I'm not aware of any published .net jit code prior to that (that is for .net versions before .net core came around), I think it's closed source.
You will have to search the available code yourself, to find the portions that interests you, but I'd like to invite your attention to the genIntToFloatCast function that can help you to start in the right direction. This is for Amd64/x86.

