<div dir="ltr"><div>Hi folks,</div><div>I've implemented [1] the common Luhn checksum algorithm [2], and I have a few questions:</div><div><br></div><div>How does one verify that the method is jitting to the good instructions, rather than to e.g. a sequential fallback?</div><div>Is L31-L39 the right way to do an addition across lanes? Should VectorShuffles be squirreled away in a static final? I see the admonition at the end of [3] about storing in non-final fields, but I wasn't sure if hotspot would treat the inline locals as constant.</div><div><br></div><div>Thanks!<br></div><div><br></div><div>[1] <a href="https://gist.github.com/ghadishayban/9bfdc8230cfdcc8f7bad6d3fd8797552">https://gist.github.com/ghadishayban/9bfdc8230cfdcc8f7bad6d3fd8797552</a></div><div>[2] <a href="https://en.wikipedia.org/wiki/Luhn_algorithm">https://en.wikipedia.org/wiki/Luhn_algorithm</a></div><div>[3] <a href="https://download.java.net/java/early_access/jdk19/docs/api/jdk.incubator.vector/jdk/incubator/vector/VectorShuffle.html">https://download.java.net/java/early_access/jdk19/docs/api/jdk.incubator.vector/jdk/incubator/vector/VectorShuffle.html</a></div></div>