AVX向量化学习(四)-INT类型转化成DOUBLE类型
AVX向量化学习(四)-INT类型转化成DOUBLE类型
使用AVX指令集把INT类型转化为DOUBLE类型
使用到的AVX函数介绍
1.
1 | |
Synopsis
__m128i _mm_setr_epi32 (int e3, int e2, int e1, int e0)
#include <emmintrin.h>
Instruction: Sequence
CPUID Flags: SSE2
Description
Set packed 32-bit integers in dst with the supplied values in reverse order.
Operation
1 | |
2.
1 | |
Synopsis
m256d _mm256_cvtepi32_pd (m128i a)
#include <immintrin.h>
Instruction: vcvtdq2pd ymm, xmm
CPUID Flags: AVX
Description
Convert packed signed 32-bit integers in a to packed double-precision (64-bit) floating-point elements, and store the results in dst.
Operation
1 | |
Performance
| Architecture | Latency | Throughput (CPI) |
|---|---|---|
| Icelake | 7 | 1 |
| Skylake | 7 | 1 |
| Broadwell | 6 | 1 |
| Haswell | 6 | 1 |
| Ivy Bridge | 4 | 1 |
程序运行平台
北京超级云计算中心A3分区
编译指令
g++ int_to_double.cpp -msse2 -mavx -o test01
运行指令
./test01
程序源代码
1 | |
程序输出
1 | |
相关链接
[https://software.intel.com/sites/landingpage/IntrinsicsGuide/]: “ Intel® Intrinsics Guide”
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!