原始文献 / 论坛帖 / Re: tcatm's 4-way SSE2 for Linux 32/64-bit 0.3.9 rc2

Re: tcatm's 4-way SSE2 for Linux 32/64-bit 0.3.9 rc2

Bitcointalk · 2010-08-16 02:57:57 UTC

AuthorSatoshi Nakamoto
TitleRe: tcatm's 4-way SSE2 for Linux 32/64-bit 0.3.9 rc2
Date2010-08-16 02:57:57 UTC
ForumBitcointalk · 原文

引用自:tcatm,2010 年 8 月 16 日 12:43:39 AM(https://bitcointalk.org/index.php?topic=820.msg9617#msg9617)

我提议 sha256.cpp 用 -O3 -march=amdfamk10 编(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(https://bitcointalk.org/index.php?topic=820.msg9630#msg9630)

开 4way 后,我开满虚拟核性能好不少。我觉得关超线程后开不开 4way 哈希数差不多。

嘿,你可能发现了点什么!

超线程以前没用,是因为活全在算术逻辑单元里,超线程是共享 ALU 的。

tcatm 的 SSE2 代码肯定是普通 x86 指令和 SSE2 指令混着,所以一个在跑 x86 代码时,另一个能跑 SSE2。

超线程下提升多少?

有数字吗?什么 CPU?

英文原文

Quote from: tcatm on August 16, 2010, 12:43:39 AM(https://bitcointalk.org/index.php?topic=820.msg9617#msg9617)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(https://bitcointalk.org/index.php?topic=820.msg9630#msg9630)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?