News for hackers. Stuff that matters.
Re:The state of SIMD in Rust in 2025 by jiehong on Wednesday November 05, 2025 @03:22PM (#45827450)
C# is blessed on that front. Java’s SIMD state is still sad, and golang is not as great either.
Re:The state of SIMD in Rust in 2025 by ashf023 on Wednesday November 05, 2025 @03:33PM (#45827575)
Yeah, golang is a particular nightmare for SIMD. You have to write plan 9 assembly, look up what they renamed every instruction to, and then sometimes find that the compiler doesn't actually support that instruction, even though it's part of an ISA they broadly support. Go assembly functions are also not allowed to use the register-based calling convention, so all arguments are passed on the stack, and the compiler will never inline it. So without compiler support I don't believe there's any way to do something like intrinsics even. Fortunately compiler support for intrinsics seems to be on its way! https://github.com/golang/go/issues/73787
Re:The state of SIMD in Rust in 2025 by Thaxll on Wednesday November 05, 2025 @06:07PM (#45829295)
Go has been using register based calling for a while now?
Re:The state of SIMD in Rust in 2025 by immibis on Wednesday November 05, 2025 @06:49PM (#45829650)
GP comment said it's not used for FFI, not that it's not used.
Re:The state of SIMD in Rust in 2025 by kbolino on Thursday November 06, 2025 @10:10AM (#45836118)
You're both stating things that are a bit beside the point.

Pure Go code uses registers to pass function arguments whenever possible. Large structs and/or numerous arguments can still spill onto the stack, though.

FFI (cgo) uses whatever the platform's calling convention requires. These conventions also usually favor registers.

Go has its own assembly language, which is neither of those two things. Go assembly technically supports two ABIs, one called "ABI0" and the other called "ABIInternal" [1]. The former passes all arguments on the stack and is stable while the latter passes some arguments through registers but is unstable and subject to change. Accordingly, people writing Go code outside of the Go toolchain almost always use ABI0, so that the code keeps working even when new versions of Go are released.

[1]: https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/c...

Re:The state of SIMD in Rust in 2025 by kbolino on Thursday November 06, 2025 @11:13AM (#45836754)
> Go assembly functions are also not allowed to use the register-based calling convention, so all arguments are passed on the stack, and the compiler will never inline it.

Even if you had access to the register convention (which you kind of do), would it be of any benefit? The registers in question are general-purpose registers, not vector registers.

Re:The state of SIMD in Rust in 2025 by soupy-soup on Wednesday November 05, 2025 @07:47PM (#45830056)
To be fair, Java's lack of support seems to have more to do with them needing to fix the whole primitive vs object mess rather than a lack of effort. It sounds like the Vector API will be stabilized shortly after they figure that out, but who knows how long it will take.
Re:The state of SIMD in Rust in 2025 by pjmlp on Thursday November 06, 2025 @03:44AM (#45832936)
While it is blocked on Valhala, it is quite usable, if folks use nightly all the the time with Rust, what is the problem with --preview?