i5-2500k 上的 cpuid 指令:未设置 MMX、SSE、SSE2 位
cpuid instruction on i5-2500k: MMX, SSE, SSE2 bits are not set
这是意料之中的吗?我希望我的Sandy Bridge CPU报告它可以处理MMX,SSE和SSE2指令。这些位不是因为这些"旧"指令集已被一些较新的指令集"取代"而设置的吗?
我在这里使用此代码将 CPU 检测放入我的代码中。
#include "CPUID.h"
int main(int argc, char *argv[]) {
CPUID cpuid;
cpuid.load(0);
printf("CPU: %.4s%.4s%.4s",
(const char*)&cpuid.EBX(),
(const char*)&cpuid.EDX(),
(const char*)&cpuid.ECX()
);
char brand[0x30];
cpuid.load(0x80000002); memcpy(brand,&cpuid.EAX(),16);
cpuid.load(0x80000003); memcpy(brand+16,&cpuid.EAX(),16);
cpuid.load(0x80000004); memcpy(brand+32,&cpuid.EAX(),16);
printf("%.48sn",brand);
cpuid.load(1);
// tests bit 23 of ECX for popcnt instruction support
printf("MMX - %sn", cpuid.EAX() & (1 << 23) ? "yes" : "no");
printf("SSE - %sn", cpuid.EAX() & (1 << 25) ? "yes" : "no");
printf("SSE2 - %sn", cpuid.EAX() & (1 << 26) ? "yes" : "no");
printf("SSE3 - %sn", cpuid.ECX() & (1 << 0) ? "yes" : "no");
printf("SSSE3 - %sn", cpuid.ECX() & (1 << 9) ? "yes" : "no");
printf("SSE4.1 - %sn", cpuid.ECX() & (1 << 19) ? "yes" : "no");
printf("SSE4.2 - %sn", cpuid.ECX() & (1 << 20) ? "yes" : "no");
printf("AES - %sn", cpuid.ECX() & (1 << 25) ? "yes" : "no");
printf("AVX - %sn", cpuid.ECX() & (1 << 28) ? "yes" : "no");
printf("HT - %sn", cpuid.EAX() & (1 << 28) ? "yes" : "no");
printf("IA64 (emulating x86) - %sn", cpuid.EAX() & (1 << 30) ? "yes" : "no");
printf("Hypervisor? - %sn", cpuid.ECX() & (1 << 31) ? "yes" : "no");
printf("popcnt - %sn", cpuid.ECX() & (1 << 23) ? "yes" : "no");
return 0;
}
输出:
CPU: GenuineIntel Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
MMX - no
SSE - no
SSE2 - no
SSE3 - yes
SSSE3 - yes
SSE4.1 - yes
SSE4.2 - yes
AES - yes
AVX - yes
HT - no
IA64 (emulating x86) - no
Hypervisor? - no
popcnt - yes
愚蠢
的错误。我假设表中的第一行是EAX的,但它是EDX的。
产生正确的结果。好吧,这个芯片不支持HT,但也许那个总是设置好的。
更新:原来"HT"表示封装上的>1个逻辑线程(该芯片有4个)。
CPU: GenuineIntel Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz
MMX - yes
SSE - yes
SSE2 - yes
SSE3 - yes
SSSE3 - yes
SSE4.1 - yes
SSE4.2 - yes
AES - yes
AVX - yes
HT - yes
IA64 (emulating x86) - no
Hypervisor? - no
popcnt - yes
相关文章:
- C++ SSE 内部函数:将结果存储在变量中
- Constexpr and SSE intrinsics
- 如何使用SSE将__m128i注册乘以浮点因子?
- 使用SSE内部函数复制少量数据时出现问题
- 可以在 macOS 上启用的最低支持的 SSE 标志是什么?
- SSE 标志应该如何与现代 CMake 一起添加?
- 快速 SSE 射线 - 4 三角形交叉点
- 使用 SSE 以最快的速度缩小 8 位灰度图像
- 如何用SSE优化矩阵3乘3乘法与点?
- 使用双精度运算的快速 SSE 低精度指数
- 手动矢量化/SSE 用于 C++ 中的复杂问题
- 单精度矩阵运算的特征性能 AVX 与 SSE 没有区别?
- 编写 std::copysign 的可移植 SSE/AVX 版本
- SSE 内联汇编和可能的 g++ 优化错误
- SSE 整数 2^n 的 2 次方,对于没有 AVX2 的 32 位整数
- 带有SSE的有条件陈述
- SSE和iostream:浮点类型的错误输出
- 使用 SSE/AVX 获取存储在__m256d中的值的总和
- i5-2500k 上的 cpuid 指令:未设置 MMX、SSE、SSE2 位
- 我做错了什么将我的MMX intrinsic转换为x64 (SSE)