vreinterpret NEON 内在问题
好吧,最后一天我一直在摸头,我确信这很简单,所以就开始吧。为什么这段代码不起作用?我正在使用 Xcode 3.2.5 和 LLVM,当我尝试编译这样的东西时:
uint16x8_t testUnsigned = {1,2,3,4,5,6,7,8};
int16x8_t testSigned;
testSigned = vreinterpretq_s16_u16(testUnsigned);
我收到错误:“从不兼容的类型‘int’分配给‘int16x8_t’”所有其他内在函数都工作正常,但由于某种原因我可以不要重新解释向量。有什么想法吗?提前致谢。
Okay, I've been banging my head for the last day and I'm sure it's something simple so here goes. Why does this code not work? I'm using Xcode 3.2.5 and LLVM and when I try to compile something like this:
uint16x8_t testUnsigned = {1,2,3,4,5,6,7,8};
int16x8_t testSigned;
testSigned = vreinterpretq_s16_u16(testUnsigned);
I get the error: "Assigning to 'int16x8_t' from incompatible type 'int'" all my other intrinsics work fine but for some reason I can't reinterpret a vector. Any ideas? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Hiroshi 指出的那样,这个特定的调用似乎存在一个错误。但是,由于它只是在底层进行转换,因此您可以采用任何其他类型,而不会产生任何运行时损失。例如,我测试过,这是有效的:
As Hiroshi points out, there appears to be a bug with this particular call. However, since it is just casting under the hood, you can go by way of any other type, without any runtime penalty. For example, I tested, and this works:
/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/arm-apple-darwin10/4.2.1/include/arm_neon_gcc.h:6947
这看起来参数的类型是有符号整数。闻起来像虫子。
我不确定,但你应该尝试一下
/Developer/Platforms/iPhoneOS.platform/Developer/usr/llvm-gcc-4.2/lib/gcc/arm-apple-darwin10/4.2.1/include/arm_neon_gcc.h:6947
This seem like that the type of the argument is a signed int. It smell like a bug.
I'm not sure, but you should try