-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[mono][interp] Lower div.un to shr.un.imm #83498
Conversation
Generate sub opcode instead which is detected by other optimizations.
Tagging subscribers to this area: @BrzVlad, @kotlarmilos Issue DetailsIf divisor is power of 2.
|
#endif | ||
td->sp -= 2; | ||
interp_ins_set_sregs2 (td->last_ins, td->sp [1].local, td->sp [0].local); | ||
push_simple_type (td, STACK_TYPE_I); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original interp opcode looks like it was storing the result of a signed pointer subtraction into an unsigned int (mono_u), but I assume this will behave correctly as-is?
|
||
interp_clear_ins (def); | ||
interp_clear_ins (ins); | ||
local_ref_count [sreg_imm]--; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably mono_interp_stats.super_instructions++;
is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these stats are not that useful anymore, I will probably get rid of them in the future. Also this is more of a peephole optimization. This pass will probably end up being rebranded.
If divisor is power of 2.