IL2X
IL2X copied to clipboard
Implement bitwise operators
This implements the parsing of the IL instructions
IL_000c: ldloc.0 // a
IL_000d: ldloc.1 // b
IL_000e: ldloc.0 // a
IL_000f: and
IL_0010: xor
IL_0011: ldloc.1 // b
IL_0012: not
IL_0013: ldc.i4.3
IL_0014: shr
IL_0015: or
IL_0016: ldc.i4.1
IL_0017: shl
IL_0018: stloc.2 // c
and the C codegen:
l_a = le_0;
l_b = 24;
le_1 = l_b & l_a;
le_1 = l_a ^ le_1;
le_1 = ~l_b;
le_1 = le_1 >> 3;
le_1 = le_1 | le_1;
le_1 = le_1 << 1;
l_c = le_1;