From patchwork Sun Jul 9 18:28:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700908 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4829944wrs; Sun, 9 Jul 2023 11:42:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlH0y6ssHtYnPPDD2KLaVv850A8RrRUm8Tj0hKwTgbCRlLQWvltIsbLvEBrxWO2Bwa1UC0w1 X-Received: by 2002:a05:622a:607:b0:400:a976:fc71 with SMTP id z7-20020a05622a060700b00400a976fc71mr11359637qta.65.1688928128647; Sun, 09 Jul 2023 11:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688928128; cv=none; d=google.com; s=arc-20160816; b=eQwuN/yM5HO+qGx44y6aanc1ORHzmSSGeSDrtVciyIP3DoWBGgsgpHXXUdCILzjXLO T9HfI8WFIezHZg4j8pZMkvzmRPQC/Jrxm0OYXnfAHyuSE10JSNWHnf3qmgZYNDnlvtOY BYg04zZ6eeRDUCYmL2xS8qCOQ/QYORFSlxeg0ncYwkfwNr70K6rC6ythVOSp54U9D/rD UcJyan7/VX136jV1GZhVmhuvEqEuJsbIguI49ovGAJWVhapVIC36YXSJH4L7lore/3pi aqcutWpUJTcNG9gw+zURwdHtTR1lvh6cbbZXUGeaGoFtLKYRpuwpjLFxO0j3TywFqfgb akpQ== 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=Vdmp9g0LETEOImAoeAZ0vz3CHG5eCYIT92dyMVPeN7s=; fh=3IEiF/YPZ00TE94rna3Orj/L+TRFhpuNf7ElRJz3ubE=; b=e8j9F/VthgJEGUBHZDYl4CT3Ix9DCx/2gUgpqqrv/XHWVPJtQQm88ZguMFAmW00WxQ htI3lwAAy3/pw3Ily8iD/Jbt08TzlzHbj5hMhlXmgClaxKdBqHp00oFWnbAYo4VZkmPm P5JNAeMpX6gs6oo5j0iGU+REDDw7iv4toTC5LAbBYde6w5FElzvrGIEMHq++ZaKQFvTL RUFMAfqGUT0W6Iaok2X7Pdib3Fkr4mT8SLXfUaOUVv/SeaP3OVrYxhskAA+ujN0OgxpE xI4FOzUJg9uaTGm6ov1LeKKRXwZLVdYXrTJ2OcxoO3/ZJoSBdEAFPrnUe6nSFT64bUUa QE5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GcDB1cwl; 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 12-20020ac8570c000000b003fde9320602si4622305qtw.492.2023.07.09.11.42.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:42:08 -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=GcDB1cwl; 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-0003RA-86; Sun, 09 Jul 2023 14:33:32 -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 1qIZDg-0002be-BI for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:16 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIZDe-00049e-Aa for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:15 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3143ccb0f75so4500776f8f.0 for ; Sun, 09 Jul 2023 11:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927591; x=1691519591; 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=Vdmp9g0LETEOImAoeAZ0vz3CHG5eCYIT92dyMVPeN7s=; b=GcDB1cwlWv8onx7DRhbKruSIPUGqxU8t2/6QJ0jA+nsc8g335q46Y75foy3clj4/2a sblvdanIRgZEsp/BTZ+2G+Tjw473RDCjTCREVzGseG6fsQmQt/9pQaPkIo8IVgUz3/FZ nMcP9H6YTVBXa9Iwwg40ddClph1v2sRQJUemrNb9ohWYS1do2b4giSUIuCM87OmCGfro nC6TGj7CySxDfspvcuusHY6zJra1BkoXKO9n0RfsKqfDRz7XxieqZ5Wbq6/4u9WrvIDe hXaabtaVRm4fymQMXvhvzrhiNY+HLzmvxcK+L8TuUlAm+nJFupr7cQWXpHDtEUXMVLNx DjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927591; x=1691519591; 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=Vdmp9g0LETEOImAoeAZ0vz3CHG5eCYIT92dyMVPeN7s=; b=XXePY6oOMclUQLckRK5m3CHcOvs17l82rfrVafZyvdNZlzGYE9+ZINcTzQUkLOmDSk wl5rO3CgGZmo5Goae09GGOdbxF0CRj7pW+wW5LtYa/Rh8akoR6ttw7QdnE2ef7ac7/Zg JeRfADywQSD6wvsXXeY+WmiGvS3lI3lnD5MefvVmvYM6Df9J+PZeeAPqAwxbLgC4LUsB GTghCQ1i8/j214WQsvh307TLNomZFGyAbiF+KxJWjB6wq4GsSsY2EtT/iQ1Hksomtv5O C/wuTOp4igWwnuLz2IyVilJoO0Lmlt65x/TiUTmg0QNqNMgdURcaTr91V5vlccU2OsV6 CSKg== X-Gm-Message-State: ABy/qLZ4xZ3/yRaJJ23HrCvd7D6WY/IsP5dPTyiDPMz85UDqTIJLSidj CW5PASQYr6itWuf8ViBpiGh9WG8FjsWqWKqz4hLxlw== X-Received: by 2002:adf:de0a:0:b0:313:eb81:d2f6 with SMTP id b10-20020adfde0a000000b00313eb81d2f6mr13119496wrm.4.1688927591647; Sun, 09 Jul 2023 11:33:11 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id e17-20020a5d4e91000000b0031433760a92sm9635256wru.115.2023.07.09.11.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:33:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 20/37] target/i386: Use aesdec_ISB_ISR_AK Date: Sun, 9 Jul 2023 19:28:52 +0100 Message-Id: <20230709182934.309468-41-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42f.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 AESDECLAST instruction. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/ops_sse.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 63fdecbe03..0a37bde595 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -2177,12 +2177,12 @@ void glue(helper_aesdec, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s) void glue(helper_aesdeclast, 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_isbox[st.B(AES_ishifts[i & 15] + (i & ~15))]); + aesdec_ISB_ISR_AK(ad, st, rk, false); } }