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

Identify signed division by constant #50

Closed
Emill opened this issue Jan 19, 2020 · 1 comment
Closed

Identify signed division by constant #50

Emill opened this issue Jan 19, 2020 · 1 comment

Comments

@Emill
Copy link
Contributor

Emill commented Jan 19, 2020

    phi_s3 = arg1 >> 3;
    if (arg1 < 0)
    {
        phi_s3 = (s32) (arg1 + 7) >> 3;
    }

should simply become phi_s3 = arg1 / 8;

@simonlindholm
Copy link
Collaborator

simonlindholm commented Sep 20, 2020

Fixed in 7cd319d (for powers of two; for other numbers IDO seems to emit div instructions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants