Nelson,

Nelson B Bolyard wrote:
Julien R Pierre - Sun Microsystems wrote, On 2009-01-21 15:03:

You are running Darwin, and freebl does not have any optimizations for RSA on darwin. It has some assembly optimizations on most other x86 platforms. But on Darwin, freebl is built with plain C code, and no assembly at all. That is one reason why the code is running a lot slower.

Even if you end up building NSS with optimizations, they use the regular multiply instructions, which performs best on AMD chips, but not as well on Intel CPUs. For Intel, one needs to use the SSE2 and above instructions set, which NSS currently doesn't do - except on one platform, Linux.

Is there any reason why we can't use the same optimizations on Darwin/x86
as we use on Linux?

I don't know all that much about how we should handle things specifically on Darwin regarding optimizations. We should at least be able to incorporate you original multiply x86 optimizations (the non-SSE2 assembly code).

For the SSE2 code, there are remaining questions for Darwin, such as whether binaries are marked for specific instruction sets, as they are in Solaris, but not in Linux.

There is also the question of whether Darwin even needs non-SSE2 binaries at all - if we are talking strictly about MacOSX, I think the first chips it supported were Intel Core Duo with SSE2 . But if we are talking about open-source Darwin, it might or might not support older chips that don't have SSE2, such as some 32-bit Athlon XP and MP, or older Intel chips (all pre-Pentium 4 chips).

I don't like much the way that we implemented SSE2 on Linux - together in a single freebl shared library with the non-SSE2 version. That stands in the way of us implementing SSE2 in Solaris. See bug 458480 about that. Also bug 439199 about the Windows implementation.

I am not sure what's the best answer for Darwin. But from an architectural point of view, I would prefer that we implement SSE2 differently than we did on Linux, and put it in a separate freebl on all platforms, rather than together with a separate non-SSE2 implementation in the same freebl library. If Darwin doesn't need non-SSE2 binaries, then we could only have a single SSE2-enabled freebl shared lib for that platform .
--
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to