回复:Windows 版比特币 x86
原始发布页
打开来源页面查看 1 个交叉存档
引用 BlackEye 于 2010 年 7 月 25 日 10:12:23 PM 的发言
我成功地把 Crypto++ 5.6.0 的 SHA256 功能集成到了比特币中。这是迄今为止使用 SSE2 汇编代码最快的 SHA256。由于比特币会将未对齐的数据发送给区块哈希函数,我不得不把 MOVDQA 指令改成 MOVDQU。
我认为目前采用 Crypto++ 5.6.0 的 SHA256 功能是正确的前进方向。
我向 SVN 添加了 Crypto++ 5.6.0 库的一个子集。我把它精简到只剩 SHA 和 11 个通用依赖文件。除了 SHA,里面应该没有任何其他密码学内容。
我对齐了数据字段,结果奏效了。汇编版 SHA-256 快了大约 48%。综合提速后,比 0.3.3 版快约 2.5 倍。
我猜它使用的是 SSE2。它会在编译时根据编译器环境自动设置构建配置。
看起来它在运行时具备某种 SSE2 检测机制,但很难判断它是否真的会在 SSE2 不可用时利用该机制回退。我希望发布版本包含 SSE2。SSE2 从第一代 Pentium 4 开始就已经存在。Pentium 3 或更老的处理器会慢到不行,用它生成新币无论如何都是在浪费电力。
这是 SVN 修订版 114。
英文原文
展开英文原文
Quote from: BlackEye on July 25, 2010, 10:12:23 PM
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.