# Apple Silicon's Surprisingly Speedy SIMD

> Source: <https://twitter.com/zooko/status/2092738300314267962>
> Published: 2026-08-27 01:59:59+00:00

BLAKE3 now goes more than twice as fast on Apple Silicon. Maybe your code can, too.

(No AI-generated text here. I typed in all these words with my fingers.)

BLAKE3 is a widely-used secure hash function. It is competing with SHA-256 to become the de facto standard secure hash function in applications where SHA3 is too slow. I’m excited about this because if we converge on a global standard secure hash function, this will improve everyone’s security, and in my view neither SHA3 nor SHA-256 are good enough to fill that role, but BLAKE3 is.

BLAKE3 is easier to use securely, and it supports parallelizable and incremental hashing because it is a Merkle Tree instead of a linear chain under the hood. But in practice a lot of the competition boils down to brute speed.

SHA-256’s advantage in performance is that it is old (it was released by the U.S. National Security Agency in 2001) and widely used, and modern general-purpose CPUs come with builtin SHA-256 circuits. BLAKE3’s advantage is that it is designed to take advantage of parallel computation.

One of the most common and effective kinds of parallel computation provided by modern CPUs is “Single Instruction Multiple Data” (SIMD) capabilities. SIMD has the potential to accelerate some algorithms many times over when the input data is big enough. SIMD’s performance benefits have mostly gone unused, historically, because it doesn’t fit well into traditional programming languages like C, C++, Rust, Go, Java, Javascript, etc. In order to make the best use of a machine’s SIMD capabilities, you pretty much need to drop down into assembly language code targeted for a specific CPU architecture. In the last few months—probably due to the advent of AIs capable of doing such coding—more algorithms have been SIMD-accelerated.

The official BLAKE3 library has long had SIMD implementations in high-quality assembly language, thanks to the BLAKE3 maintainers, especially Samuel Neves. For example, modern AMD chips come with wide—512-bit-wide—SIMD capabilities, and on those chips BLAKE3 is substantially faster than SHA-256 on 16 KiB inputs:

(BLAKE3 also takes advantage of the other kind of parallel computation provided by modern computers, multiple cores, but that’s a post for another day.)

But performance of BLAKE3 lags on modern Apple Silicon chips:

This is a serious hindrance to BLAKE3’s adoption because the modern Apple Silicon chips are very popular. They power the Macbooks which have been the dominant seller among high-powered laptops in the Western world for the last couple of years. There are tens of millions of such Macbooks in use today, especially among software developers.

Apple Silicon chips have an older and more limited form of SIMD, called “NEON”, with vectors only 128 bits wide. At least that is what we thought!

But last week, after many failed attempts to optimize BLAKE3 to beat SHA-256 on Apple Silicon, I stumbled upon a discovery…

I told my AI, “Okay, fine! We’ve tried and failed to find high-powered SIMD capabilities in modern Apple chips, and there’s no indication that they are intending to add them to future chips, either. Apparently Apple is more motivated to add AI capabilities like their new Scalable Matrix Extension. So, let’s investigate if there’s a way to use the matrix multiplication to accelerate BLAKE3.”

You know what we found? No, there is no way to accelerate BLAKE3 using matrix multiplication, but it turns out that modern Apple chips actually added new high-powered wide-vector SIMD capabilities bundled in with the Scalable Matrix Extension, but Apple didn’t announce it and nobody uses it!

The unannounced SIMD capabilities are present in all Apple M4 and M5 chips. To access it, you have to issue a CPU instruction called SMSTART, which stands for “Streaming Mode Start”. Once you do that, the SIMD behavior changes:

The old-style NEON instructions are now illegal.

A subset of the new SVE (Scalable Vector Extension) instructions are now legal. Without SMSTART they are illegal, which probably caused any developers who experimented with this before to conclude that SVE wasn’t supported.

The Z registers are now 512 bits wide instead of 128 bits wide! This is a big performance improvement.

There is a new ZA scratchpad, 4096 bytes in size, that is intended for use in matrix multiplication but, as it turns out, we can also leverage to accelerate BLAKE3.

Here’s BLAKE3 optimized using the newly discovered capabilities:

BLAKE3 is now more than twice as fast as before on Apple Silicon, and it is faster than SHA-256 when the input data is 16 KiB or greater in size!

I’m excited because now there is one fewer reason for people to stick with SHA-256 instead of switching to BLAKE3.

(By the way, in addition to taking advantage of the wide SIMD capabilities, this implementation of BLAKE3 also uses the ZA scratchpad state from the Scalable Matrix Extension. Not to do any matrix multiplication—matrix multiplication is no help for accelerating BLAKE3—but just to hold extra state words and do efficient transpositions. See the blake3-sme2 source code for details.)

If you are considering using BLAKE3 as a secure hash function, be aware that it will be faster than before on Apple Silicon. (The newly discovered SIMD capabilities might be applicable to SHA-256 as well! But not for the 16 KiB use case.)

If you are a software developer looking to accelerate your algorithms, see if this technique can increase the performance of your algorithm on M4/M5. I think it will probably accelerate a lot of algorithms substantially!
