Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: user4553 on March 12, 2011, 01:04:49 PM



Title: Via Padlock hardware acceleration
Post by: user4553 on March 12, 2011, 01:04:49 PM
Hi,

just started a fork to add VIA padlock harware accelaration for the sha256 functionality.  Find the git tree at:

  [removed dead link]

This is a very clean patch currently, only adding a few lines to cryptopp/sha.cpp .  Should be much cleaner (and more generic) then the code posted before here:

  http://bitcointalk.org/index.php?topic=355.0

Note that the code by Sgtstein even had a possible corruption bug when IRQs interrupted the crypto engine.

Still verifying whether it works.  Would be grateful for comments.

cheers,

David



Title: Re: Via Padlock hardware acceleration
Post by: jgarzik on March 12, 2011, 06:07:01 PM
Unfortunately, you are duplicated work.  This CPU miner supports VIA padlock: https://github.com/jgarzik/cpuminer

The main client does not need any CPU mining tweaks.  In fact, we discuss from time-to-time how to hide / disable / remove CPU mining from the main bitcoin client.


Title: Re: Via Padlock hardware acceleration
Post by: lfm on March 15, 2011, 09:46:26 PM
Unfortunately, you are duplicated work.  This CPU miner supports VIA padlock: https://github.com/jgarzik/cpuminer

The main client does not need any CPU mining tweaks.  In fact, we discuss from time-to-time how to hide / disable / remove CPU mining from the main bitcoin client.

Ah, nice, google didn't find that.  BTW looking over the code it seems to suffer the IRQ bug I mentioned.  I think we have to loop over the xsha256 opcode, until (e)SI register is at the end of the input.  In case an interrupt happens, the instruction will finish somewhere midway through the computation and needs to be restarted with the esi/edi/ecx register value state it left.

the sha256 instruction will automaticlly restart after an interrupt much like any rep instruction. I am quite sure it is correct as is