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
Milestone

Comments

@aclements
Copy link
Member

@aclements aclements commented Sep 15, 2021

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 this to the Go1.18 milestone Sep 15, 2021
@aclements
Copy link
Member Author

@aclements aclements commented Sep 15, 2021

@gopherbot , please backport to Go 1.17.

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Sep 15, 2021

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.

Loading

@aclements
Copy link
Member Author

@aclements aclements commented Sep 15, 2021

This is fixed by CL 350151.

Loading

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

@gopherbot gopherbot commented Sep 15, 2021

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

Loading

@martisch
Copy link
Contributor

@martisch 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

Loading

@aclements
Copy link
Member Author

@aclements aclements commented Sep 15, 2021

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

Sorry, I was mistaken about that.

Loading

@gopherbot gopherbot closed this in 03df68d Sep 15, 2021
@cespare
Copy link
Contributor

@cespare cespare commented Sep 15, 2021

Worth adding GOARCH/GOOS string constants somewhere?

Loading

@aclements
Copy link
Member Author

@aclements aclements commented Sep 15, 2021

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.

Loading

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

Successfully merging a pull request may close this issue.

4 participants