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

cmd/compile: ARM64 rule redundancy #20663

Closed
randall77 opened this issue Jun 13, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@randall77
Copy link
Contributor

commented Jun 13, 2017

(Rsh64x64  x (MOVDconst [c])) && uint64(c) < 64 -> (SRAconst x [c])
(Rsh64x64 x y) -> (SRA x (CSELULT <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
(Const64 [val]) -> (MOVDconst [val])
(CMPconst  (MOVDconst [x]) [y]) && int64(x)<int64(y) && uint64(x)<uint64(y) -> (FlagLT_ULT)
(CSELULT x _ (FlagGT_ULT)) -> x
(SRA x (MOVDconst [c])) -> (SRAconst x [c&63])

The first rule is implied by the other rules. We don't need the first rule (except that it reduces the number of rewrites required).
We should also probably use MOVDconst instead of Const64 in rule #2.

@randall77 randall77 added this to the Go1.10 milestone Jun 13, 2017

@cherrymui cherrymui self-assigned this Jun 14, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Aug 30, 2017

Change https://golang.org/cl/60330 mentions this issue: cmd/compile: remove redundant constant shift rules

@gopherbot gopherbot closed this in 7846500 Aug 31, 2017

@golang golang locked and limited conversation to collaborators Aug 31, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.