原始文献 / 论坛帖 / Re: 4 hashes parallel on SSE2 CPUs for 0.3.6

Re: 4 hashes parallel on SSE2 CPUs for 0.3.6

Bitcointalk · 2010-08-07 21:16:01 UTC

AuthorSatoshi Nakamoto
TitleRe: 4 hashes parallel on SSE2 CPUs for 0.3.6
Date2010-08-07 21:16:01 UTC
ForumBitcointalk · 原文

【引用 impossible7 于 2010年8月6日 11:37:20(https://bitcointalk.org/index.php?topic=648.msg7838#msg7838)】

"CRITICAL_BLOCK 是一个包含 for 循环的宏。断言失败表明在循环体内调用了 break。这个块里唯一的 break 语句在第 2762 行。在原始源文件里,这个临界块里没有 break 语句。我认为你必须删除第 2759-2762 行。原始 main.cpp 里没有那样的东西。"
抱歉。CRITICAL_BLOCK 并不完美。必须小心不要从里面 break 或 continue 出来。有个断言能捕获并警告 break。用它确实可以被批评,但没有它的话语法会臃肿得多,也更容易出错。

有没有可能 SSE2 代码在 Intel 上慢是因为某个可以绕开的怪癖?比如,某个东西能用但不对齐就慢,或者缓存抖动,或者某种指令特别慢?我不确定好不好找,但我记得 Intel 以前有个可以按指令级分析的 profiler。我猜如果 tcatm 手头没有那款慢 CPU 的机器来测试,就没什么希望了。但如果它能在大多数 CPU 上正常工作就太好了。

英文原文

【引用 impossible7 on August 06, 2010, 11:37:20 AM(https://bitcointalk.org/index.php?topic=648.msg7838#msg7838)】

"CRITICAL_BLOCK is a macro that contains a for loop. The assertion failure indicates that break has been called inside the body of the loop. The only break statement in this block is in line 2762. In the original source file, there is no break statement in this critical block. I think you must remove lines 2759-2762. The is nothing like that in the original main.cpp.
"
Sorry about that. CRITICAL_BLOCK isn't perfect. You have to be careful not to break or continue out of it. There's an assert that catches and warns about break. I can be criticized for using it, but the syntax would be so much more bloated and error prone without it.

Is there a chance the SSE2 code is slow on Intel because of some quirk that could be worked around? For instance, if something works but is slow if it's not aligned, or thrashing the cache, or one type of instruction that's really slow? I'm not sure how available it is, but I think Intel used to have a profiler for profiling on a per instruction level. I guess if tcatm doesn't have a system with the slow processor to test with, there's not much hope. But it would be really nice if this was working on most CPUs.