How to load a vector from memory with up-sample in Neon with C API -


i'm new neon. try find instructions following operation:

int a[8] = {1,2,3,4,5,6,7,8}; int b[4] = {1,2,3,4}; int c[8] = {0}; (int =0; i<8; i++)    c[i] = a[i] - b[i/2]; 

how can arm neon, how can load array upsample neon {b[0],b[0],b[1],b[1],b[2],b[2],b[3],b[3]}

you can extending b[] vector:

vld1.32     {q10, q11}, [ptrb]! vld1.32     {q12, q13}, [ptra]! vld1.32     {q14, q15}, [ptra]!  vshll.s32   q8, d20, #32 vshll.s32   q9, d21, #32 vshll.s32   q10, d22, #32 vshll.s32   q11, d23, #32  vsra.u64    q8, q8, #32 vsra.u64    q9, q9, #32 vsra.u64    q10, q10, #32 vsra.u64    q11, q11, #32  vsub.s32    q12, q12, q8 vsub.s32    q13, q13, q9 vsub.s32    q14, q14, q10 vsub.s32    q15, q15, q11  vst1.32     {q12, q13}, [ptrc]! vst1.32     {q14, q15}, [ptrc]! 

however, it's efficient when done vld2 , vst2 when loading/storing a[] vector:

vld1.32     {q10, q11}, [ptrb]! vld2.32     {q12, q13}, [ptra]! vld2.32     {q14, q15}, [ptra]!  vsub.s32    q12, q12, q10 vsub.s32    q13, q13, q10 vsub.s32    q14, q14, q11 vsub.s32    q15, q15, q11  vst2.32     {q12, q13}, [ptrc]! vst2.32     {q14, q15}, [ptrc]! 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -