NEON vs Intel SSE -某些操作的等价性
NEON vs Intel SSE - equivalence of certain operations
我在计算几个英特尔SSE操作的NEON等效时遇到了一些麻烦。似乎NEON不能一次处理整个Q寄存器(128位值数据类型)。我没有在arm_neon.h头文件或NEON intrinsic引用中找到任何内容。
我想做的是:
// Intel SSE
// shift the entire 128 bit value with 2 bytes to the right; this is done
// without sign extension by shifting in zeros
__m128i val = _mm_srli_si128(vector_of_8_s16, 2);
// insert the least significant 16 bits of "some_16_bit_val"
// the whole thing in this case, into the selected 16 bit
// integer of vector "val"(the 16 bit element with index 7 in this case)
val = _mm_insert_epi16(val, some_16_bit_val, 7);
我已经看过NEON提供的移位操作,但是没有找到一个等价的方法来完成上面的操作(我对NEON没有太多的经验)。有可能做到以上(我想我只是不知道怎么做)?
您需要VEXT指令。您的示例看起来像这样:
int16x8_t val = vextq_s16(vector_of_8_s16, another_vector_s16, 1);
之后,val
的0-111位将包含vector_of_8_s16
的16-127位,val
的112-127位将包含another_vector_s16
的0-15位。
相关文章:
- 为什么在popback()操作之后,它仍然打印完整的矢量
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- 重载操作程序时出错>>用于类中的字符串 memebr
- 如何为模板化对象创建模板向量?VS正在投掷C3203
- 数据成员SFINAE的C++17测试:gcc vs clang
- 为什么在Windows上的VS 2019和Clang 9中"size_t"在没有标题的情况下工作
- 对字符串进行位操作
- 在for循环中使用auto vs decltype(vec.size())来处理字符串的向量
- 正在VS调试器中监视映射条目
- Confusion: decltype vs std::function
- 将IBM Rhapsody模型集成到VS 2019中
- gmock 设置默认操作 / ON_CALL vs. EXPECT_CALL
- C++类函数返回值 VS 对本地数据进行操作
- 写入和读取操作:使用一个 wrlock 两个 VS 一个 rdlock 读取操作和一个 wrlock 写入操作
- 为什么以下两个程序产生不同的输出?(C++,位操作,VS 2012)
- 构造函数初始化列表vs昂贵操作
- NEON vs Intel SSE -某些操作的等价性
- VS在汇编操作码中嵌入字符串
- 比较交换原子操作vs加载链接/存储条件操作
- 算术与双vs位操作