有谁知道如何使用霓虹灯内在uint8x8_t vclt_s8(int8x8_t,int8x8_t) [英] Does anybody know how to use Neon intrinsics uint8x8_t vclt_s8 (int8x8_t, int8x8_t)
问题描述
我想比较2 int8x8_t
,
从 http://gcc.gnu.org/onlinedocs/gcc/ARM- NEON-Intrinsics.html
我们可以得到 vclt_s8
的描述,但它并没有告诉我们很多信息。
I want to compare 2 int8x8_t
,
From http://gcc.gnu.org/onlinedocs/gcc/ARM-NEON-Intrinsics.html
we can get the description for vclt_s8
, but it does not tell us much details.
`uint8x8_t vclt_s8 (int8x8_t, int8x8_t)`
vcgt.s8 D0,D0,D0
Form of expected instruction(s): vcgt.s8 d0, d0, d0
表
返回值 uint8x8_t
,它混淆了我,因为我不能用如果(vclt_s8(A,B))
来决定第一越小。
the return value uint8x8_t
, it confuse me for I can not use
if(vclt_s8(a, b))
to decide the first is smaller.
然后,假设我们有两个 int8x8_t
: int8x8_t一个
和 int8x8_t b
,我们怎么知道是否 A
更小?
Then suppose we have two int8x8_t
: int8x8_t a
and int8x8_t b
, how do we know whether a
is smaller?
推荐答案
您可以在官方ARM了解详情<一个href=\"http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0348c/BABGDDDH.html\">documentation对于NEON 。
You may find more details in the official ARM documentation for NEON.
对于所有比较函数的一般说明指出:
The generic description for all comparison functions states:
如果比较为车道真,其结果在该车道是设置为一的所有比特。如果比较为车道假,所有位都被设置为零。返回类型是无符号整数类型。
If the comparison is true for a lane, the result in that lane is all bits set to one. If the comparison is false for a lane, all bits are set to zero. The return type is an unsigned integer type.
假设你有:(这是伪code, []
这意味着每个向量的8个值)
Suppose you have: (this is pseudo code, []
meaning the 8 values of each vector)
int8x8_t a = [-1, -1, -1, -1, 1, 1, 1, 1];
int8x8_t b = [ 0, 0, 0, 0, 0, 0, 0, 0];
uint8x8_t c = vclt_s8(a, b);
您会得到:
c = [255, 255, 255, 255, 0, 0, 0, 0];
A
的4首值均小于乙
4首价值观:首先所有位ç 4的值设置为
1
,使它们 255
。
The 4 first values of a
are less than the 4 first values of b
: all bits of the first 4 values of c
are set to 1
, making them 255
.
在以同样的方式,所有4个最后的值有较大:C 的4最后的值的所有位都设置为0,这使得它们
0
。
In the same way, all 4 last values are greater: all bits of the 4 last values of c
are set to 0, making them 0
.
希望这有助于!
这篇关于有谁知道如何使用霓虹灯内在uint8x8_t vclt_s8(int8x8_t,int8x8_t)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!