From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 14/19] target/arm: Use clmul_64
Date: Fri, 15 Sep 2023 09:42:26 -0700 [thread overview]
Message-ID: <20230915164231.123580-15-richard.henderson@linaro.org> (raw)
In-Reply-To: <20230915164231.123580-1-richard.henderson@linaro.org>
Use generic routine for 64-bit carry-less multiply.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/vec_helper.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c
index ffb4b44ce4..1f93510b85 100644
--- a/target/arm/tcg/vec_helper.c
+++ b/target/arm/tcg/vec_helper.c
@@ -2003,28 +2003,14 @@ void HELPER(gvec_pmul_b)(void *vd, void *vn, void *vm, uint32_t desc)
*/
void HELPER(gvec_pmull_q)(void *vd, void *vn, void *vm, uint32_t desc)
{
- intptr_t i, j, opr_sz = simd_oprsz(desc);
+ intptr_t i, opr_sz = simd_oprsz(desc);
intptr_t hi = simd_data(desc);
uint64_t *d = vd, *n = vn, *m = vm;
for (i = 0; i < opr_sz / 8; i += 2) {
- uint64_t nn = n[i + hi];
- uint64_t mm = m[i + hi];
- uint64_t rhi = 0;
- uint64_t rlo = 0;
-
- /* Bit 0 can only influence the low 64-bit result. */
- if (nn & 1) {
- rlo = mm;
- }
-
- for (j = 1; j < 64; ++j) {
- uint64_t mask = -((nn >> j) & 1);
- rlo ^= (mm << j) & mask;
- rhi ^= (mm >> (64 - j)) & mask;
- }
- d[i] = rlo;
- d[i + 1] = rhi;
+ Int128 r = clmul_64(n[i + hi], m[i + hi]);
+ d[i] = int128_getlo(r);
+ d[i + 1] = int128_gethi(r);
}
clear_tail(d, opr_sz, simd_maxsz(desc));
}
--
2.34.1
next prev parent reply other threads:[~2023-09-15 16:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 16:42 [PULL 00/19] crypto: Provide clmul.h and host accel Richard Henderson
2023-09-15 16:42 ` [PULL 01/19] crypto: Add generic 8-bit carry-less multiply routines Richard Henderson
2023-09-15 16:42 ` [PULL 02/19] target/arm: Use clmul_8* routines Richard Henderson
2023-09-15 16:42 ` [PULL 03/19] target/s390x: " Richard Henderson
2023-09-15 16:42 ` [PULL 04/19] target/ppc: " Richard Henderson
2023-09-15 16:42 ` [PULL 05/19] crypto: Add generic 16-bit carry-less multiply routines Richard Henderson
2023-09-15 16:42 ` [PULL 06/19] target/arm: Use clmul_16* routines Richard Henderson
2023-09-15 16:42 ` [PULL 07/19] target/s390x: " Richard Henderson
2023-09-15 16:42 ` [PULL 08/19] target/ppc: " Richard Henderson
2023-09-15 16:42 ` [PULL 09/19] crypto: Add generic 32-bit carry-less multiply routines Richard Henderson
2023-09-15 16:42 ` [PULL 10/19] target/arm: Use clmul_32* routines Richard Henderson
2023-09-15 16:42 ` [PULL 11/19] target/s390x: " Richard Henderson
2023-09-15 16:42 ` [PULL 12/19] target/ppc: " Richard Henderson
2023-09-15 16:42 ` [PULL 13/19] crypto: Add generic 64-bit carry-less multiply routine Richard Henderson
2023-09-15 16:42 ` Richard Henderson [this message]
2023-09-15 16:42 ` [PULL 15/19] target/i386: Use clmul_64 Richard Henderson
2023-09-15 16:42 ` [PULL 16/19] target/s390x: " Richard Henderson
2023-09-15 16:42 ` [PULL 17/19] target/ppc: " Richard Henderson
2023-09-15 16:42 ` [PULL 18/19] host/include/i386: Implement clmul.h Richard Henderson
2023-09-15 16:42 ` [PULL 19/19] host/include/aarch64: " Richard Henderson
2023-09-18 17:52 ` [PULL 00/19] crypto: Provide clmul.h and host accel Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230915164231.123580-15-richard.henderson@linaro.org \
--to=richard.henderson@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).