Skip to content

simd: simd.BroadcastFloat32s on 128-bit vectors requires AVX #82278

Open

Description

@neputevshina

Go version

go version go1.27.2 linux/amd64

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/aye/go/bin'
GOCACHE='/home/aye/.cache/go-build'
GOCACHEPROG=''
GODEBUG='http2client=0'
GOENV='/home/aye/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1474477711=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/aye/Sources/nanowarp/go.mod'
GOMODCACHE='/home/aye/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPACKAGESDRIVER=''
GOPATH='/home/aye/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/aye/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.27.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I am experimenting with porting PFFFT to new intrinsics and I currently work from my very old Sandy Bridge laptop (i5-2410M) which lacks support for AVX. C version through Cgo works because it was written for SSE2.

What did you see happen?

  • simd.BroadcastFloat32s compiles to AVX-exclusive VBROADCASTSS, but PFFFT uses _mm_set1_ps intrinsic for that, which is, according to compilation results, is compiled down to SHUFPS. But in this case, the related _mm_broadcastss_ps is compiled down to VSHUFPS too.
  • simd.MulAdd requires FMA, but obviously can be emulated.
  • simd.Float32s.StorePart crashes on VPMASKMOVD.

I tried everything above with GODEBUG=simd=128, original PFFFT works only for vector size of 4.

What did you expect to see?

Broadcast uses different instruction, MulAdd and StorePart are emulated.

Should we expect support for instruction set levels lower than AVX?

Activity

  1. dr2chase commented on Oct 19, 2026

    @dr2chase
    Contributor

    Should we expect support for instruction set levels lower than AVX?

    Supporting SSE is more work than we can take on, and SSE instructions have tricky performance interaction with AVX.

    But, simd should figure that it's on SSE-not-AVX, and send that code to vector emulation, instead of crashing.

  2. self-assigned this
    on Oct 20, 2026
  3. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Oct 27, 2026
  4. added this to the Go1.28 milestone on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions