asm ( "movd %2, %%xmm0;" // valueToAdd
"movd %3, %%xmm1;" // accumulatedError
"movd %4, %%xmm2;" // accumulator
"movss %%xmm2,%%xmm3;" // accumulator
"subss %%xmm1,%%xmm0;" // valueToAdd - accumulatedError ---> y
"addss %%xmm0,%%xmm2;" // accumulator + y ----> t
"movss %%xmm2,%%xmm4;" // t---->t
"subss %%xmm3,%%xmm2;" // t - accumulator ----> (t2)
"subss %%xmm0,%%xmm2;" // t2-y ---> (t3)[accumulated error]
"movd %%xmm2,%0;"
"movd %%xmm4,%1;"
: "=r"(accumulatedError),"=r"(accumulator)
: "r"(valueToAdd),"r"(accumulatedError),"r"(accumulator)
: "%xmm0","%xmm1","%xmm2","%xmm3","%xmm4"
);
here I can insert 32-bit floats into asm block by using r tag. Now I need to make this block "vectorized" and I don't know how would sse/avx registers be tagged.
Variable types that I need to pass are __m128 and __m256. How can I introduce them(xmm,ymm) to inline-asm as constraints instead of "r"?
Compiler is G++ 6.3.