On Thu, Apr 7, 2022 at 11:03 AM Arthur Comte <
ad...@arthurcomte.com> wrote:
>
> Intrinsic functions (functions that compile down to one hardware instruction) are common in (relatively) low-level languages. Go even supports embed ASM (though a weird flavour of it)
> Can someone explain why we do not have an intrinsic function package? This seems like it would greatly ease the use of SIMD
Go does have a couple of intrinsic function packages: sync/atomic and
math/bits. Many of the functions in those packages are implemented
directly in the compiler.
What Go does not have is a generalized way to write intrinsic
functions apart from implementing them in the compiler. That was
https://go.dev/issue/17373, which was declined.
Go also does not have a SIMD package, but that is more because nobody
has figured out the right approach for such a thing in Go. There was
at least one attempt at
https://go.dev/issue/35307, but that too was
declined.
Ian