From patchwork Sun Jul 9 18:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 700884 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp4828861wrs; Sun, 9 Jul 2023 11:37:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGAh4BeHuSF2BFWIKZVndcR1w+B4TH/bL3BmfXkaoj7B9K5XegD4M0JShwiNc4X0ssOjMzL X-Received: by 2002:a05:622a:413:b0:400:8682:a918 with SMTP id n19-20020a05622a041300b004008682a918mr12802137qtx.21.1688927865227; Sun, 09 Jul 2023 11:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688927865; cv=none; d=google.com; s=arc-20160816; b=FRoc5Nt8hkAlDyjawwj8R6aWAVfAE4ylh+sycXaqG72TKdzyhtMAjx/MXhkMmeRSYP K0T7+OsSuklccGHgMnk8+bIWN3cYnlLpVjyWG2UWNeC3InD5Ap/OBi7hQoQrWJd+I/Li KRWsw/QwglOjN2PijyoP03URtdiKIWrdZrKEtW91AFHXucYnZgFJ8XETmShMnDppaJXB M8/V0dp5A19ldhazAZFO5RrE3Q2WZXcP1hUyQC/k7Q9XP+8xlE7kPoVr7815gsBIqfEU cVHIDMEfbHLdoAmJtyrPdEJFxChpHX2DbksnoHcPMHbKcjsjD3+R79BobkW7QhlRhLU6 /Bng== 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=+Cz1+kZjkC5u47gB2bogcl1IkIjVlfgBFhqhPCwU85Y=; fh=vt5PnLhDoDj0CK6sQmjgOuq7ZR8IvVqHabl0gLsltKk=; b=NlIeIxWPKvl6qlyp2wxh9LFw2ZeEWK3cjo6XegDRHRc/SiY7ikgiVXpbxoGWfd32/t 5s3H+aDii0W4gStkFCl8PHDUzRRLFrY5c2srAVxAfUZBa4MeG0c803ghLM0KkaxX4S4Q wzdZOv5IWquQjT60W7wmXJUrmeBM5k0t5CqTqNRPvymeUSAdOIpY9mwktNE6hrxEyRa/ LiLgPYgmzEfcRYNjENkH+FuoPBWFZQ5MtrNcU+lLIJIVYN9AZUgMpFCeH+LvTfp3JUYw I43MeJ7yoXOGXg/usUcixzNn7NKJBqz+xUVAn/p0OiKp6wAWwCTX0sJ+eNmyuXEt1GUP 6PWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K5EDORan; 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 q11-20020a05622a030b00b003fde99bacacsi4654519qtw.231.2023.07.09.11.37.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2023 11:37:45 -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=K5EDORan; 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 1qIZAn-0008U6-0m; Sun, 09 Jul 2023 14:30:17 -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 1qIZAe-0008Qb-8N for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:08 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIZAc-0000oH-Nn for qemu-devel@nongnu.org; Sun, 09 Jul 2023 14:30:08 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3fbc5d5746cso43742745e9.2 for ; Sun, 09 Jul 2023 11:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688927405; x=1691519405; 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=+Cz1+kZjkC5u47gB2bogcl1IkIjVlfgBFhqhPCwU85Y=; b=K5EDORanXq4CU4bsiHvaUgCy6IAb9ZSTWMj0TGnIKC6ZsQMm5Z8qcgMoYeGEFZt9pC c36zxGY7BlpTjdBoxM+RVFWcUPcRHkc0C2mvXXcut7nlwx7LcBBQ3ygV/UM9EAkpLr6J pt0DSZbAch9RI6+rDjq2K2FFKiJFCTBFuLRNDpiANpkxsEp6Qe6Ar7xrSHF95OAwu5lL vYVzVuWCPObJIoMLi8r9ZVHS6ZnWO3067+Syt3V7WRZj+eAVmPK4pj7m5uc7gosnuE9R PCbyyKJ6amY6O/Blb8P3WER+FT6mytZtp9VVpDFLkyCLKDTC9VizOY7eQDoVF3v737Qy 2G6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688927405; x=1691519405; 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=+Cz1+kZjkC5u47gB2bogcl1IkIjVlfgBFhqhPCwU85Y=; b=a53gxacrOknQRJK00eF0Dz5RwD8bKM2YnbzdXFMTVWcD6PY3NB5UjLVqpRw6EKQ+/Z B3G7QJKrzvIUQrqgYWcrweun7rehHnxN+aH16NMQLfagN79y6WXlm1fDm+6m6DW6aqNi VhSQcCEUBU9FXnVZvgvYuyRso68IqQNwhXIuYj7H0Sop2wgEjjIb6mUY9KtmOdaq9W49 xp8SqniagRNRPJRIVQkvOW10fd3lStGfCmaiOowHLXPyVcb6gwwSIIhbgHoWorWuwObo ykEBuPid+AtYb53IRDuW2e0fx9nQ3qLd9rtIeMIChxQ+GdjBedEkjheeHP4kyshUgDBZ 1lUg== X-Gm-Message-State: ABy/qLY8qQt/KN9jA5JlWFOWRC4DfTrgOrxcFUsqyso+2NzUKYS7pPDV AMWqykypeDf2a4g117LbrF0pt9FpS8jRzVsjsMZK/A== X-Received: by 2002:a05:600c:21d0:b0:3f9:b17a:cb61 with SMTP id x16-20020a05600c21d000b003f9b17acb61mr8009311wmj.13.1688927405411; Sun, 09 Jul 2023 11:30:05 -0700 (PDT) Received: from stoup.. ([148.252.133.210]) by smtp.gmail.com with ESMTPSA id q15-20020a7bce8f000000b003fbe791a0e8sm8317108wmj.0.2023.07.09.11.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jul 2023 11:30:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza Subject: [PULL 17/37] target/ppc: Use aesenc_SB_SR_MC_AK Date: Sun, 9 Jul 2023 19:28:46 +0100 Message-Id: <20230709182934.309468-35-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::32f; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32f.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 VCIPHER instruction. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 15f07fca2b..1e477924b7 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -2933,17 +2933,11 @@ void helper_vsbox(ppc_avr_t *r, ppc_avr_t *a) void helper_vcipher(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - ppc_avr_t result; - int i; + AESState *ad = (AESState *)r; + AESState *st = (AESState *)a; + AESState *rk = (AESState *)b; - VECTOR_FOR_INORDER_I(i, u32) { - result.VsrW(i) = b->VsrW(i) ^ - (AES_Te0[a->VsrB(AES_shifts[4 * i + 0])] ^ - AES_Te1[a->VsrB(AES_shifts[4 * i + 1])] ^ - AES_Te2[a->VsrB(AES_shifts[4 * i + 2])] ^ - AES_Te3[a->VsrB(AES_shifts[4 * i + 3])]); - } - *r = result; + aesenc_SB_SR_MC_AK(ad, st, rk, true); } void helper_vcipherlast(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)