Skip to content

Adding support for MULX instruction.#1199

Open
lvella wants to merge 1 commit into
avast:masterfrom
lvella:mulx-instruction
Open

Adding support for MULX instruction.#1199
lvella wants to merge 1 commit into
avast:masterfrom
lvella:mulx-instruction

Conversation

@lvella

@lvella lvella commented Apr 19, 2024

Copy link
Copy Markdown

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 lvella force-pushed the mulx-instruction branch from bfb2ee6 to b5cf7d6 Compare April 19, 2024 16:40
@lvella

lvella commented Apr 19, 2024

Copy link
Copy Markdown
Author

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