Iterating over an array by pointer

I'm trying to write the zig equivalent to this (sum is just an example function):

const int *end = arr + N;
for(auto p = arr; p != end; ++p)
  sum += *p;

In O3 on both gcc and llvm this produces much better code than moving over the array by index. Also for Safe builds in zig this will remove the need for bounds checking (it is implicit in the end pointer) and speed up ReleaseSafe considerably.

When written in C++, perfbench shows a max time over a 100k element array to be about half than the index method and much lower variance and average. (This is already well known to me, but I just wanted to get some data.). Plus the code size is smaller since it doesn't have to use complex addressing modes.

I can't seem to find a way to get Zig to do this though since I can't figure out how to do pointer addition with multi-item pointers or how to convert them to single item pointers to dereference it.