Closed arkup closed 4 years ago
This looks like an issue with the e_cmpi instruction. Using the CRD32 field to offset the results of the compare into the CRALL register doesn't allow the compiler to figure out how to manage the compare.
If you update line 1072 of ppc_common.sinc to attach variables [ BI_CR_VLE BF_VLE ]
and replace lines 558-559 of ppc_vle.sinc with:
tmpC:1 = (((tmpA s< tmpB) << 3) | ((tmpA s> tmpB) << 2) | ((tmpA == tmpB) << 1) | (xer_so & 1));
BF_VLE = tmpC;
the correct comparison comes out for the sample binary. Does that fix the issue that you're seeing elsewhere as well?
@GhidorahRex thanks it's good. I'll test more and let you know but seems you can close the issue.
Describe the bug
I've noticed that in PowerPC VLE function is not decompiled correctly.
To Reproduce
echo ATAYA6gr5ANIIwAEGADQAEgTAAQ= | base64 -d > decompile_if_else.bin
Expected behavior
Environment :