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

Adding support for MULX instruction. #1199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lvella
Copy link

@lvella lvella commented Apr 19, 2024

I am trying to implement the mulx instruction, but it is completely broken.

Whit this PR, the resulting c source from the file I am trying to decompile contains this broken typedef:

// ---------------- Integer Types Definitions -----------------

typedef int64_t int128_t;

The functions containing mulx are output as return 0, instead of whatever the code it has. E.g.:

// Address range: 0x1ce - 0x508
int64_t Fr_rawMMul(int64_t a1, int64_t a2, int64_t * a3) {
    // 0x4f0
    return 0;
}

This particular file I am trying is the nasm output of https://github.com/powdr-labs/zkevm-prover/blob/26decaa2f6faa5367ca2eb24abfd2f23c0eb37fe/src/ffiasm/fr.asm

Can someone help me with it?

@lvella lvella force-pushed the mulx-instruction branch 2 times, most recently from 1602afc to bfb2ee6 Compare April 19, 2024 16:33
@lvella
Copy link
Author

lvella commented Apr 19, 2024

Apparently this works for very simple examples, both using the last operand from register and from memory. But it breaks the case I actually care about.

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.

1 participant