Skip to content
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

Improved inline multiplication in JIT for x86 #5237

Merged
merged 1 commit into from Sep 30, 2021

Conversation

potatosalad
Copy link
Contributor

This moves multiplication for small integers inline with overflow checking, along with specialization for when the left or right hand side are immediates.

The original comments related to clobbering RDX, I think, are incorrect based on how we're using imul in 2-operand form instead of 1-operand form (see reference docs for imul):

We avoid using ARG2 and ARG3 because multiplication clobbers RDX, which is
ARG2 on Windows and ARG3 on SystemV.

As a very non-scientific benchmark: based on some tests involving a pure Erlang version of MurmurHash3_x86_32 with a 1MB input key, this change alone roughly doubled performance for me (30ms originally down to 15ms).

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2021

CLA assistant check
All committers have signed the CLA.

@rickard-green rickard-green added the team:VM Assigned to OTP team VM label Sep 23, 2021
@garazdawi garazdawi added enhancement testing currently being tested, tag is used by OTP internal CI labels Sep 27, 2021
@garazdawi garazdawi merged commit 6851eed into erlang:master Sep 30, 2021
@garazdawi
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement team:VM Assigned to OTP team VM testing currently being tested, tag is used by OTP internal CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants