Bitcointalk · tcatm's 4-way SSE2 for Linux 32/64-bit is in 0.3.10

中本聪,2010 年 8 月 16 日

SN-2358 已核对来源,附原文与上下文。

阅读语言
中文译文

我建议用 -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

用 4way 时,启用全部虚拟核心会明显更好。我觉得超线程关闭时,开不开 4way 哈希量差不多。

嘿,你兴许发现了什么!

之前超线程没好处,是因为所有工作都发生在超线程共享的算术逻辑单元里。

tcatm 的 SSE2 代码一定是普通 x86 指令和 SSE2 指令的混合体,这样一个线程跑 x86 代码时,另一个就能跑 SSE2。

开超线程你提升了多少?

给几个数字?那是什么 CPU?

ORIGINAL · 英文原文
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


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?
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2358