Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement bitwise operators #2

Open
wants to merge 3 commits into
base: remake
Choose a base branch
from
Open

Conversation

Beyley
Copy link
Contributor

@Beyley Beyley commented Oct 15, 2022

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant