Closed Bug 1656981 Opened 10 months ago Closed 10 months ago

Use MPI comba and mulq optimizations on x86-64 MacOS.

Categories

(NSS :: Libraries, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kjacobs, Assigned: kjacobs)

Details

Attachments

(1 file)

Bug 272327 added s_mpv_mul_set_vec64/s_mpv_mul_add_vec64 assembly implementations in mpi_amd64_gas.s. Bug 227049 translated this file to mpi_amd64_masm.asm for Windows. No macho64 variant exists, but it's worth adding as these implementations improve RSA public key operation throughput by 2x.

Further, the functions in mp_comba.c give a ~15% additional improvement on Mac and can be used as-is.

This patch makes two MPI changes for MacOS:

  1. Rename mpi_amd64_gas.s to mpi_amd64_common.S and add defines for macho64, allowing Intel Macs to take advantage of the 64x64->128 multiply code.
  2. Define and use NSS_USE_COMBA on Intel Macs.

Performance results with rsaperf -n none -p 10 -e -x 65537 (default 2048-bit key):
Before: 12629.12 operations/s. one operation every 79 microseconds
With 64x64->128 assembly: 29431.65 operations/s. one operation every 33 microseconds
With MP_COMBA and 64x64->128 assembly: 30332.99 operations/s. one operation every 32 microseconds

Attachment #9167737 - Attachment description: Bug 1656981 - macOS MPI: use 64x64->128 multiply, MP_COMBA. → Bug 1656981 - Use 64x64->128 multiply and MP_COMBA on x86_64.
Attachment #9167737 - Attachment description: Bug 1656981 - Use 64x64->128 multiply and MP_COMBA on x86_64. → Bug 1656981 - Use 64x64->128 multiply and MP_COMBA on x86_64 Mac.
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 3.56
You need to log in before you can comment on or make changes to this bug.