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

Add LZCNT support, use in cntlzw #1083

Merged
merged 2 commits into from
Sep 14, 2014
Merged

Conversation

FioraAeterna
Copy link
Contributor

Includes a unit test, but since my CPU doesn't support this instruction I haven't actually tested this yet.

@skidau
Copy link
Contributor

skidau commented Sep 14, 2014

Code looks good. Nice one.

@Sonicadvance1
Copy link
Contributor

This gets hit fairly often in games.
I couldn't find a regression and it's a fairly simple optimization.

Sonicadvance1 added a commit that referenced this pull request Sep 14, 2014
Add LZCNT support, use in cntlzw
@Sonicadvance1 Sonicadvance1 merged commit 4e16abd into dolphin-emu:master Sep 14, 2014
@shuffle2
Copy link
Contributor

btw, common usage I've seen is documented in the CWG at 5.4 "The x = y predicate has the value 1 if x = y, and 0 if x ≠ y". It might be a good candidate for small local optimization... Basically, sequence is:

sub rz, ry, rx
cntlzw rz, rz
swri rz, rz, 5
rz = (rx == ry)

@FioraAeterna
Copy link
Contributor Author

Wow, you're right; almost every single usage of cntlzw seems to be for that purpose.

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

Successfully merging this pull request may close these issues.

4 participants