From patchwork Fri Dec 13 17:31:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850170 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1640445wry; Fri, 13 Dec 2024 09:39:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWP4e87U4uUAuA0mrcZQM1ZmEnIMZ4e0F7bBj3qBnsbmOhnsD8u97wXxZ+XlzhrYLAwjl1dYg==@linaro.org X-Google-Smtp-Source: AGHT+IHTHoIkgk1Rfb6h7c6/MK8TVxAIG+q+3aqJFsOMYSciI8wYNbAkfGDkIAF31k1fstjrbiLK X-Received: by 2002:a17:907:86a1:b0:aa6:7ab4:4597 with SMTP id a640c23a62f3a-aab77e8277bmr405333566b.39.1734111541798; Fri, 13 Dec 2024 09:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111541; cv=none; d=google.com; s=arc-20240605; b=PcgMbAajO9VXmJk7wHloexaZ/xLan7OpTptMughm9g3/pF6WrjlyEIF6qdrukw9tte pXAb7+IXEdsX99fiR2LiEoaFrhT6+/McrINMWXMTLfPfrr4BZ77EgTCChHXcKOltVY/K KbN68IEwKVsgHSmCejuIi24Pz2gLLrYjC4VAKYj8lexXZC6klTRW7Jq8TmjUK2tIQUN5 kWgjazHtSiY9Ip7bm7f61dTl74jZOipsx51h9hEPrHJlY/sNu3UkF/B9IB/p41UXAZwx pzYNZfYaibEx9MGfS7NM6qVNG4yFCN1/smu7Af66mFy5mwD/67+uuF1b5Nzelbzlzono eK4w== 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:to:from :dkim-signature; bh=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Bs6cRdspvkC98ZruN0LiBlx4OqYjp1L99UwsHcbV1SpTfEtRYaranWKT7oQjjYETh1 5dO99WbuxrbSEX5abmml5KGvIRf7igWpLegyFQFXRViv7M+XvLgZap4buKeZtjxiuaQc qdgfarCzm8Jg/V7PYY5DOOXpcwHSYsyhVS7VO+x4QNlZKkLOeVbXlSjftr0Db5omM/kC AgsgjG3OcOo39XJxH3isSwq3gQNmq99An/sCHwGGozySx3nHG4i2JUFH8Pxm6n4w9oiy j7wg675nGkWv0vaX41AxlBe44/4QZ+bwNnVDf/JKZ3AlvpftBk9L0eiINVf0gc5YlcO5 QcfQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="nP/qcvOl"; 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 4fb4d7f45d1cf-5d652f2fd55si42256a12.201.2024.12.13.09.39.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:39:01 -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="nP/qcvOl"; 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 1tM9Xb-0007Qm-0K; Fri, 13 Dec 2024 12:33: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 1tM9X0-0006xi-T5 for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:52 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9Wx-0001Tb-Ky for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:32:49 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43634b570c1so2402535e9.0 for ; Fri, 13 Dec 2024 09:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111163; x=1734715963; 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=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; b=nP/qcvOl0ggPZeg+IyJkhnWECwnuH7TGmzCqmRPVQWIGNsrqXoC+tOCcJ6MhrHJNvh HitsrATKrjnoVSQAuWlqPq5dkV46lNoqtFctDXMvyZ1bYU10sszkUsDfvnxbrBI5Hbpb JsmMRxgC6lNH6atrZDO+DYW37xge+qEWIQvHVQRmMb7ReN7LCTVcFrcdX1XFtLrUQTfE oK1/zrdiL5qMSq0xMw7plD7+OcSUYUsxP5TT2JLbJFpfxd4oof8aQsHFURUc40VGGv79 m4W3RK13EEPvhFL10tjHVG80ayxBtf/zvJGtBXW1kbqmb44LkNo3niJbjsaV+JctFbug isdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111163; x=1734715963; 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=0SEh1YhqeT/Prmk+UdNRkslDKNsy4cS4QQDVYqwULJc=; b=QMfpKXIVptQdG3kTDLqJSNSvqYmnTByYKzwDkl7H0+uiJ7S1oq6Ma5dIhBYZawAwe3 tnO1K+du0xE5BMfKKAnshRVJj4mwN99zmWExXrBEKn/14BKy1Kgs2vW7uMspewXDqLkt OY6xO0jwxujFPGZUphICXz53IQToCNxCuWSd4LtUQTHYMosucF8cQRFSaCJGaSno+pwu 0UJhLu8PpDW1dnd5EHIKejo9cHwVxeZ/itjs2RuWUfKxfPPP4E6wC3PUkSza2k2aPKDs Mr0hjXaY5hOrKUE1hXYK/dizwXo39RimcPNU+/pJ6igHdJHTRFp1mlk7VIkBefExeJ3o Hzwg== X-Gm-Message-State: AOJu0YyCK5CB8xTUMWC+hlBzYkumTBg+GdU8gLwgiW2KnNOVWp3mB4gH /0bKABCbFYoYdvPB3afhaKUF34zKVqZyBRrjjps3WEpJGYr7qkaUI2ejRNur8dgi/ZKbzxX+mwh 5 X-Gm-Gg: ASbGncuo2MaHjhb3fvTIBEScmnjI9ChE/l2ku8644QeLUPSxc/hHTi4RsZz1nSnWUQb UPXigsnzF/pzqBHZC9Itf7TmUTyEMPISG3kmGuGYp8GCvuuE+Gz6NgRO9rYc1Y5T8YRCIqsQjqQ wyzxfNdUTSKKBRt3B7/u7UcuXJ08zdXa74DKaUJ2qEhAgsSduSt1oQGE2kNJXKRFO19U9Qi8m6b uDT654NEQWLjeEly/z+Sq9KTTDA601iX0bMvCP8TQNaKLu6uPpgglZJMBaKDw== X-Received: by 2002:a5d:6801:0:b0:388:c75c:e839 with SMTP id ffacd0b85a97d-388c75ce895mr527468f8f.42.1734111162737; Fri, 13 Dec 2024 09:32:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.32.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:32:42 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 10/85] target/arm: Convert XPAC[ID] to decodetree Date: Fri, 13 Dec 2024 17:31:14 +0000 Message-Id: <20241213173229.3308926-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32b.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 From: Richard Henderson 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 Message-id: 20241211163036.2297116-11-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/tcg/a64.decode | 3 ++ target/arm/tcg/translate-a64.c | 99 +++++----------------------------- 2 files changed, 16 insertions(+), 86 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9083ac4ac30..0e04ab6ce45 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) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 852545dfcc2..d92fe682998 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; }