【问题标题】:finding a neon instruction corresponding to sse instruction找到与 sse 指令对应的霓虹灯指令
【发布时间】:2013-11-07 00:44:48
【问题描述】:

我想知道在 Neon 指令中与 SSE 指令等效的指令/代码是什么。

__m128i a,b,c;
c = _mm_packs_epi32(a, b);

将 a 和 b 中的 8 个带符号的 32 位整数打包成带符号的 16 位整数并饱和。

我检查了 ARM 网站上的等效指令,但没有找到任何等效指令。 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0204j/Bcfjicfj.html

【问题讨论】:

标签: arm sse simd neon


【解决方案1】:

此打包/饱和操作属于 NEON 中的 MOV 指令类别:

VQMOVN (Vector Saturating Move and Narrow) copies each element of the operand vector to the corresponding element of the destination vector. The result element is half the width of the operand element, and values are saturated to the result width.

【讨论】:

【解决方案2】:

没有直接做你想做的事情的指令,但是构建一个的所有构建块都在那里:

饱和/窄化指令为:

int16x4_t vqmovn_s32 (int32x4_t)  

这个内在函数从带符号的 32 位整数到带符号的 16 位整数饱和,在一个 64 位宽的变量中返回四个窄整数。

将这些组合到您的 _mm_packs_epi32 中很容易:只需对 a 和 b 进行操作,然后组合结果即可:

  int32x4_t a,b;
  int16x8_t c;

  c = vcombine_s16 (vqmovn_s32(a), vqmovn_s32(b));

您可能需要交换 vcombine_s16 参数的顺序。

【讨论】:

  • 你能再告诉我一条相当于 _mm_storel_epi64 的霓虹灯指令吗?
  • 我的解决方案是使用vget_lang(64x2,1)获取低64位寄存器,然后使用vst1q存储。对吗??
猜你喜欢
  • 2013-03-06
  • 1970-01-01
  • 2016-04-02
  • 1970-01-01
  • 2016-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-02-14
相关资源
最近更新 更多