I read this post and I was wondering if the CLR converts bytes and Int16 to Int32 for arithmetic, does it convert all bytes, Int16 and Int32 to Int64 when working in 64-bit mode?
Edit: Since the following loop:
for (short i = 0; i < 10; i++) {
}
will create something like this in IL:
Int16 i = 0;
LOOP:
Int32 temp0 = Convert_I16_To_I32(i); // !!!
if (temp0 >= 10) goto END;
...
Int32 temp1 = Convert_I16_To_I32(i); // !!!
Int32 temp2 = temp1 + 1;
i = Convert_I32_To_I16(temp2); // !!!
goto LOOP;
END:
Will the following loop:
for (int i = 0; i < 10; i++) {
}
To produce something similar on 64-bit architectures?
Int32 i = 0;
LOOP:
Int64 temp0 = Convert_I32_To_I64(i); // !!!
if (temp0 >= 10) goto END;
...
Int64 temp1 = Convert_I32_To_I64(i); // !!!
Int64 temp2 = temp1 + 1;
i = Convert_I64_To_I32(temp2); // !!!
goto LOOP;
END:
source
share