I have a question regarding SSE instruction.
I hope this is the right place to ask such a question if not pls let me know and I will remove this question.
My goal is to use SSE instructions to execute calculations on 3 chars in parallel.
I have a typedef struct which has the attribute that it is packed
typedef struct
{
unsigned char x;
unsigned char y;
unsigned char z;
} __attribute__((packed)) Number;
For each char I have to go through a certain calculation.
As an example:
((Number[0].x * 20) / 256);
I have to do a small calculation for every char and then add them together.
Since I have to write the code in assembly I have already done some research and stumble upon this instruction:
__m128i _mm_add_epi8 (__m128i a, __m128i b)
As far as I am concerned this should add two values (who have each the size of 8 bytes) together and save the result.
At least that's how I understand it: From this link
But since we only add two values together this defeats the whole purpose of executing multiple instructions at once.
Any help would be very apricated. Kind regards!