質問

I would like to load from memory vectors of 128 bits: I've got these pointers:

int8x16_t* p1=(int8x16_t*)srcimg.data;
int8x16_t* p2=(int8x16_t*)(srcimg.data+srcimg.cols); 

The problem is that the load function is this one:

int8x16_t vld1q_s8(__transfersize(16) int8_t const * ptr); 

I don't understand why the function takes in input an int8_t* value.

I would like to do something like this:

int8x16_t vector;
vector=vld1q_s8(p1); 

How can I do it?Thank you.

役に立ちましたか?

解決

It should already work like below.

int8x16_t vector;
vector=vld1q_s8((int8_t *) srcimg.data);

int8x16_t is a vector type, created to make it easy to read vector layout.

int8_t is what you would call a byte.

Reading it aloud should sound like "load into a quad register from this byte stream".

If you also check gcc arm intrinsics page, you shouldn't be able to find any pointer to those vector types. They mean to map to SIMD registers, and you don't generally talk pointers to registers.

If you would like to get more information about neon programming you can check ARM's website and this blog series.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top