]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/nistec: re-enable ppc64le asm for P-256
authorLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 13 Apr 2022 20:28:59 +0000 (15:28 -0500)
committerFilippo Valsorda <valsorda@google.com>
Thu, 5 May 2022 23:41:16 +0000 (23:41 +0000)
commitf99511d59ba6c363d5dea1e015753a17c05c5c01
tree02b17bd5c8b99249cee7df99573f3861e3e85d58
parent86536b934a6a5d074f1539b3103d7bc86a97e869
crypto/internal/nistec: re-enable ppc64le asm for P-256

Add support for ppc64le assembler to p256. Most of the changes
are due to the change in nistec interfaces.

There is a change to p256MovCond based on a reviewer's comment.

LXVD2X replaces the use of LXVW4X in one function.

In addition, some refactoring has been done to this file to
reduce size and improve readability:
- Eliminate the use of defines to switch between V and VSX
registers. V regs can be used for instructions some that
previously required VSX.
- Use XXPERMDI instead of VPERM to swap bytes loaded and
stored with LXVD2X and STXVD2X instructions. This eliminates
the need to load the byte swap string into a vector.
- Use VMRGEW and VMRGOW instead of VPERM in the VMULT
macros. This also avoids the need to load byte strings to
swap the high and low values.

These changes reduce the file by about 10% and shows an
improvement of about 2% at runtime.

For #52182

Change-Id: Ic48050fc81bb273b7b4023e54864f4255dcc2a4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/399755
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
src/crypto/internal/nistec/generate.go
src/crypto/internal/nistec/p256.go
src/crypto/internal/nistec/p256_asm.go
src/crypto/internal/nistec/p256_asm_ordinv.go [new file with mode: 0644]
src/crypto/internal/nistec/p256_asm_ordinv_test.go [moved from src/crypto/internal/nistec/p256_asm_test.go with 100% similarity]
src/crypto/internal/nistec/p256_asm_ppc64le.s
src/crypto/internal/nistec/p256_asm_table_test.go
src/crypto/internal/nistec/p256_ppc64le.go [deleted file]