The definition for _mm256_insert_epi64 was taking an int, which would get truncated before being inserted in the vector.
Ping + adding Craig Topper, since he seems active in this area.
Ping! + Updated with attribution I forgot.
LGTM. Sorry I didn't notice this review request earlier.
It happens. Thanks for the review!