Open
Description
What is the feature you'd like to have?
Constant-folding inside of IL_MUL(U)_DP
, AFAIK currently it's not supported(?)
Is your feature request related to a problem?
not much
Are any alternative solutions acceptable?
Well, i can override arch plugin to change lifting in such way its won't use MUL_DP but it looks like overkill to me.
Additional Information:
Example code for arm64:
#include <stdint.h>
#include <stdio.h>
__attribute__((always_inline))
uint64_t mymul(uint32_t a, uint32_t b) {
uint64_t result = 0;
__asm volatile (
"umull %x[res], %w[first], %w[second]"
: [res] "=r" (result)
: [first] "r" (a), [second] "r" (b)
);
return result;
}
int main() {
if (mymul(5, 3) == 15) {
puts("15 indeed");
} else {
puts("pls, hide me out :C");
}
return 0;
}
This snippet uses umull
instruction, with a pretty trivial case that can be folded (two constant integers), however here is how it looks like in MLIL and HLIL:


Here is the binary i've tested on:
umull_test.zip