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

Open
josharian opened this issue Jun 30, 2017 · 2 comments
Open

cmd/compile: add OpAMD64CMPptr and friends? #20873

josharian opened this issue Jun 30, 2017 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@josharian
Copy link
Contributor

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
@randall77
Copy link
Contributor

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
@dr2chase
Copy link
Contributor

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

@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Sep 22, 2018
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

6 participants