原始文献 / 论坛帖 / Re: Bitcoin x86 for Windows
Re: Bitcoin x86 for Windows
Bitcointalk · 2010-07-27 18:27:30 UTC
【引用 BlackEye 于 2010年7月25日 22:12:23(https://bitcointalk.org/index.php?topic=453.msg5774#msg5774)】
"我已成功将 Crypto++ 5.6.0 的 SHA256 功能集成进比特币。这是目前最快的 SHA256,使用了 SSE2 汇编代码。由于比特币向区块哈希函数发送的是未对齐数据,我不得不把 MOVDQA 指令改成 MOVDQU。
我认为现在应该采用 Crypto++ 5.6.0 的 SHA256 功能。"
我已把 Crypto++ 5.6.0 库的一个子集加入 SVN。我把它精简到只剩 SHA 和 11 个通用依赖文件。里面除了 SHA 不应再有其他加密代码。
我对齐了数据字段,它就能工作了。ASM SHA-256 快约 48%。综合提速约为 0.3.3 版本的 2.5 倍。
我想它用的是 SSE2。它在编译时根据编译器环境自动设置构建配置。
它似乎在运行时做了一些 SSE2 检测,但很难判断它是否真的会在 SSE2 不可用时回退。我希望正式构建版都带上 SSE2。SSE2 从第一代 Pentium 4 就有了。Pentium 3 或更老的机器本来就慢得不值当,在上面挖矿纯粹是浪费电。
这是 SVN rev 114。
英文原文
【引用 BlackEye on July 25, 2010, 10:12:23 PM(https://bitcointalk.org/index.php?topic=453.msg5774#msg5774)】
"I was able to integrate the SHA256 functionality from Crypto++ 5.6.0 into Bitcoin. This is the fastest SHA256 yet using the SSE2 assembly code. Since Bitcoin was sending unaligned data to the block hash function, I had to change the MOVDQA instruction to MOVDQU.
I think using the SHA256 functionality from Crypto++ 5.6.0 is the way forward right now.
"
I added a subset of the Crypto++ 5.6.0 library to the SVN. I stripped it down to just SHA and 11 general dependency files. There shouldn't be any other crypto in there other than SHA.
I aligned the data fields and it worked. The ASM SHA-256 is about 48% faster. The combined speedup is about 2.5x faster than version 0.3.3.
I guess it's using SSE2. It automatically sets its build configuration at compile time based on the compiler environment.
It looks like it has some SSE2 detection at runtime, but it's hard to tell if it actually uses it to fall back if it's not available. I want the release builds to have SSE2. SSE2 has been around since the first Pentium 4. A Pentium 3 or older would be so slow, you'd be wasting your electricity trying to generate on it anyway.
This is SVN rev 114.
