From patchwork Mon Jul 3 10:05:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 698663 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1667072wrs; Mon, 3 Jul 2023 03:15:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGwTqSlvk2ECHb+jHBwRSeDDxq3TGurmwb7UI/pmEehvThg//Bx3JNA7i5vKHcjmmrLLcdf X-Received: by 2002:a05:6214:3015:b0:635:db66:ae00 with SMTP id ke21-20020a056214301500b00635db66ae00mr11833602qvb.45.1688379342505; Mon, 03 Jul 2023 03:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688379342; cv=none; d=google.com; s=arc-20160816; b=cPSGjAuv0iz8xZtxboZ+ykf8C01mAREOoS8P3NccOV7Ak1ImYavTwF+IZWUO45huax rtQnR2VlnMpaVxlXFep2KPuZ7lqCiGHODfZoloZMTwlUBPBTqoFSrtWNGASK7tgqkVQV UkjY/t8Xa24GjEoyQt+oTwAfH4QpvwYkuLbQzNyoYmhpBUt0s5WQW2g1lJKaakbxe3JE 3x8v6D0rXFLsHMYFudhD7Om1DDr0B2xJBvHXX+/8myFLqPcIL7Nth7O87F31DP6raFme 43UQNXHlE89K9O08oaeBzuvUBOi5GMnQD1S+XkUQLmcfh/lRAnU0fQq5M/JqM9rFvfyl 0WkQ== 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=NQsBpcgKVgYp7fXYDQVN06TvKGcdOIek7QQgIG6AozQ=; fh=FQ25ncR7cw8LBZuZOY4ruJQD9HNaX6V/r26L+0BlwKY=; b=VmEy+z1Kefqz0vbQdMdPtJLfXfnGUqdyF91dAAD8vjnhE+iJnkauz/JAwK3yBHz+4u V24AulwG/WWaM6ouLKJUY5XaQIPtB+RJeqc5sWa4XJTkCDJqVMzI4/Nokhp3/T98unK+ UnHzJGGqcyCcjaXCLUUBoZjC6CegkZLZRV++37gfj5FkqEb25WaolAx/OT/8pktcqCd6 FbBIMzBX43Mii4NWs0ogP+/XFGRXZlvGa4U+OQylemrnSUkj6G7npCTncC9pt8cnE9Kr B2OQ8WmE4OCoLUHi6bxLh0fZ4aMc0QEuF6aP3pXsTIHd3BgIOZuhmsYvpoEats0pxr4d 7tYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="mZ/IrUE6"; 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 jt9-20020a05621427e900b00635e3c5e7cfsi10131584qvb.214.2023.07.03.03.15.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2023 03:15: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="mZ/IrUE6"; 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 1qGGRZ-0002xF-LZ; Mon, 03 Jul 2023 06:06:05 -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 1qGGRO-0002mP-9l for qemu-devel@nongnu.org; Mon, 03 Jul 2023 06:05:54 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGGRG-0005rf-84 for qemu-devel@nongnu.org; Mon, 03 Jul 2023 06:05:53 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3141c8a6f30so4372649f8f.1 for ; Mon, 03 Jul 2023 03:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688378742; x=1690970742; 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=NQsBpcgKVgYp7fXYDQVN06TvKGcdOIek7QQgIG6AozQ=; b=mZ/IrUE6/4Sgc7ls67lO5hlJNFTZGJQuyK7rU1pjq5w4o6lmCQ3ZvRKgdkDTa3x8E2 zm6IPnPCy7j0qoUidc0jppHp2jbFqqLg53fbc6cCyForMLD1L5PIDqSHUtlwvrvd8YTH p3CF1k2n7cAA51rQMEZS69yxqQIUSq0ck8zNOypaImnrozJ1CDylJ+XOhlWh9LLtgrdX NlVvFiRn/U0GzTKneyOGbBnNw4jzr63IrACpyibMdhdCmpwb/NXdKHtGeHBg1KuRQ4D2 KwpXe65bd3x8PL9XHQ+A1Yyi3ioI6cruO19juWirqoUisX9Ub4ADWUWzNIulDxCQFS2O T8bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688378742; x=1690970742; 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=NQsBpcgKVgYp7fXYDQVN06TvKGcdOIek7QQgIG6AozQ=; b=V+N/O1iRLAFhRSnTFvXNFvvr3zFJhmfua+dH+pZFeikW1VNsyAZYSP9tYhmMdUKe3c fr5p7tZ/US5o48kbFo4Hlh1uz9tiFi0Gso3Wb0KSWHGzm9CuR200lYqwE0medcV/skI8 cNNok6Wcc18dHcv50VTlbytWjCQvP2GRm2oUdMbqKbHlSDBBeLHOPCFhtHCA7G1Qu+wa zwT3N2j5x66SLmd/UQgS1odaQLA8Na9hSnd/+CKiVWhkWrnbtg7BgefYIA0Y3nuIheJT 6xGGfZnHncn5OuHvHaz52xshXBdCjnp133uC9ZkYDZhGuw9tSBYK/0922omRRxoNlHTi AlHQ== X-Gm-Message-State: ABy/qLadYiWQjE/J9RXpouz6Ey8YvDZ81KndL50V5xyZ1mXM5x6fh1o8 t0J+rCgs+ajQmFEQnUHonXRmSa8i0rfzsobJQ9hBTg== X-Received: by 2002:adf:f14a:0:b0:314:96f:bb81 with SMTP id y10-20020adff14a000000b00314096fbb81mr7292123wro.22.1688378742155; Mon, 03 Jul 2023 03:05:42 -0700 (PDT) Received: from stoup.home (91.232.79.188.dynamic.jazztel.es. [188.79.232.91]) by smtp.gmail.com with ESMTPSA id t5-20020a05600001c500b00313f7b077fesm18446562wrx.59.2023.07.03.03.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 03:05:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-riscv@nongnu.org, pbonzini@redhat.com, eduardo@habkost.net, alistair.francis@wdc.com, danielhb413@gmail.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4 18/37] target/ppc: Use aesdec_ISB_ISR_AK_IMC Date: Mon, 3 Jul 2023 12:05:01 +0200 Message-Id: <20230703100520.68224-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230703100520.68224-1-richard.henderson@linaro.org> References: <20230703100520.68224-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x432.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 VNCIPHER instruction. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 1e477924b7..834da80fe3 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2947,22 +2947,11 @@ void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) void helper_vncipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - /* This differs from what is written in ISA V2.07. The RTL is */ - /* incorrect and will be fixed in V2.07B. */ - int i; - ppc_avr_t tmp; + AESState *ad = (AESState *)r; + AESState *st = (AESState *)a; + AESState *rk = (AESState *)b; - VECTOR_FOR_INORDER_I(i, u8) { - tmp.VsrB(i) = b->VsrB(i) ^ AES_isbox[a->VsrB(AES_ishifts[i])]; - } - - VECTOR_FOR_INORDER_I(i, u32) { - r->VsrW(i) = - AES_imc[tmp.VsrB(4 * i + 0)][0] ^ - AES_imc[tmp.VsrB(4 * i + 1)][1] ^ - AES_imc[tmp.VsrB(4 * i + 2)][2] ^ - AES_imc[tmp.VsrB(4 * i + 3)][3]; - } + aesdec_ISB_ISR_AK_IMC(ad, st, rk, true); } void helper_vncipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)