I need to perform the following operation:
w[i] = scale * v[i] + point
the scale and the point are fixed, while it v[]is a vector of 4-bit integers.
I need to calculate w[]for an arbitrary input vector v[], and I want to speed up the process using the built-in AVX tools. However v[i], this is a vector of four-digit integers.
The question is how to perform operations with 4-bit integers using the built-in functions? I could use 8-bit integers and perform operations this way, but is there any way to do the following:
[a,b] + [c,d] = [a+b,c+d]
[a,b] * [c,d] = [a * b,c * d]
(Ignore overflow)
Using AVX attributes, where [..., ...] is an 8-bit integer and a, b, c, d are 4-bit integers?
, , ?