Skip to content

Strength reduce x quotRem 8#8

Merged
winterland1989 merged 1 commit intowinterland1989:masterfrom
alexbiehl:strength
Nov 30, 2016
Merged

Strength reduce x quotRem 8#8
winterland1989 merged 1 commit intowinterland1989:masterfrom
alexbiehl:strength

Conversation

@alexbiehl
Copy link
Contributor

Unfortunately GHC < 8.2 doesn't replace x quotRem 8 by more efficient instructions. This patch replaces (i, j) = x quotRem 8 with i = unsafeShiftR x 3 and j = x .&. 3.

@winterland1989
Copy link
Owner

It seems the decode test is starting failing, would you investigate it?

@alexbiehl
Copy link
Contributor Author

It's good now. :)

@winterland1989 winterland1989 merged commit 78fc630 into winterland1989:master Nov 30, 2016
@winterland1989
Copy link
Owner

Ah, nice catch, rem 8 's mask should be 0b111 not 0b11.

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.

2 participants