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

more SETcc improvements to backend #4904

Merged
merged 1 commit into from
Aug 18, 2015
Merged

Conversation

WalterBright
Copy link
Member

Make better use of SETcc instructions.

cg = cat(cg,getregs(retregs));
cg = genregs(cg,0x19,reg,reg); // SBB reg,reg
cg = gen2(cg,0xF7,modregrmx(3,3,reg)); // NEG reg
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latency of SBB+NEG is 3 vs. 2 for SETcc+MOVZX, so you might want to use SETcc here as well though it requires 4 bytes for the code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only beneficent for loops.

@WalterBright
Copy link
Member Author

While I wait impatiently for ddmd (hint, hint) I decided to do some tuneups to the back end. If you notice any code sequences where clang/gcc do a better job than dmd, let me know.

@MartinNowak
Copy link
Member

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request Aug 18, 2015
more SETcc improvements to backend
@MartinNowak MartinNowak merged commit 6125dee into dlang:master Aug 18, 2015
@WalterBright WalterBright deleted the moreSETcc branch August 18, 2015 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants