Skip to content

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