Optimal way to perform a shift operation on an array

前端 未结 6 1388
醉酒成梦
醉酒成梦 2021-02-20 08:00

Suppose I have an array

unsigned char arr[]= {0,1,2,3,4,5,6,7,8,9};

Is there a way to perform shift operation on them besides just copying them

6条回答
  •  Happy的楠姐
    2021-02-20 08:35

    If you really want BLAZING speed look at the assembler shift with carry operations. http://en.wikibooks.org/wiki/X86_Assembly/Shift_and_Rotate#Shift_With_Carry_Instructions Coupled with a loop you can bitshift an array in milliseconds.

提交回复
热议问题