IL2X icon indicating copy to clipboard operation
IL2X copied to clipboard

Implement bitwise operators

Open Beyley opened this issue 2 years ago • 0 comments

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;

Beyley avatar Oct 15 '22 03:10 Beyley