arm NEON 数据类型中的 I8(未指定类型的整数)是什么?
What is I8(Integer of unspecified type) in arm NEON data types?
NEON 数据类型中的整数
type
8-bit
16-bit
Unsigned integer
U8
U16
Signed integer
S8
S16
Integer of unspecified type
I8
I16
I8
和 S8
有什么区别?
评论已经描述过了,Peter Cordes 完美地总结了这个想法:
Presumably applies to operations like shuffles, or binary addition /
subtraction, where the operation would be the same for signed or
unsigned
重点回答Neon的指令集,大部分指令只接受特定的数据类型,规则是:
- 当
I
有效时,S
和U
也是
- 当仅指定数据大小时,
U
、S
和I
有效(P和F也是如此)
- 一些指令忽略数据类型
- 当没有数据类型时,任何一个都有效
很容易知道哪些指令将指定数据类型,即:
为了得到绝对值,VABS
只接受S
类型(注意它也允许F32)。
有些指令接受I
,因此它们也接受S
和U
,例如按位与(VAND
)。
NEON 数据类型中的整数
type | 8-bit | 16-bit |
---|---|---|
Unsigned integer | U8 | U16 |
Signed integer | S8 | S16 |
Integer of unspecified type | I8 | I16 |
I8
和 S8
有什么区别?
评论已经描述过了,Peter Cordes 完美地总结了这个想法:
Presumably applies to operations like shuffles, or binary addition / subtraction, where the operation would be the same for signed or unsigned
重点回答Neon的指令集,大部分指令只接受特定的数据类型,规则是:
- 当
I
有效时,S
和U
也是 - 当仅指定数据大小时,
U
、S
和I
有效(P和F也是如此) - 一些指令忽略数据类型
- 当没有数据类型时,任何一个都有效
很容易知道哪些指令将指定数据类型,即:
为了得到绝对值,
VABS
只接受S
类型(注意它也允许F32)。有些指令接受
I
,因此它们也接受S
和U
,例如按位与(VAND
)。