Open rfjakob opened 3 months ago
That processor is 13 years old now. We could make the check dynamic if not building with GOAMD64=v2 or better. The challenge is how do we test that code? I suspect we don't have any processors without PSHUFB support in our trybot fleet. GODEBUG=cpu.X=off for the right value of X might be enough, not sure.
There is more discussion going on at https://github.com/golang/go/issues/63872 to discuss how to test GOAMD64=v1 features in the builder fleet.
I suspect we don't have any processors without PSHUFB support in our trybot fleet.
The CPU in question does have PSHUFB. Looking at https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels, this makes it a x86-64-v2 CPU.
So the question is more about testing on x86-64-v2. I guess the trybot fleet is x86-64-v3 and later.
Go version
go1.22.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
Hi, I have a user reporting a 15% performance regression in gocryptfs ( https://github.com/rfjakob/gocryptfs/issues/828 ) due to change https://github.com/golang/go/issues/63871 .
The CPU is
Intel(R) Core(TM) i3-2100 CPU @ 3.10GHz
so I guess too old for AVX but it does have PSHUFB.Can PSHUFB be detected at runtime instead?
Reproducer is the built-in gocryptfs speed test:
What did you see happen?
With go 1.22: Slow XChaCha20-Poly1305
What did you expect to see?
With go 1.21: Fast XChaCha20-Poly1305