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

[decompiler] recognize vector-dot #487

Closed
water111 opened this issue May 15, 2021 · 2 comments
Closed

[decompiler] recognize vector-dot #487

water111 opened this issue May 15, 2021 · 2 comments
Labels
blocking-decomp Decompiler fails completely, blocking progress

Comments

@water111
Copy link
Collaborator

it shows up a lot.

It would be cool to do this in a general way, in case there are other commonly inlined asm functions that could be recognized.
Luckily the registers always end up the same, this was an asm function with manually specified registers and the allocator didn't run on these

    lwc1 f0, 0(a0)
    lwc1 f1, 4(a0)
    lwc1 f2, 8(a0)
    lwc1 f3, 12(a0)
    lwc1 f4, 0(a1)
    lwc1 f5, 4(a1)
    lwc1 f6, 8(a1)
    lwc1 f7, 12(a1)
    mula.s f0, f4
    madda.s f1, f5
    madda.s f2, f6
    madd.s f0, f3, f7
    mfc1 v0, f0
    jr ra
    daddu sp, sp, r0
@water111 water111 added the blocking-decomp Decompiler fails completely, blocking progress label May 30, 2021
@water111
Copy link
Collaborator Author

water111 commented Jun 7, 2021

This was implemented for the 3 dimensional case vector-dot in #560 but not 4 vector4-dot. An example of 4 is ray-arbitrary-circle-intersect.

In general, this type of detection works, but fails to build it into expressions in a nice way automatically. It is an unfortunate limitation of the decompiler framework but I don't really know how to fix it.

@water111
Copy link
Collaborator Author

now tracked in #636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking-decomp Decompiler fails completely, blocking progress
Projects
None yet
Development

No branches or pull requests

1 participant