[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOLP8p6fmDc=2ZJnYBzLhax0NuqpuBuyT_pRGMdQ7MAyH+0DKQ@mail.gmail.com>
Date: Wed, 19 Mar 2014 21:44:00 -0400
From: Bill Cox <waywardgeek@...il.com>
To: discussions@...sword-hashing.net
Subject: Re: [PHC] Supporting AVX2/SSE2 or not with a single binary
On Wed, Mar 19, 2014 at 9:13 PM, Samuel Neves <sneves@....uc.pt> wrote:
> On 20-03-2014 00:54, Bill Cox wrote:
>> One reason I think we see applications running without SSE/AVX2
>> support is that operating systems don't want to support two versions
>> of a binary, and they have to support older machines. The Blake2 code
>> I've read does not provide for a single binary that supports both - I
>> have to link either to the blake2-ref code or the blake2-sse code. My
>> TwoCats code has inherited this limitation, since I used the Blake2
>> code as a roadmap for figuring out how SSE2 works.
>
> libb2 [1] does have basic support for runtime CPU feature detection. In
> general, though, this is annoying to support in a portable way due to
> different ways to invoke cpuid between compilers, operating system
> support (you may have an AVX-capable system but the OS may not save ymm
> registers across context switches), and so on.
>
> [1] https://blake2.net/#dl
That makes sense. If compilers can get this right, it would be
awesome to have a single binary release. By the way, the code in
Blake2-sse was great to learn from for doing serious optimization on
modern CPUs. I don't read a lot of papers, but I read a lot of code.
Yours is awesome.
There's a lot of outstanding code I've read in the last 3 months. In
2010, I spearheaded the Vinux 3.0 release of Linux for the Vision
impaired, and to get it working well, I estimate I read about1 million
lines of open source code, tracking down bugs and making enhancements.
The code in Scrypt, Blake2, HKDF, Escrypt, Catena, and most of the
other code I've read recently has been a real pleasure in comparison.
I can't even tell you how nice it is to read code written with serious
thought.
Bill
Powered by blists - more mailing lists