Are there different .net CLRs for x86 and x64 ?
decimal i = 89;
i=i++;
Will above code have different native code generated by CLR on x86, x64 ?
UPDATE:
If yes then when i install visual studio on my machine will install both the CLR versions independent of machine bits ? Has it to do something with performance ?
Yes, there is both a 32-bit and a 64-bit specific JITter. Which one your code will run under depends both on the host environment/process that loaded the CLR and the assembly itself.
When you build your assemblies you can choose whether it will target x86, x64, or “AnyCPU”.
There is also a case for ‘legacy’ assemblies which were built before this facility was introduced. I believe they act the same as the 32-bit ones.
Note that if your assembly has any 32-bit native dependencies then you should also mark it as 32-bit, otherwise it will be loaded as 64-bit in a 64-bit environment and the dependencies will fail to load.
To answer your updated questions:
64-bit machines will have both the 32-bit and the 64-bit CLR installed. The 32-bit is needed to run 32-bit assemblies under WOW64. (For example, Visual Studio is 32-bit!)
32-bit can sometimes run faster because pointers are smaller, so there is less cache/memory wasted on them. On the other hand, 64-bit mode has more registers available for the JITter to use. It depends on the characteristics of the code.