git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Revised PPC assembly implementation

From
Paul Mackerras <paulus@samba.org>
Date
Apr 26, 2005, 01:22 UTC
Message-ID
<17005.38889.738457.359270@cargo.ozlabs.ibm.com>
In-Reply-To
<20050425161746.7d943e62.davem@davemloft.net>
David S. Miller writes:
> Time to bust out the altivec perhaps :)

I looked at this but I couldn't see a way to use altivec effectively for SHA1.

The problem is that we have a chain of dependencies with the A variable (which is 32-bit) where each A value depends on the previous A value and on one of the 80 W values. The W values are derived from the 16 words (32-bit) of the input data block.

It might be possible to use altivec for generating the W values (although there is the problem that W[k] depends on W[k-3], making it hard to do a 4-way parallelization), but I don't see any way of parallelizing the calculation of the A values, which is the critical path. Using altivec for generating the W values but the integer ALUs for the A calculations would mean we had to go via memory, too, since there isn't any way to transfer stuff directly between altivec registers and GPRs.

We can't do four blocks from the same sequence in parallel either. We could do four blocks from four separate streams in parallel, but that seems hard to organize...

Regards, Paul.

Previous: David S. MillerNext: linux@horizon.com
Message 12 of 17 in “Re: [PATCH] PPC assembly implementation of SHA1”
  1. linux@horizon.comApr 23, 2005
  2. linux@horizon.comApr 23, 2005
  3. Benjamin HerrenschmidtApr 24, 2005
  4. Paul MackerrasApr 24, 2005
  5. Wayne ScottApr 24, 2005
  6. linux@horizon.comApr 24, 2005
  7. Revised PPC assembly implementationlinux@horizon.com, Apr 25, 2005
  8. Paul MackerrasApr 25, 2005
  9. linux@horizon.comApr 25, 2005
  10. Paul MackerrasApr 25, 2005
  11. David S. MillerApr 25, 2005
  12. Paul MackerrasApr 26, 2005
  13. linux@horizon.comApr 27, 2005
  14. Paul MackerrasApr 27, 2005
  15. linux@horizon.comApr 27, 2005
  16. linux@horizon.comApr 26, 2005
  17. linux@horizon.comApr 26, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.