From patchwork Tue Dec 10 16:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848812 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp416305wrn; Tue, 10 Dec 2024 08:20:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW1pgNwRLnRL6CT11gnt3Vb9cpjIWVAnU/Yd+3oSNCWSm0ROmGsJ+ombRL7rvc9gY2dviC9qg==@linaro.org X-Google-Smtp-Source: AGHT+IF6RZHbvG0qQ2mGmGTC7VoCCbvOsuNwTvS9mjXqia1tqnQ2WyNCky4ViE8jTJViEUVYOHvq X-Received: by 2002:a05:620a:198e:b0:7b6:d942:c161 with SMTP id af79cd13be357-7b6de6db3fbmr575768085a.8.1733847606104; Tue, 10 Dec 2024 08:20:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733847606; cv=none; d=google.com; s=arc-20240605; b=SjkLmNrj3weLlSnRuRPwZ/wd/I+KlQmzT7JC4m7/gzIywx8h4QuUxegQhHU2m0sSf0 I238bBZ9PlmRmoxpsSqkWuhzQlcNSf15oxHLC6rcX9VwS4Fg3UX9TaxetdomVLu2kEN7 76nF6iQ/UVqd98KzXLeJ2vSVQ2a08JmSYxHZxY2IqrIogSCPUU75nIM7EFXsf4aaAfCq gY0Oeprzt8pzsqpyybybPAwoAwJdkA8DyWeDyC4kPYhvsM56z2KrfghKFQ2ybV7AsSB0 +GPMPX3CT4fCoaU1FzesQ8b7fNh9csGQ44BzEXSeM4/BkJ3MeHyW70z8qIHHy+/3hpAG wQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=dd2z3le99kkpxlOwdQvMHijmJlZPpIOT1HfWKqviurA=; fh=OZQBfL75rC14cCDy3q+1fYHCs9KjWAQ7ZJ3hTfS+5lQ=; b=WKVu/iVgPALSAxSjCmCqvw/3oB8zhTOm8W/YVLbl91tnfMk7uQhqh28rVxLCPduLbA fu8mhJLxmqvpinxrhtim3kf6C30ZmzIJGdh/0TNke5P6kTLLerWIjjk/vAI1As4RXX9H sN5Yk2laQdhNGEbpa2l++QlmMEQjl0BKswxaTgKn1fgtKbpqaEOA5mlwKW6V2lpJJ8f5 Qv9nvuuqEoB/iE7qhw5O5Z/Cmmjhswalj2B+5hMcktZEXs/uQ/9zZ0uS6egZ4wtDnhZU XJVyeN6hksum1BQkT+j6a2iCsunjr7E8CSgo+i3a2WI+AIMWCkJPgPo4jItzqfM7kXlu ggtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WDXaL0rZ; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b6dcd91e34si395770385a.524.2024.12.10.08.20.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 08:20:06 -0800 (PST) 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=WDXaL0rZ; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2wN-0002Yo-V3; Tue, 10 Dec 2024 11:18:27 -0500 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 1tL2wM-0002YN-1y for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:18:26 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2wK-0006Lo-5x for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:18:25 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5401b7f7141so2257609e87.1 for ; Tue, 10 Dec 2024 08:18:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733847502; x=1734452302; darn=nongnu.org; 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=dd2z3le99kkpxlOwdQvMHijmJlZPpIOT1HfWKqviurA=; b=WDXaL0rZ9mz/5mxWvcgWSMSq5z80gVWsv4Pb9qVDWEAW0cIfz2MnnLIRhSbRREJeXy PLcTzjJ6mDB0aimZN1imXViI6rph3bJUl5MFhqovrEqHsE3BXOXEJLWcIpBDwMPw6wph j8wvPsWF27lqgMJx0+wgTntIQ0G3aRj1Ut60J3ydtBpCWVr0cpqjFlU8QIkd0ak8tBDa Olom+TT9xuRxlJjRtFoUvHxjbycdFDeAPIoiw7s6xvRJ0eyWQW/6DiRz0BiplyO+5/so HSfq71y2T/hGHFa+pmnQcVnyEoZyuTa9ifX/fgIPcQ0T0vrZVlO8mbjRHvpfJgsc3p8h ME1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733847502; x=1734452302; 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=dd2z3le99kkpxlOwdQvMHijmJlZPpIOT1HfWKqviurA=; b=Kotz9nCRNTnR2bHizqEKXc5BUXzVz86pzbXlz8vzSI88656Td7w5ZvASHkfjUaFpq5 KD5se48J6RUjDzLz5JJop7IwZACjdfdL3u17/4ArgcN2//wD7IYOyThlPydF4PWkqVhx kOzOH4bPy7VgEEz661Xmv0j8AQ778K9h4TLvqgKX/vqGZGn/etnEsCD+hWPOD4GoZ1Fi qtzn/VZ3tFsXzJChHxAzNQLDIUsC9b3HnFEQoDap62oA1+OnfcP8xRH26Yo5h7MHbHAJ P4uy6lpm1msOyrLbiGlfyHA8H8KzpbKiS6EP8Cjqww1GSmv2u2KfSfdAmQlMA7xqtO3M jvUA== X-Gm-Message-State: AOJu0Yy2A8utGQhD80LkxBdb3rFTLhIaVa1ysL8piekiAaeOjqlhNa72 a3tdyxXY9rxkcxFuinJXC+9AzgP9RdVo1twV72c5i/cpGEWINlP1/umGxAJNDzRtmXm33dBK+B4 m6yIzOOpo X-Gm-Gg: ASbGnctD4AgjMLnt9EyHNXGKcuHn8TLci83/+WxZxmHRPZm6280ML0+O7zSePpZCjtd 8KBFy5puGyqoaQx3iMsLHelRv8IP5X1oRu1pJ7YfUWVM+9XMVaHz4yO6wk/HyPr0MXPY4vrOy7c khmptVhgYZP/qWpCTUCqR1/GlBIqXjibpqC9ePhcakF4t9Z4Jp/pBTrYtuSl3OiFAgsUSn3zO25 XEoNL8fnK8E4b0MTtvlih7bXUsYPvSXzdlrLLmGR+WR+v2RWldfgX1O+qQ= X-Received: by 2002:a05:6512:402a:b0:53e:39c2:f02b with SMTP id 2adb3069b0e04-53e39c2f164mr4539323e87.42.1733847502509; Tue, 10 Dec 2024 08:18:22 -0800 (PST) Received: from stoup.. ([91.209.212.80]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53f93377eefsm1026343e87.67.2024.12.10.08.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 08:18:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/69] target/arm: Convert XPAC[ID] to decodetree Date: Tue, 10 Dec 2024 10:16:34 -0600 Message-ID: <20241210161733.1830573-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210161733.1830573-1-richard.henderson@linaro.org> References: <20241210161733.1830573-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x12f.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Remove disas_data_proc_1src, as these were the last insns decoded by that function. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 99 +++++----------------------------- target/arm/tcg/a64.decode | 3 ++ 2 files changed, 16 insertions(+), 86 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 852545dfcc..d92fe68299 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7793,6 +7793,18 @@ TRANS_FEAT(AUTIB, aa64_pauth, gen_pacaut, a, gen_helper_autib) TRANS_FEAT(AUTDA, aa64_pauth, gen_pacaut, a, gen_helper_autda) TRANS_FEAT(AUTDB, aa64_pauth, gen_pacaut, a, gen_helper_autdb) +static bool do_xpac(DisasContext *s, int rd, NeonGenOne64OpEnvFn *fn) +{ + if (s->pauth_active) { + TCGv_i64 tcg_rd = cpu_reg(s, rd); + fn(tcg_rd, tcg_env, tcg_rd); + } + return true; +} + +TRANS_FEAT(XPACI, aa64_pauth, do_xpac, a->rd, gen_helper_xpaci) +TRANS_FEAT(XPACD, aa64_pauth, do_xpac, a->rd, gen_helper_xpacd) + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8377,84 +8389,6 @@ static void disas_cond_select(DisasContext *s, uint32_t insn) } } -/* Data-processing (1 source) - * 31 30 29 28 21 20 16 15 10 9 5 4 0 - * +----+---+---+-----------------+---------+--------+------+------+ - * | sf | 1 | S | 1 1 0 1 0 1 1 0 | opcode2 | opcode | Rn | Rd | - * +----+---+---+-----------------+---------+--------+------+------+ - */ -static void disas_data_proc_1src(DisasContext *s, uint32_t insn) -{ - unsigned int sf, opcode, opcode2, rn, rd; - TCGv_i64 tcg_rd; - - if (extract32(insn, 29, 1)) { - unallocated_encoding(s); - return; - } - - sf = extract32(insn, 31, 1); - opcode = extract32(insn, 10, 6); - opcode2 = extract32(insn, 16, 5); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - -#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) - - switch (MAP(sf, opcode2, opcode)) { - case MAP(1, 0x01, 0x10): /* XPACI */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_xpaci(tcg_rd, tcg_env, tcg_rd); - } - break; - case MAP(1, 0x01, 0x11): /* XPACD */ - if (!dc_isar_feature(aa64_pauth, s) || rn != 31) { - goto do_unallocated; - } else if (s->pauth_active) { - tcg_rd = cpu_reg(s, rd); - gen_helper_xpacd(tcg_rd, tcg_env, tcg_rd); - } - break; - default: - do_unallocated: - case MAP(0, 0x00, 0x00): /* RBIT */ - case MAP(1, 0x00, 0x00): - case MAP(0, 0x00, 0x01): /* REV16 */ - case MAP(1, 0x00, 0x01): - case MAP(0, 0x00, 0x02): /* REV/REV32 */ - case MAP(1, 0x00, 0x02): - case MAP(1, 0x00, 0x03): /* REV64 */ - case MAP(0, 0x00, 0x04): /* CLZ */ - case MAP(1, 0x00, 0x04): - case MAP(0, 0x00, 0x05): /* CLS */ - case MAP(1, 0x00, 0x05): - case MAP(1, 0x01, 0x00): /* PACIA */ - case MAP(1, 0x01, 0x01): /* PACIB */ - case MAP(1, 0x01, 0x02): /* PACDA */ - case MAP(1, 0x01, 0x03): /* PACDB */ - case MAP(1, 0x01, 0x04): /* AUTIA */ - case MAP(1, 0x01, 0x05): /* AUTIB */ - case MAP(1, 0x01, 0x06): /* AUTDA */ - case MAP(1, 0x01, 0x07): /* AUTDB */ - case MAP(1, 0x01, 0x08): /* PACIZA */ - case MAP(1, 0x01, 0x09): /* PACIZB */ - case MAP(1, 0x01, 0x0a): /* PACDZA */ - case MAP(1, 0x01, 0x0b): /* PACDZB */ - case MAP(1, 0x01, 0x0c): /* AUTIZA */ - case MAP(1, 0x01, 0x0d): /* AUTIZB */ - case MAP(1, 0x01, 0x0e): /* AUTDZA */ - case MAP(1, 0x01, 0x0f): /* AUTDZB */ - unallocated_encoding(s); - break; - } - -#undef MAP -} - - /* * Data processing - register * 31 30 29 28 25 21 20 16 10 0 @@ -8464,7 +8398,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) */ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) { - int op0 = extract32(insn, 30, 1); int op1 = extract32(insn, 28, 1); int op2 = extract32(insn, 21, 4); int op3 = extract32(insn, 10, 6); @@ -8517,19 +8450,13 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) disas_cond_select(s, insn); break; - case 0x6: /* Data-processing */ - if (op0) { /* (1 source) */ - disas_data_proc_1src(s, insn); - } else { /* (2 source) */ - goto do_unallocated; - } - break; case 0x8 ... 0xf: /* (3 source) */ disas_data_proc_3src(s, insn); break; default: do_unallocated: + case 0x6: /* Data-processing */ unallocated_encoding(s); break; } diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9083ac4ac3..0e04ab6ce4 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -712,6 +712,9 @@ AUTIB 1 10 11010110 00001 00.101 ..... ..... @pacaut AUTDA 1 10 11010110 00001 00.110 ..... ..... @pacaut AUTDB 1 10 11010110 00001 00.111 ..... ..... @pacaut +XPACI 1 10 11010110 00001 010000 11111 rd:5 +XPACD 1 10 11010110 00001 010001 11111 rd:5 + # Logical (shifted reg) # Add/subtract (shifted reg) # Add/subtract (extended reg)