From nobody Mon Nov 25 09:32:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1716478721; cv=none; d=zohomail.com; s=zohoarc; b=hc5a3VGVTVPENIPqcjuSJxn4QP4u6NhOYdgoJ/8LHt2nFfe2kLAjcuxti9pq82tD2rL6N7Qbwl7h0z30XXp94r7FOfAUlwA8LG5doCT7Firt6IfekOLjRtIPT+Xh/tdIK+UkyfvGRjmoIimZ271S3qp9OezhLaQnjpU8ktXEBFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716478721; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=J6fEgjF44dVjC/RthJ83lNwuybrE42ozhNHXN4FZkgo=; b=Rrvfborbxq766ozkZmyUVXnxwqP+Bh0XpiAYdt4rDafpCZlU2L/d26CoUcn/0acdHyzo9f0D7gyMCHn1TyrVaSBjV0xuZt4FSDFow4jF0znheP3NROYE3+yntM1raRr2LQdZqEqK6T3hnvV/tWJJcihgxuXjDL4AIif2MizgiG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716478721187140.66172880702277; Thu, 23 May 2024 08:38:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAATk-00089g-4e; Thu, 23 May 2024 11:35:40 -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 1sAATc-0007yB-5m for qemu-devel@nongnu.org; Thu, 23 May 2024 11:35:32 -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 1sAATW-0002US-Ck for qemu-devel@nongnu.org; Thu, 23 May 2024 11:35:31 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-41fd5dc0439so22026155e9.0 for ; Thu, 23 May 2024 08:35:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-354df9b51f7sm3888255f8f.59.2024.05.23.08.35.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 08:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716478516; x=1717083316; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=J6fEgjF44dVjC/RthJ83lNwuybrE42ozhNHXN4FZkgo=; b=qbKRchV3gyoaQUat8T7inZdVLktK7uCYXDaTmKFAuomKTz855Iju+CTuRvs79DOgcx Hm+O+3K60N6Kj//r73EAHRtmBd2XsjDb0tA+0NGschC3rVztCOCLcM4r+/8bn+HlmXor hIRJuwpUp/xd/hWt2gIHVApsn3qAR2JzhZm02S9r7TVOlFwer8XaU8jYCzfsG/mAUJhc ZyrAcxvDkUaJRnElUoxP/k+QrzrbSW/ebzGDHFBiL5uTUhyo1vWqMQp7aFPnZk26lNyL zk4atyIAvlt6AgCff1RCR5L5FGYTRugmH346cjRaz8rIsGRE+yN4Mh7mrnzF0ADeIQh2 Zmmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716478516; x=1717083316; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J6fEgjF44dVjC/RthJ83lNwuybrE42ozhNHXN4FZkgo=; b=GqDfceLRtBEDbEsyyDkTSVUgL+FjVPzT/9oSoSKsHopSxKfZZAhGfLeQBk57j01pb6 XbZtN4OPpKJtClrpyV3uH/KwHNxm3WeDnYKXlYaSQaGnngn2LfKJQHN1MJylgUk1llKo v5ALIkJNOC8H1zYkdwO3Tgon/VL7QG1mimeTt8Ys7uEEUp1d+n38ndMR0kxoCuNN1Ak9 7dq0w7OeYBgqM4qubpWKdx2AvXzasOr1/ZJPOXBFAQsJEOoj1iO4IK/BVEelDi3b/XZp udQUH1Jvq/MXc2SNd2gNgga7KQlgZ1164Whhx36DF0pOOe7ofDFCZ4XqHFfVY+IJyC7w ayQQ== X-Gm-Message-State: AOJu0YwcjAEwAYPUq0rxlGTt1j57qOXM1AAE/cy9Af6gMTxYEgfRzPx4 glVOk0RK/Uanm6TuCU+xKYNRKwqzyyZfR8tW90Wnn6YP43gpyQIFbgRpggVOAalQY+DI6/W0hvU F X-Google-Smtp-Source: AGHT+IHud7JTJwaPY0eXCBMNPPkLkbUzadJORgrEhN3yshsixGHh1YiiLdKlz8zqsY3CIaQo+SwkSA== X-Received: by 2002:a05:600c:2051:b0:420:309a:fe63 with SMTP id 5b1f17b1804b1-420fd324a5emr43948445e9.22.1716478516221; Thu, 23 May 2024 08:35:16 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/37] target/arm: Convert XAR to decodetree Date: Thu, 23 May 2024 16:34:46 +0100 Message-Id: <20240523153505.2900433-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240523153505.2900433-1-peter.maydell@linaro.org> References: <20240523153505.2900433-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@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 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1716478722873100003 Content-Type: text/plain; charset="utf-8" From: Richard Henderson Signed-off-by: Richard Henderson Message-id: 20240506010403.6204-11-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 4 ++++ target/arm/tcg/translate-a64.c | 43 +++++++++++----------------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 1292312a7f9..7f354af25d3 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -654,3 +654,7 @@ SM3TT1A 11001110 010 ..... 10 .. 00 ..... .....= @crypto3i SM3TT1B 11001110 010 ..... 10 .. 01 ..... ..... @crypto3i SM3TT2A 11001110 010 ..... 10 .. 10 ..... ..... @crypto3i SM3TT2B 11001110 010 ..... 10 .. 11 ..... ..... @crypto3i + +### Cryptographic XAR + +XAR 1100 1110 100 rm:5 imm:6 rn:5 rd:5 diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index eea0943911a..3d56e85b767 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -4688,6 +4688,20 @@ TRANS_FEAT(SM3TT1B, aa64_sm3, do_crypto3i, a, gen_he= lper_crypto_sm3tt1b) TRANS_FEAT(SM3TT2A, aa64_sm3, do_crypto3i, a, gen_helper_crypto_sm3tt2a) TRANS_FEAT(SM3TT2B, aa64_sm3, do_crypto3i, a, gen_helper_crypto_sm3tt2b) =20 +static bool trans_XAR(DisasContext *s, arg_XAR *a) +{ + if (!dc_isar_feature(aa64_sha3, s)) { + return false; + } + if (fp_access_check(s)) { + gen_gvec_xar(MO_64, vec_full_reg_offset(s, a->rd), + vec_full_reg_offset(s, a->rn), + vec_full_reg_offset(s, a->rm), a->imm, 16, + vec_full_reg_size(s)); + } + return true; +} + /* Shift a TCGv src by TCGv shift_amount, put result in dst. * Note that it is the caller's responsibility to ensure that the * shift amount is in range (ie 0..31 or 0..63) and provide the ARM @@ -13581,34 +13595,6 @@ static void disas_simd_indexed(DisasContext *s, ui= nt32_t insn) } } =20 -/* Crypto XAR - * 31 21 20 16 15 10 9 5 4 0 - * +-----------------------+------+--------+------+------+ - * | 1 1 0 0 1 1 1 0 1 0 0 | Rm | imm6 | Rn | Rd | - * +-----------------------+------+--------+------+------+ - */ -static void disas_crypto_xar(DisasContext *s, uint32_t insn) -{ - int rm =3D extract32(insn, 16, 5); - int imm6 =3D extract32(insn, 10, 6); - int rn =3D extract32(insn, 5, 5); - int rd =3D extract32(insn, 0, 5); - - if (!dc_isar_feature(aa64_sha3, s)) { - unallocated_encoding(s); - return; - } - - if (!fp_access_check(s)) { - return; - } - - gen_gvec_xar(MO_64, vec_full_reg_offset(s, rd), - vec_full_reg_offset(s, rn), - vec_full_reg_offset(s, rm), imm6, 16, - vec_full_reg_size(s)); -} - /* C3.6 Data processing - SIMD, inc Crypto * * As the decode gets a little complex we are using a table based @@ -13637,7 +13623,6 @@ static const AArch64DecodeTable data_proc_simd[] = =3D { { 0x5e000400, 0xdfe08400, disas_simd_scalar_copy }, { 0x5f000000, 0xdf000400, disas_simd_indexed }, /* scalar indexed */ { 0x5f000400, 0xdf800400, disas_simd_scalar_shift_imm }, - { 0xce800000, 0xffe00000, disas_crypto_xar }, { 0x0e400400, 0x9f60c400, disas_simd_three_reg_same_fp16 }, { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x5e400400, 0xdf60c400, disas_simd_scalar_three_reg_same_fp16 }, --=20 2.34.1