SIMD with Zig

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

    This has been mentioned before:

    https://github.com/ziglang/zig/issues/7702

    And I have actually taken a crack at implementing the AVX512 intrinsics into the Zig compiler as builtin functions on my personal fork of the repo. But it is a non-trivial task - there are over 450 distinct instructions across the entire AVX512 feature set, and over 100 for AVX2. And I'm only focusing on support for the LLVM backend, which does the heavy lifting in the codegen phase - for the self-hosted backend, getting the register allocation and instruction scheduling correct for all the instrunsics is going to involve lots of trial and effort.

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. intel-intrinsics

    The Dlang SIMD library

    I wish more people understand that you absolutely need such intrinsics for fast software, there is no way around that.

    https://github.com/AuburnSounds/intel-intrinsics

  4. rust-memchr

    Optimized string search routines for Rust.

    Indeed. This is how ripgrep works. It's compiled for just plain `x86_64`, but it looks for whether things like AVX2 are enabled. And if so, uses vector algorithms for substring and multi-substring search. The nice thing about dealing with strings is that the "coarse" requirement is already somewhat natural to the domain.

    But, this functionality is absolutely critical. It doesn't even have to be automatic. Just the ability to compile functions with certain ISA extensions enabled, and then only call them when the requisite CPU features are enabled is enough.

    In a nutshell: https://github.com/BurntSushi/memchr/blob/8037d11b4357b0f07b...

  5. highway

    Performance-portable, length-agnostic SIMD with runtime dispatch

    Implementing Arm semantics or x86 on the other requires ~5 instructions, but if we generalize the definition to allow reordering (e.g. Highway's ReorderWidenMulAccumulate [1]), it's only 2 instructions.

    1: https://github.com/google/highway/blob/master/g3doc/quick_re...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • vu128: Efficient variable-length integers

    2 projects | news.ycombinator.com | 23 May 2024
  • Designing a SIMD Algorithm from Scratch

    3 projects | news.ycombinator.com | 28 Nov 2023
  • Filtering a Vector with AVX-2 & AVX-512 in Rust

    4 projects | /r/rust | 1 Sep 2022
  • Do you ever use unsafe { .. } when not implementing custom data structures or interacting with external C code?

    5 projects | /r/rust | 14 Aug 2022
  • Tolower() in Bulk at Speed

    5 projects | news.ycombinator.com | 27 Jun 2022

Did you know that Zig is
the 22nd most popular programming language
based on number of references?