我如何在霓虹灯内部进行指针(而不是int/float)进行矢量操作?
我有以下代码:
// int8_t* dout[4];
uint32x4_t ones = vdupq_n_u32(1);
uint32x4_t addr = vaddq_u32(vld1q_u32((uint32_t*)dout), ones);
vst1q_u32((uint32_t*)dout, addr);
其中dout [4]
是一个存储四个(int8_t*)
pointers的数组。
我要做的是,在每个指针中添加一个。而且我知道指针应在我的手臂机上占用32位。因此,我使用VADDQ_U32()
一次将1次添加到四个指针。但是,此代码似乎无法正常工作。
那么,对向量操作进行指针的标准方式是什么?有没有人熟悉霓虹灯的内在?提前致谢!
I have the following code:
// int8_t* dout[4];
uint32x4_t ones = vdupq_n_u32(1);
uint32x4_t addr = vaddq_u32(vld1q_u32((uint32_t*)dout), ones);
vst1q_u32((uint32_t*)dout, addr);
where dout[4]
is an array that stores four (int8_t*)
pointers.
The thing I want to do is, add one to each of the pointers. And I know that a pointer should take up 32 bits in my ARM machine. So I use vaddq_u32()
to add 1 to the four pointers at one time. However, this code seems not to work properly.
So, what is the standard way of doing vector operations to pointers? Is there anyone who is familiar with ARM Neon Intrinsics? Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论