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

Support RISC-V floating-point extensions (F, D, Q) in decompiler #16

Open
dnpetrov-sc opened this issue Apr 28, 2022 · 0 comments
Open

Comments

@dnpetrov-sc
Copy link

Floating-point instructions are currently decompiled to __asm statements.
Example (from Whetstone benchmark):

    a2 = 0;
label_0:
    a4 = a1;
    do {
        __asm ("fadd.d ft2, ft1, ft2");
        __asm ("fadd.d ft2, ft2, ft0");
        __asm ("fsub.d ft2, ft2, ft3");
        __asm ("fmul.d ft2, ft2, fa0");
        __asm ("fsub.d ft1, ft1, ft0");
        __asm ("fadd.d ft1, ft1, ft3");
        __asm ("fadd.d ft1, ft1, ft2");
        __asm ("fmul.d ft1, ft1, fa0");
        __asm ("fadd.d ft0, ft3, ft0");
        __asm ("fadd.d ft0, ft0, ft2");
        __asm ("fsub.d ft0, ft0, ft1");
        __asm ("fmul.d ft0, ft0, fa0");
        __asm ("fsub.d ft3, ft3, ft2");
        __asm ("fadd.d ft3, ft3, ft1");
        __asm ("fadd.d ft3, ft3, ft0");
        a4 += -1;
        __asm ("fmul.d ft3, ft3, fa0");
    } while (a4 != 0);
    a2++;
    __asm ("fsub.d fa0, ft4, fa0");
    if (a2 != a0) {
        goto label_0;
    }
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

No branches or pull requests

1 participant