From patchwork Sun Jul 9 18:28:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700882 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4828848wrs; Sun, 9 Jul 2023 11:37:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlGyJrI7yTVFl8f020of9bbdnF8s8egoPcylzBdV67BXWg6HvC4pid8Ra5k2BesqeA6Evt5/ X-Received: by 2002:ac8:5c07:0:b0:403:999d:afe5 with SMTP id i7-20020ac85c07000000b00403999dafe5mr8627691qti.41.1688927862867; Sun, 09 Jul 2023 11:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688927862; cv=none; d=google.com; s=arc-20160816; b=kSM8fjsc6+fT4w3Mg/sAgRw+ocNt+5S+IYeZWOAjUWtR+VfAX5N71E+b03iqonkyh4 Z96I8A7nVKUiXt0Yg7C3sIll+hJnvUe6bo9iFbRYSxUZrMhcGQP1D9P4GHfBQNQFk64H dnGIwBvbNxj8bAyzT3w8cub/xIP+xiVbAOLP7NqZ3DRjSmsVoSBspwrc2CynsfuAkwfQ r032XiXAXHldNbH7vm9dWSiWNfMAeJQEtp/9zOM5eQPcBKX3kc0oEve98Sz+14xh53/Q E491PUWd9WsSDSnlI4QT7FpzdWPZHHdmUFngoJTpUYck9B6IXz3lLqkiHqPpk6LlOBBU snLA== 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=ineMFXHMMUsTtHLB4+TRmNQDsbNNDE8LTO9PLI3JgtY=; fh=3IEiF/YPZ00TE94rna3Orj/L+TRFhpuNf7ElRJz3ubE=; b=RB0ENh1vzjH2BZ941LxNz55z/NziQk+EV7d/OKA3ukruTANpgG2+vwin0CJVZoZk7H 14FDG8N+v1ObIGRcDQBDgtHHRXoi225vKuyWFDOh7frZFi3oFIO+l9rroVGafSXrjAFn N/xz0N4UOGuW8SdpWhcWoNdn4J+1vYxCDftfcUCMFKgN9iWIN/VZpX/JrViKahAJfRVl eE145oWesziGLhRXhPGvsxRdyN8sZAngXSJ7WmiCUNYyK3MDAbqfeYj5TtZOPm15Kt5Y wpQ3MCqENSQ3vwoioqkjID8JWgrUeR2hhLmCk2nACtUhiQaCz3xsK0g4/I9jSVinNvf0 pgzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yloPZVoe; 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 v11-20020a05622a130b00b003f50846bfe6si4786142qtk.355.2023.07.09.11.37.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:37:42 -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=yloPZVoe; 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 1qIZEE-0005Cy-FS; Sun, 09 Jul 2023 14:33:50 -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 1qIZDn-0003LQ-QH for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:24 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIZDk-0004Aa-RY for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:33:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-313fb7f0f80so3705410f8f.2 for ; Sun, 09 Jul 2023 11:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927596; x=1691519596; 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=ineMFXHMMUsTtHLB4+TRmNQDsbNNDE8LTO9PLI3JgtY=; b=yloPZVoeXW1Y9dub8O+N9Q6oI+EOzm/c2NDF5tOIq+sy/vqhSSkItj4XMVMPTQCY0b wCt9RPxUoT152hjYGWnWyC09UoewpAvvEKMhvRbYGmfw5maG+xPBdC5wog/v8F9MCmbu XsYS/8nLv0w3a+tf+KNu+wej3A1bbiFMb4mX/I1TLvaCTFN9aTe6f/pIInIY2twC7s2c WBP9ooE5wAMaSYEzUvFdThV9K/wGzVBKqwISlGV/GQlfk7IY6RbNLiCiyXKoFfO/xhqB KtMflNtKTYdOskb80REn0UaOJl+em8lNOO65++vU8ZIOc1juWG6qSWid+zfbqR/7WS4k wMxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927596; x=1691519596; 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=ineMFXHMMUsTtHLB4+TRmNQDsbNNDE8LTO9PLI3JgtY=; b=fq9a7nAEuWa+pLHk47j9xIRNvP2yJnCfKHaj9TbGN6meDlg4aMkyPE3JtncL//OLyK HB9fcXatnCtGCXWToglrS2rOtVCPEWLv86vmSPoEmpIhvTh0l3w7hokXZ2mjAev4IR5S sCgOi4txIyrYe+KwuaJx1rCAUxeFLld9sjG3uUDdGamPS8ztx3k5Fw4DWZajIy8MrAAE VCttuArrss7GfRGUhoMgwY0NWU12GpFfQOCd3CaOt6NgADRovrzL6Kk9KHt+AGs6bF// cl3mjEtaKrRLj4aXsZgmxyNEBayuJ8qhYmSXuRdUxSmIiKDa2w67+EwAuoYTL1sBvQbV sWrA== X-Gm-Message-State: ABy/qLarBSoIEWYweGq9rlvIlcKQ5YdxPHqi5fC5v3yLOj7lNRhERXD4 Pqn4bIT7gjX+HAx4fxZEb0u4ZcOlUq+FCqVTuNT2JA== X-Received: by 2002:a5d:404f:0:b0:307:7f38:37f with SMTP id w15-20020a5d404f000000b003077f38037fmr9063280wrp.66.1688927596657; Sun, 09 Jul 2023 11:33:16 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id e17-20020a5d4e91000000b0031433760a92sm9635256wru.115.2023.07.09.11.33.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:33:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 23/37] target/i386: Use aesdec_ISB_ISR_IMC_AK Date: Sun, 9 Jul 2023 19:28:58 +0100 Message-Id: <20230709182934.309468-47-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::42a; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x42a.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 AESDEC instruction. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/ops_sse.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 93a4e0cf16..a0e425733f 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -2162,16 +2162,12 @@ void glue(helper_pclmulqdq, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s, void glue(helper_aesdec, 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 < 2 << SHIFT ; i++) { - int j = i & 3; - d->L(i) = rk.L(i) ^ bswap32(AES_Td0[st.B(AES_ishifts[4 * j + 0])] ^ - AES_Td1[st.B(AES_ishifts[4 * j + 1])] ^ - AES_Td2[st.B(AES_ishifts[4 * j + 2])] ^ - AES_Td3[st.B(AES_ishifts[4 * j + 3])]); + aesdec_ISB_ISR_IMC_AK(ad, st, rk, false); } }