Skip to content

回复:tcatm 面向 Linux 32/64 位的 4 路 SSE2,0.3.9 rc2 ​

原始发布页

打开来源页面
查看 1 个交叉存档

引用自:tcatm,2010 年 8 月 16 日 12:43:39 AM

我建议使用 -O3 -march=amdfamk10 编译 sha256.cpp(32 位和 64 位都能工作),因为只有支持这套指令集的 CPU(AMD Phenom、Intel i5 及更新型号)能从 -4way 中获益,而且这会将性能提高约 9%。

GCC 4.3.3 不支持 -march=amdfamk10。我得到: sha256.cpp:1: error: bad value (amdfamk10) for -march= switch

引用自:NewLibertyStandard,2010 年 8 月 16 日 01:49:01 AM

使用 4way 时,启用所有虚拟核心后,我的性能明显更好。我觉得关闭超线程后,无论是否使用 4way,得到的哈希数量都差不多。

嘿,你可能发现了关键所在!

以前超线程没有帮助,是因为所有工作都在算术和逻辑单元中进行,而各超线程共享这些单元。

tcatm 的 SSE2 代码必定混合了普通 x86 指令和 SSE2 指令,因此当一个线程执行 x86 代码时,另一个可以执行 SSE2。

使用超线程能获得多大提升?

能给些数字吗?那是什么 CPU?

英文原文 ​

展开英文原文

Quote from: tcatm on August 16, 2010, 12:43:39 AM

I propose to compile sha256.cpp with -O3 -march=amdfamk10 (will work on 32bit and 64bit) as only CPUs supporting this instruction set (AMD Phenom, Intel i5 and newer) benefit from -4way and it'll improve performance by ~9%.

GCC 4.3.3 doesn't support -march=amdfamk10. I get: sha256.cpp:1: error: bad value (amdfamk10) for -march= switch

Quote from: NewLibertyStandard on August 16, 2010, 01:49:01 AM

With 4way, I get significantly better performance when I have all my virtual cores enabled. I think I get about the same amount of hashes when hyper threading is turned off with or without 4way.

Hey, you may be onto something!

hyperthreading didn't help before because all the work was in the arithmetic and logic units, which the hyperthreads share.

tcatm's SSE2 code must be a mix of normal x86 instructions and SSE2 instructions, so while one is doing x86 code, the other can do SSE2.

How much of an improvement do you get with hyperthreading?

Some numbers? What CPU is that?

为历史保存,为中文读者整理。每篇档案均附来源与英文原文。