Question

How to load uint8_t *src to uint16x8_t? For example, we can only do the following:

uint8_t *src;

--->

uint8x8_t mysrc = vld1_u8(src);

Seems that I can not use vreinterpret_*() or (uint16x8_t)mysrc to transform mysrc to uint16x8_t? Is it right?

Était-ce utile?

La solution

Load the 8 first values as 8-bit values:

uint8x8_t mysrc8x8 = vld1_u8(src);

Then use the "convert long move" instruction to transform these values to 16-bit values by prepending zeroes in the first 8 bits:

uint16x8_t mysrc16x8 = vmovl_u8(mysrc8x8);

Assuming that after some operations on these values, you obtain your output myoutput16x8 in an uint16x8_t format and want to convert them back to uint8x8_t, then you can use the vmovn_u16 instruction, bearing in mind that it will indeed truncate the values if they are bigger than 255:

uint8x8_t myoutput8x8 = vmovn_u16(myoutput16x8);

Hope this helps!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top