Skip to content

simd/archsimd: add 8-bit interleave operations on amd64 #80241

Description

@bontail

Go version

go1.27

Output of go env in your module/workspace:

GOARCH='amd64'
GOEXPERIMENT='simd'

What did you do?

I added the missing 8-bit interleave operations to simd/archsimd on amd64:

  • InterleaveLo and InterleaveHi for Int8x16 and Uint8x16.
  • InterleaveLoGrouped and InterleaveHiGrouped for Int8x32, Int8x64, Uint8x32, and Uint8x64.

Implementation: https://go-review.googlesource.com/c/go/+/796340

What did you see happen?

The 8-bit vector types do not provide the corresponding interleave operations on amd64, although these operations exist for wider integer element types.

In particular, the following methods are missing:

  • InterleaveLo and InterleaveHi for Int8x16 and Uint8x16.
  • InterleaveLoGrouped and InterleaveHiGrouped for Int8x32, Int8x64, Uint8x32, and Uint8x64.

What did you expect to see?

I expected the 8-bit vector types to provide the same interleave operations as the wider integer vector types.

On amd64, these operations map directly to VPUNPCKLBW and VPUNPCKHBW, so the current omission appears unintended. Adding them makes the API consistent across signed and unsigned integer vector types and enables byte-oriented SIMD algorithms without manual emulation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions