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: add OpAMD64CMPptr and friends? #20873

josharian opened this issue Jun 30, 2017 · 2 comments

cmd/compile: add OpAMD64CMPptr and friends? #20873

josharian opened this issue Jun 30, 2017 · 2 comments


Copy link

@josharian josharian commented Jun 30, 2017

amd64.rules contains a fair number of rules that are conditional on config.PtrSize, to support amd64p32. See CL 46870 for a recent example. To reduce duplication, I suggest we add ops whose lowering depends on pointer size. So for example, instead of:

(IsInBounds idx len) && config.PtrSize == 8 -> (SETB (CMPQ idx len))
(IsInBounds idx len) && config.PtrSize == 4 -> (SETB (CMPL idx len))

we would have only:

(IsInBounds idx len) -> (SETB (CMPptr idx len))

where CMPptr is treated as CMPQ for amd64 and CMPL for amd64p32. Similarly so for other such duplicated rules.

Opinions or objections, @randall77 @cherrymui?

@josharian josharian added this to the Go1.10 milestone Jun 30, 2017
@josharian josharian self-assigned this Jun 30, 2017
Copy link

@randall77 randall77 commented Jul 1, 2017

Sounds ok to me. You are, however, trading verbosity in some places for verbosity elsewhere.
You're removing a IsInBounds rule, but then you need a CMPconstptr op, rules to generate that op, etc.
It's not clear to me that it is a net win. If it is, go for it.

@bradfitz bradfitz modified the milestones: Go1.10, Go1.11 Nov 28, 2017
@dr2chase dr2chase modified the milestones: Go1.11, Unplanned Jun 22, 2018
Copy link

@dr2chase dr2chase commented Jun 22, 2018

No recent progress, seems like this is not setting anyone's hair on fire, moving to unplanned.

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

Successfully merging a pull request may close this issue.

None yet
5 participants