Skip to content

cmd/asm: add neon, vector instructions for arm #7300

Open

Description

@gopherbot

by byron.rakitzis:

go1.2

In contrast to the amd64 port, the arm port of the Go assembler does not recognize SIMD
instructions ("V…") or vector registers (D or Q).

It would be useful for us (we are writing custom speedups for a project using Intel SSE,
and would care to do the same for ARM), but it would also be useful for the Go library
itself if the library functions which have SIMD speedups in xxx_amd64.s had analogous
speedups in xxx_arm.s

Thank you,

Byron Rakitzis.

Activity

  1. davecheney commented on Feb 10, 2014

    @davecheney
    Contributor

    Comment 1:

    Byron,
    Could you please list the complete set of instructions you need.

    Status changed to WaitingForReply.

  2. gopherbot commented on Feb 11, 2014

    @gopherbot
    ContributorAuthor

    Comment 2 by byron.rakitzis:

    Certainly,
    These include:
    load, store, move, table lookup, shift, xor:
    VLD1
    VST1
    VMOV
    VSHR
    VTBL
    VEOR
    This is highly selective, of course. We also use the D and Q register set
    (I hope that is self-evident).
    Byron.
  3. robpike commented on Feb 13, 2014

    @robpike
    Contributor

    Comment 3:

    Marking 1.3Maybe. This is a minor, non-breaking change that could open up some
    significant performance improvements.

    Labels changed: added repo-main, release-go1.3maybe.

    Status changed to Accepted.

  4. rsc commented on Apr 3, 2014

    @rsc
    Contributor

    Comment 4:

    Labels changed: added release-go1.4, removed release-go1.3maybe.

  5. rsc commented on Sep 15, 2014

    @rsc
    Contributor

    Comment 5:

    I'd like to see this happen but it's going to have to wait for the next release.

    Labels changed: added release-go1.5, removed release-go1.4.

  6. modified the milestone: Go1.5 on Dec 16, 2014
  7. added this to the Go1.6 milestone on May 10, 2015
  8. 5 remaining items

  9. removed this from the Go1.6 milestone on Nov 4, 2015
  10. added a commit that references this issue on Jan 10, 2016
  11. added a commit that references this issue on Oct 14, 2016
  12. kriskwiatkowski commented on Mar 7, 2018

    @kriskwiatkowski

    Any clue how much effort is needed to implement support for NEON? The "quick guide to Go's assembler" says that updating go's assembler is "straightforward" - I'm looking for some more details. May someone point me to some PR/diff with some similar implementation that was already done (for example SIMD for intel)?
    Many thanks

  13. added
    NeedsFixThe path to resolution is known, but the work has not been done.
    on Mar 7, 2018
  14. ALTree commented on Mar 7, 2018

    @ALTree
    Member
  15. smasher164 commented on Jul 24, 2019

    @smasher164
    Member

    Specialized code also has to feature-detect for NEON, so a flag needs to be added to internal/cpu (and correspondingly x/sys/cpu) for HasNEON. On linux the flag is hwcap_NEON = 1 << 12.

  16. shibukawa commented on Dec 3, 2020

    @shibukawa

    https://translate.google.com/translate?sl=ja&tl=en&u=https://future-architect.github.io/articles/20201203/

    I did benchmark with M1 and 10th Gen Core i5, Ryzen 9 on https://github.com/SimonWaldherr/golang-benchmarks. I got interesting result.

    • M1 is much faster than Core i5/Ryzen (basically, took 50%-33% less time to complete)
    • CRC32, SHA1, SHA256 test took much time than other CPUs and Rosetta2 translation

    I think M1 native Go implementation doesn't use NEON, but Rosetta2 translate SSE instructions into NEON. I read hash/crc32 code, only amd64.s uses SIMD instructions. So I suppose this issue is important for improving benchmark result of ARM.

  17. gilbahat commented on Sep 8, 2022

    @gilbahat

    any news here?
    it's 2022, arm instances are available across the 3 major clouds...

  18. kokroo commented on Feb 16, 2023

    @kokroo

    https://translate.google.com/translate?sl=ja&tl=en&u=https://future-architect.github.io/articles/20201203/

    I did benchmark with M1 and 10th Gen Core i5, Ryzen 9 on https://github.com/SimonWaldherr/golang-benchmarks. I got interesting result.

    • M1 is much faster than Core i5/Ryzen (basically, took 50%-33% less time to complete)
    • CRC32, SHA1, SHA256 test took much time than other CPUs and Rosetta2 translation

    I think M1 native Go implementation doesn't use NEON, but Rosetta2 translate SSE instructions into NEON. I read hash/crc32 code, only amd64.s uses SIMD instructions. So I suppose this issue is important for improving benchmark result of ARM.

    I second your statement. It's 2023, ARM is getting more popular by the day and ARM servers are now available on all the 3 major cloud service providers. On top of that, Apple Silicon's performance is absolutely phenomenal, golang with NEON support on Apple Silicon will be just amazing.

    Rust already supports it, I think it's high time golang supports it too.

  19. whyrusleeping commented on Mar 18, 2025

    @whyrusleeping

    Would love to have some more NEON support, it seems like some stuff works maybe but most of it isnt recognized?

  20. gopherbot commented on Aug 30, 2026

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/824424 mentions this issue: cmd/asm, cmd/internal/obj/arm: add AArch32 NEON D/Q, VMOV, 3-same, VLD1/VST1

  21. gopherbot commented on Aug 30, 2026

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/824444 mentions this issue: cmd/asm, cmd/internal/obj/arm: add AArch32 NEON VSHR, VTBL, VEXT, VMULL.P8

  22. gopherbot commented on Aug 30, 2026

    @gopherbot
    ContributorAuthor

    Change https://go.dev/cl/824464 mentions this issue: cmd/asm, cmd/internal/obj/arm: add AArch32 NEON VSHL and VDUP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions