Skip to content

de-optimized math replacements / idiom detection #2043

@psifertex

Description

@psifertex

Compilers do lots of fun things to calculate modulo or division with shifts and multiplication. We need a new optimization pass which will replace these more opaque operations with simplified expressions.

See:

https://zneak.github.io/fcd/2017/02/19/divisions.html
https://github.com/hcs0/Hackers-Delight

And a previous plugin that simply annotates with a comment:
https://github.com/cah011/binja-div

Metadata

Metadata

Assignees

Labels

Effort: MediumIssue should take < 1 monthImpact: HighIssue adds or blocks important functionality

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions