Your CPU has big registers, so why not use them!
#include <x86intrin.h>
#include <stdio.h>
static int increment_one(int input)
{
int __attribute__((aligned(32))) result[8];
__m256i v = _mm256_set_epi32(0, 0, 0, 0, 0, 0, 1, input);
v = (__m256i)_mm256_hadd_ps((__m256)v, (__m256)v);
_mm256_store_si256((__m256i *)result, v);
return *result;
}
int main(void)
{
int input = 19;
printf("Input: %d, Incremented output: %d\n", input, increment_one(input));
return 0;
}
That last comment is insane. They sound like one of those people who believe that video games are a waste of time. Meanwhile they're probably browsing the Internet all day and slurp up all the propaganda against US enemies they come across.