This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Assembly ADD with vector

I'm just learning assembly code, trying to do the following, but it doesn't work. Why? Thanks.

register uint32 c[] = { 0, 0, 0, 0 };
register uint32 a[] = { 2, 5, 7, 9 };
register uint32 b[] = { 3, 3, 4, 5 };
__asm__ __volatile__(
"ADD %0.2d, %1.2d, %2.2d;"
: "=w" (c) // output
: "w" (a) // input
, "w" (b) // input
);
for(auto i = 0; i < (sizeof(c)/sizeof(c[0])); ++i)
{
    printf("%s a(%d) + b(%d) = c(%d)\n", __FUNCTION__, a[i], b[i], c[i]); //TODO: remove all printf's
}