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

runtime: x86 CPU feature optimizations dropped in Go 1.17 #48406

Closed
aclements opened this issue Sep 15, 2021 · 8 comments
Closed

runtime: x86 CPU feature optimizations dropped in Go 1.17 #48406

aclements opened this issue Sep 15, 2021 · 8 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@aclements
Copy link
Member

CL 344329 caused the runtime to no longer detect POPCNT, SSE 4.1, or FMA support on amd64. This affects the performance of math/bits.OnesCount, math.FMA, and most of the rounding functions in math.

This CL was released as part of Go 1.17, so this may be worth a back-port, or maybe the risk is too high for not enough reward.

/cc @martisch

@aclements aclements added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 15, 2021
@aclements aclements added this to the Go1.18 milestone Sep 15, 2021
@aclements
Copy link
Member Author

@gopherbot , please backport to Go 1.17.

@gopherbot
Copy link

Backport issue(s) opened: #48407 (for 1.17).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases.

@aclements
Copy link
Member Author

This is fixed by CL 350151.

nimelehin added a commit to nimelehin/go that referenced this issue Sep 15, 2021
Because of wrong case of letters, the cpu features flags were not
set properly for amd64.

Fixes golang#48406
@gopherbot
Copy link

Change https://golang.org/cl/350151 mentions this issue: runtime: fix setting of cpu features for amd64

@martisch
Copy link
Contributor

martisch commented Sep 15, 2021

Sorry.

Why do we think this made it to go1.17? The CL that caused the regression was submitted August 23 after go1.18 tree opened. I cant see that change in the go1.17 release branch:

x86HasPOPCNT = cpu.X86.HasPOPCNT

@aclements
Copy link
Member Author

Why do we think this made it to go1.17?

Sorry, I was mistaken about that.

@cespare
Copy link
Contributor

cespare commented Sep 15, 2021

Worth adding GOARCH/GOOS string constants somewhere?

@aclements
Copy link
Member Author

Possibly. We already have goarch.ArchFamily and goarch.Is* constants, but the former is a bit of a mouthful and the latter are defined as 0/1 numeric constants, which are annoying to use in contexts like this. We also don't have an equivalent of goarch.ArchFamily for goos. Maybe we should just clean all of that up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants