From patchwork Sun Jul 9 13:59:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700832 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4741864wrs; Sun, 9 Jul 2023 07:03:58 -0700 (PDT) X-Google-Smtp-Source: APBJJlHkHnyYWxJkBBEx3nkF6Y4VC4fZryfj+/kLcRGzk02LUiAwaIAX4nHnCBtjTycrqkZ0BR4r X-Received: by 2002:a05:622a:144:b0:403:63b5:3be4 with SMTP id v4-20020a05622a014400b0040363b53be4mr11783990qtw.27.1688911438523; Sun, 09 Jul 2023 07:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688911438; cv=none; d=google.com; s=arc-20160816; b=Q1KfQifrMJuWBjPet5S2zWye3oV49VMBIiBx3QDJRUf/mcB7rZMxuRmMFqRS3CwT5j i9emsmG95G4ecpy1JnywgT9pqjONgY+rAzZG8F38WjSwV7It2I7b9vntCe3BIFpyQEgT ZV+1oAMioq1U3PCtBU+V0/Rm+mBnDGlSIKNYOfWNuYLnYNf8JjUwcpQRKOJd0YTGwz7P UbAx+0CdibWLKZHRP8Rq2vyuHLf4B/bHLMMxPLWkyT+f1KDo0W5Z5xtAwR6gqF5XjTFA HFQaVIFw0wd/ajONgdcfxHyICO+JCGFVNmwuK0v2Xyyy0Rbk8sboqzE22s5VSn4Xk+wL oMJA== 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=i1mkeM7bD/ppus3C3v+92ltBBCUUU0zBXrpbYjAjHqE=; b=PtZwKJBmrRUScqevpFben2Z2UKvMzeEwpa7Tn+tiyiUIbimEOgOsjbzlhsbFKoXZgg VA+n7vgsKxHbeqxWAQJYw/yJlQFmFf9fQ0eVAjHByFhG9z3ZQ6nKEONtQ7oq5gWOsJ9x meyVhcIA0PvQ+sANz4YMI1GgeCEXAn92wsH3uUvjpOXHpZtgS1bpIErNOs6XDuflBHpV izvK5eQf0+JJpfw3fCZl/uq3fNjNBW0oyt5ksaeUkbs8aSqVq6577T0oZpI1kceJy1On JVk24rueki7K1pNsu2emLKs2JKvN/y7FNY5G5ukGvf8y5T/8HPqCxq9fPGRuR20MVDKg IQdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="XSq/s9hc"; 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 3-20020ac85743000000b003e4e85115casi4212596qtx.679.2023.07.09.07.03.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 07:03:58 -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="XSq/s9hc"; 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 1qIUxj-0000fT-Ut; Sun, 09 Jul 2023 10:00:31 -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 1qIUxO-0000Ou-9J for qemu-devel@nongnu.org; Sun, 09 Jul 2023 10:00:14 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIUxM-0000cG-2E for qemu-devel@nongnu.org; Sun, 09 Jul 2023 10:00:09 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fbf1b82d9cso37691245e9.2 for ; Sun, 09 Jul 2023 07:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688911206; x=1691503206; 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=XSq/s9hc61HfxIgHfXZOfiUaviQW1tb3gXsFPZEAb66gPIkroyfktErhwQBuGFLkzs Xs9jStsYNJsaNxNC2wWIurBiQjQyIOTEFJ2oGFC4NxWA1N5+tgWP63hYujXX++cvZJxX jBVIs55+jMSxMBEYckphx+1keQ8GN3luaCdkxg8Bzlcn0tlkNp3Ej3mHk4Hlpk82MhVO WU0xttXHC+nbs0yFbSlvkYbA9tAdDhgZsuGypMDgIMzASnKtkev1FYpkV+O5uLWdno7v F2v7h41XjJwK9DonHN7fCLErQj9kq2A5+4S4Ec21zV/18CXMVji970WN5qQ7I4LVPZYu Adpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688911206; x=1691503206; 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=LX55G2AKm5yL8PLDTz/Flgd17GQNuj+hGHAKLU0XkpXnJSZUtJzgwqA6Zhrq5JAwGs 1olMDFCOSLrVBPsLP88OItxRhDL9WhoWtnnD1stOjlXxsugQNjD0rmA8vwVXTSj2YFsh FLyp4d25lGjZcIL59IyT1vU8C+jBkNjz8Msq658CGZho94UceOPFrh4WWTrta9QhtHW7 DmC5QqoTex04KGlAxidy4rdcMIu+i26sQu/rAme623Ts55GknPpMlHOLHyA6pbBcOURh l70lHtMx5IXPvaG4fBpdej5Yxtwlw5XGHyp/R+YGgq+ja7pGvsEWpaN74mY+Tenpsht6 AqWA== X-Gm-Message-State: ABy/qLatr/YNXD/fRJucApS4wxcFP6bsb/NUO6yst7InM+B7+p9qmVs2 M/OeAkGhvKU+2WW3bI3QNcxnvZbHodeU87GMIlr+lw== X-Received: by 2002:a05:600c:c8:b0:3fb:b05d:f27c with SMTP id u8-20020a05600c00c800b003fbb05df27cmr8106333wmm.34.1688911205651; Sun, 09 Jul 2023 07:00:05 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id v18-20020a5d6792000000b003063a92bbf5sm9239422wru.70.2023.07.09.07.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 07:00:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/37] target/i386: Use aesdec_IMC Date: Sun, 9 Jul 2023 14:59:29 +0100 Message-Id: <20230709135945.250311-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230709135945.250311-1-richard.henderson@linaro.org> References: <20230709135945.250311-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x331.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,