aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-06-01 22:20:12 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-07-08 07:30:17 +0100
commitcc648f5024f6b71277b72270e3242804dd3bd4a2 (patch)
treef5ff7cd9dd8906d56236e045084a774f0e3bced0
parentaf4cb945555f68827eced7eb607c501fb2752bfc (diff)
downloadqemu-cc648f5024f6b71277b72270e3242804dd3bd4a2.zip
qemu-cc648f5024f6b71277b72270e3242804dd3bd4a2.tar.gz
qemu-cc648f5024f6b71277b72270e3242804dd3bd4a2.tar.bz2
target/i386: Use aesenc_SB_SR_AK
This implements the AESENCLAST instruction. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/i386/ops_sse.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h
index fb63af7..63fdecb 100644
--- a/target/i386/ops_sse.h
+++ b/target/i386/ops_sse.h
@@ -19,6 +19,7 @@
*/
#include "crypto/aes.h"
+#include "crypto/aes-round.h"
#if SHIFT == 0
#define Reg MMXReg
@@ -2202,12 +2203,12 @@ void glue(helper_aesenc, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s)
void glue(helper_aesenclast, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s)
{
- int i;
- Reg st = *v;
- Reg rk = *s;
+ for (int i = 0; i < SHIFT; i++) {
+ AESState *ad = (AESState *)&d->ZMM_X(i);
+ AESState *st = (AESState *)&v->ZMM_X(i);
+ AESState *rk = (AESState *)&s->ZMM_X(i);
- for (i = 0; i < 8 << SHIFT; i++) {
- d->B(i) = rk.B(i) ^ (AES_sbox[st.B(AES_shifts[i & 15] + (i & ~15))]);
+ aesenc_SB_SR_AK(ad, st, rk, false);
}
}