‹ BackHN Continuity

Thread

The state of SIMD in Rust in 2026

209 points · 65 comments · verdagon

  1. Archit3ch · · focus · HN ↗
    Hot take: there is no portable SIMD.

    You can either have performance (=write manual ASM for each platform), or portability, but not both.

    What so-called "portable SIMD" libraries give you is "portable auto-vectorization". "Portable performance" is a global property of the algorithm. Relying on auto-vectorization will result in e.g. sub-optimal register spills in practice. The microbenchmarks will look great, though. ;)

    1. louthy · · focus · HN ↗
      > there is no portable SIMD

      Except in languages with a JIT compiler

      1. Tanjreeve · · focus · HN ↗
        Starts to get a bit philosophical on what constitutes "portable" but JIT compilers would emit an opcode based off of whatever the frontend/IR is saying to do surely?
        1. louthy · · focus · HN ↗
          That assumes no per-platform optimisation, which most JIT compilers will do. I can only speak to the dotnet platform as that's what I am using the most at the moment, but its JIT will spot certain functions, like Vector512.LoadAligned and replace it with the the SIMD equivalent. So, it's not just IR op-code to CPU op-code, it's looking for patterns-of-code that can be made more efficient at JIT compile-time.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.