Software Engineering

Go 1.27 adds arm64 and wasm support to arch-specific SIMD API

Key Takeaway

Go 1.27 expands its experimental SIMD infrastructure to include arm64 and wasm architectures alongside amd64.

Summary

Building on the experimental amd64 SIMD support introduced in Go 1.26, Go 1.27 adds support for arm64 (NEON) and wasm architectures. The new archsimd package provides a low-level intrinsics layer that allows developers to use SIMD instructions without writing assembly. Users can access these features by setting the GOEXPERIMENT=simd flag during compilation.

Technical details of the archsimd API

  • The archsimd package acts as a low-level intrinsics layer, using distinct struct types like Float32x4 or Uint8x16 to define vector shapes.
  • It uses semantic method names (e.g., Add) instead of mirroring specific hardware instruction names to improve accessibility.
  • arm64 support currently covers NEON, with SVE and SVE2 planned for future updates.
  • amd64 support includes AVX, AVX2, and many AVX-512 extensions.
  • The API includes zero-cost type reinterpretation via methods like ToBits() and ReshapeToUint<W>s().
  • Masking operations are handled through opaque Mask types that the compiler optimizes into specific hardware instructions.

Why it matters

This development reduces the need for developers to write manual assembly for performance-critical SIMD operations, making high-performance computing more accessible in Go.

Original reference: go.dev →