vgatherb
功能说明
该接口从src中获取8个地址,然后访问这8个地址(加上offsetAddr)以获取8个32字节的数据块,最后将这些8个数据块写入目的地址。
需要注意的是,src中存储的8个地址可能包含重复地址,并且是连续存储在UB中的。每个地址都是u32类型,并且应始终对齐32字节。其对应地址指向的每个元素宽度为16位或32位,offsetAddr应全部对齐32字节(对比vgather增加dstBlockStride,block内是连续存放,block间可以不连续,因此一次只能搬运8个4B地址)。
MASK在此处不被考虑。
接口原型
// 相同接口的不同原型区别在于源地址和目的地址的数据类型不同 void vgatherb(__ubuf__ uint32_t *dst, __ubuf__ uint32_t *src, uint32_t offsetAddr, uint16_t dstRepeatStride, uint8_t dstBlockStride, uint8_t repeat); void vgatherb(__ubuf__ uint16_t *dst, __ubuf__ uint32_t *src, uint32_t offsetAddr, uint16_t dstRepeatStride, uint8_t dstBlockStride, uint8_t repeat);
参数说明
参数名 |
说明 |
取值范围 |
单位 |
|---|---|---|---|
dst |
目的UB地址。 |
/ |
/ |
src |
源UB地址。 |
/ |
/ |
offsetAddr |
源地址起始偏移量。 |
[0, 2^32-1] |
elem |
dstRepeatStride |
相邻两次执行,目的操作数相同block地址步长。 |
[0, 4095] |
32B |
dstBlockStride |
同一次执行,目的操作数不同block间地址步长。 |
[0, 2^8-1] |
32B |
repeat |
接口迭代次数。 |
/ |
/ |
参数表中的Stride均指代相邻两个首地址间的步长。
流水类型
PIPE_V
父主题: UB内搬移