-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
SIMD Helpers #249
Comments
I really hope this gets fixed soon. It makes it hard to work on games or anything that uses a lot of floats |
Note that on AArch64 typically, while far from perfect, the NEON instructions are recognized as special SIMD code, and you end up with code such as: auVar7 = SIMD_INT_SEXT(uVar21,2);
auVar5 = SIMD_INT_MULT(auVar5,auVar7,4);
auVar6 = SIMD_INT_ADD(auVar4,auVar5,4); This is already much better than what you get in x86, even though other limitations arises (such as type primitive confusions due to their sizes, and other maybe unrelated issues driving Ghidra crazy). If someone is willing to implement this correctly, they may be interested in test materials. For that I would typically suggest projects making heavy uses of intrinsics. |
I ran into this same issue with ARM, the decompiler completely failed to understand a function containing some very basic VFP instructions ( |
For now there is no devectorization in any form other than just using 4 functions/macros for manipulation over arrays of undefined (aka uchar): CONCAT, SUB, SEXT, ZEXT. The outputting of any vector instruction to C is restricted to only use them, no pointer arithmetic over reading/writing varnodes is permitted (it's actually transformed into those functions after heritage or something if there was an indirect access to register by its address). The latter would require serious rewriting of the decompiler engine to allow this. There are even more restrictions when memory is already dereferenced to e.g. an array of 16 or more bytes (type of such pointers is "undefined (*) [16]"), they must be written/stored just after filling in values in temporal registers. |
Is there any SIMD helpers for the decompiler?
Here is an intrinsics example:
This compiles to the following 3 instructions:
But the decompiler doesn't like it at all:
I wasn't able to hint the decompiler about a native
__m128
type.This is a very simple case, but in most multimedia related code, it leads to an insane amount of garbage. Combine this with the auto-vectorization of the compiler and you can forfeit the use of the decompiler for the whole function.
The text was updated successfully, but these errors were encountered: