From patchwork Sun Jul 9 18:28:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700916 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4830137wrs; Sun, 9 Jul 2023 11:42:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlG2UPGLm1xJR7OJGwU9QoKhXXHv0NFJVdJhj7jO47X795v+bvB0QwG21Nnqze3ApPld28ha X-Received: by 2002:a05:620a:1909:b0:767:2ccf:1e2f with SMTP id bj9-20020a05620a190900b007672ccf1e2fmr10686325qkb.57.1688928170557; Sun, 09 Jul 2023 11:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688928170; cv=none; d=google.com; s=arc-20160816; b=x/424mWIdjIGAEfA6pUreHA06q7KBT8g3umQglWkODjzHrzOJ2halNMqOCfJbbB81k JV9hvZ9UEvB7ApBkw4bIoV+odHavhhsTh49amyWsJUedhyfvLkG9EexoX5inqbyW3wB1 anTlOCPvIk7lxbT2xXup4l/j3rcOOQ6fYyHzokQHhJUglLzx4AXCVeSszX89ta9AtuAn iUEsRe24RS1Wxi2PZfBthukEa/MXmJYu6ptyFQlxLjqWNeXy75wNfxGfD1AIm/jrIRGd hNzUGIiYjudcb90jJBU0DMriDgYI2Wrofi/gDJWarjBeg/tqLYYxX/YfqsK8o7xfpuLt e/8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7ZmDZIvgGB2xxk9tqZEB+B+DCJxeJQyw+1f4RzekeQw=; fh=3IEiF/YPZ00TE94rna3Orj/L+TRFhpuNf7ElRJz3ubE=; b=tDByDbYDlJCz4WY+62W+/TNZ3nruOhOWz+CcRc0o3qp6r5mp70WBrUzCrZfxgV8djI g/Sjw2llGv0q75ODvvyeyCDIGjAbYCRPORX/nJUmLvGU6gDYvES1VkBXcdcms67FXhT8 +hx0OqPRaC6kkr8e7kJIDzCpxdDUNsgg5bE8Lu3aZGjmputyD+NUUSzUCQLKhxkNkzR+ 372BOHW8mlqHrfEOSSL3njKzxpLUTmDjnb9G3qWXfdHhOOvoV+9IAvd64KP6y5AG+OZC 4B4yKYpUwWS+Qp9XtJnkPyXXgisrzvRrPMuV1nFzeex58BwoqAFlsxtoyeJWUNvBlui7 +zGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FJzvG8Xu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c10-20020ae9e20a000000b007677299bac0si5043601qkc.295.2023.07.09.11.42.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:42:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FJzvG8Xu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIZDs-0003RZ-8B; Sun, 09 Jul 2023 14:33:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIZDh-0002pA-D4 for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:20 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIZDe-00049o-Qy for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:17 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31438512cafso4025499f8f.2 for ; Sun, 09 Jul 2023 11:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927593; x=1691519593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7ZmDZIvgGB2xxk9tqZEB+B+DCJxeJQyw+1f4RzekeQw=; b=FJzvG8XuPhB2RMstkTIOAe+zm5tYULhLxGH/gdKst+DPP80gtRChlTP8Sx5P3ktljn BPmr2Kf8V6IsMB7bpAkz3S2KAHGXmi7vMv14YoBqdsFjDf6laVSjOUaV8tJVnJHB7L+a 2w0PXlof1lUBYwy2YXnkwxPnDaoLcdo5Ccr6NRc3MU/7JYKVR1rdcAHwLIvqOPRra6Xn INvGpI72SolJoxleRXOG3qELc6K34kTZBPN0LOyYLBy3Z7qmKR0u+qplkzWoH/2Adovf oM16EMkezHhhpbGlymi3rEsnEk+NrOVozLZTiXBgtUHjXBE5irVJJM5vt+gYooa5fKpe pl4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927593; x=1691519593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ZmDZIvgGB2xxk9tqZEB+B+DCJxeJQyw+1f4RzekeQw=; b=bDjRQy8e5zfp2wdi2B7FdQqlIrQXIhp4bwJK1/PZ5nTEwvnIYIUWmmPEMyBLGbK3Vx n1B9Q0oYnCkOfaEkY98rs0vGl0pvf8IIepGQ01TG1c4x+XM/QbWDj/pgEhtZbsF0gqlh uPFAXHx98/OWn2cRFoi7tnBG2WxOwG6751StOddoqzGUntCVLcwTFU0OyMOfMGgqjpL4 7lb7HW1d78Br3A78Yq2Chu0QakRFSmexxV86e1Kqn7VTnwnaQwtcbbfNbwAmPpkHCG2Z jcEiz4hzqKnh3ddEAWDN9iZBoS2rPYLO9DMhND9AragjMBmMCWrRNG6GgtacOMgma7Ai tBOw== X-Gm-Message-State: ABy/qLbfYdfCRQd23hhqwkhu5zWEoAhEheKwA0RflwFLKCXQgwK+OzCx ErKQ5HmGxwArEnbMyTRz1VipE8ZR7PmLY0aLVKktAg== X-Received: by 2002:adf:e403:0:b0:315:8a0f:9b9b with SMTP id g3-20020adfe403000000b003158a0f9b9bmr6434234wrm.71.1688927593515; Sun, 09 Jul 2023 11:33:13 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id e17-20020a5d4e91000000b0031433760a92sm9635256wru.115.2023.07.09.11.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:33:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/37] target/i386: Use aesdec_IMC Date: Sun, 9 Jul 2023 19:28:54 +0100 Message-Id: <20230709182934.309468-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230709182934.309468-1-richard.henderson@linaro.org> References: <20230709182934.309468-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This implements the AESIMC instruction. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/ops_sse.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 0a37bde595..893913ebf8 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -2215,15 +2215,10 @@ void glue(helper_aesenclast, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s) #if SHIFT == 1 void glue(helper_aesimc, SUFFIX)(CPUX86State *env, Reg *d, Reg *s) { - int i; - Reg tmp = *s; + AESState *ad = (AESState *)&d->ZMM_X(0); + AESState *st = (AESState *)&s->ZMM_X(0); - for (i = 0 ; i < 4 ; i++) { - d->L(i) = bswap32(AES_imc[tmp.B(4 * i + 0)][0] ^ - AES_imc[tmp.B(4 * i + 1)][1] ^ - AES_imc[tmp.B(4 * i + 2)][2] ^ - AES_imc[tmp.B(4 * i + 3)][3]); - } + aesdec_IMC(ad, st, false); } void glue(helper_aeskeygenassist, SUFFIX)(CPUX86State *env, Reg *d, Reg *s,