While you do avoid a branch, there are still data dependencies on the index on the small numbers array, so it still has to predict that address.
It helps that writes can be pushed back in order somewhat. but you still can't use simd.
I can't find of a way to use simd for this tbh, you'd need something like a conditional push where it can push multiple items (or none) depending on some state.
View all comments
Show parent comment
1
u/meneldal2 Sep 03 '26
While you do avoid a branch, there are still data dependencies on the index on the small numbers array, so it still has to predict that address.
It helps that writes can be pushed back in order somewhat. but you still can't use simd.
I can't find of a way to use simd for this tbh, you'd need something like a conditional push where it can push multiple items (or none) depending on some state.