From patchwork Wed Dec 11 16:29:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 849224 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp420419wry; Wed, 11 Dec 2024 08:33:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW4xQ6WOzjCaF0VBcp/xni77TnHrbZJAe2pO0giBry5k8OHuglA88jwZ6tHUyqHxOimOpHdoQ==@linaro.org X-Google-Smtp-Source: AGHT+IEtpGhvdknwvKAICyy8jmzIn9Llcc1lW+oasfQ76iNDA6xx3gt/QUt3owuBfdQMdAq2cOHn X-Received: by 2002:ac8:7fc6:0:b0:467:73bf:e2ca with SMTP id d75a77b69052e-4679541252emr5831631cf.46.1733934790568; Wed, 11 Dec 2024 08:33:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733934790; cv=none; d=google.com; s=arc-20240605; b=fcbHuCyFzyFWpDqJ+oZ0RhRLLRwUQ3Rs1qcYzxo5bxmhgKq+JNqC6Cyq2oLAvKCKZ7 MVRa7yIoilYhOxymYmiSQV6VglUG/uf4B12Dpw13Jipm07AAdr9751756eodLhMURBQZ ICElk1rDzsyyHLTja9nFLFIrQPDwihjlJM7RXRA7lrcRtw89ZP3t6jhLB7/J9U8ZNqLu H0YhU+qDJPO/UBIyNwbRPh6y22qi38oVp5voUgymtZeUqheAveLeXjiysczZJNyndEGI 82dp+xXiQfZWhnJmO2XdbZMJ4wG8lAthFmbiTRbxhj0t8Z/yMbdAw8UEZuVD6Dr3docV 5cnQ== 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=OheJzngdS+HhJoEVosRxkCExJJDmRaec59L8+hjrWV0=; fh=OZQBfL75rC14cCDy3q+1fYHCs9KjWAQ7ZJ3hTfS+5lQ=; b=c1V9gs/g70KNcL3LoU/H/HdMTxLzIV56K/z68xdHGsXl9nXL+L09QAKur8sZUmSycl TsS8HD0l32K0LdmUy0pIT9BzyHxSdJOx38i6+2kWI7uis5gEM2J9kh61Cp2noOu5GK2d tJtIzY7I6xzaYWT2X6E5ZVY+lCkwduEkpgoqQu1+ZvLbXVLZeDGvcztbiCYt+uuUAMvQ A6HO9M6V0LXIfVcaST5TZgQhUh7xw7BkikOFctUEbNKDR0+1J8N0RTlPO5CHbx5c0jeU vbbRqZPcuVZm2TKadMpCWPwStBVN59cu+gFeI8TNPvbgflFsbC3FUyrImyIXhPgyvYYf DyPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vkSEz7GS; 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 d75a77b69052e-467849b4701si43031181cf.189.2024.12.11.08.33.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 08:33:10 -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=vkSEz7GS; 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 1tLPci-0004Np-4Q; Wed, 11 Dec 2024 11:31:40 -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 1tLPcJ-0003r2-SS for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:31:16 -0500 Received: from mail-qt1-x835.google.com ([2607:f8b0:4864:20::835]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLPcH-0001BT-BW for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:31:15 -0500 Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-467631f3ae3so22935221cf.0 for ; Wed, 11 Dec 2024 08:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733934671; x=1734539471; 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=OheJzngdS+HhJoEVosRxkCExJJDmRaec59L8+hjrWV0=; b=vkSEz7GSHozHWh12+ZrLKk0G04HJGHsswdSaFi2U0nfVbj0VxKGcADqB39MagM9Ky3 8MSH+nWyetxQ6+mIQyqSRiQqq6BC97XbFbKt87RiVceyzu1x4/1ZijKJ9OO+K1+FUImG BmZvP6xE6s+hQ4hfob+z7994P7iNxZ/bG3HY0jwtWkOQNgetucwqFLgYzxo8eSyflXY9 MhMizdcTK8fn52qS15aY0CBcXYNLDC+q3lhklZasXgW7LgHNR5O6MoKvZdt/kIgOfv3m 4kFKIUYn+0A8NWbNuthrFEt6kQuYlr8TKWC54EF+2lzDnU7jQXVQv1agBz57hUrDgJM+ qXJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733934671; x=1734539471; 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=OheJzngdS+HhJoEVosRxkCExJJDmRaec59L8+hjrWV0=; b=Kpx/INVZoPgd3rGXX4HfqeZMnPr9Sr+q2vMDsUIQEs8k9+LefKZCQ9NYv0Es3DxQXL Z4CXDucrpzSNlUpjHBkr9t8x4m6J6VS44z5lnvE72fKQeMhruX8vGTOqzD8kLnvVLeRK KnZe5ZXygj/yT9NgHOtuMyTyRvc7PONwXxEsMpBUwaL+99kmpEjcs+EVHkm55AWjaJTJ FnJjwJPEYkOanqq33vtQDktgF570U0LSBBWw5gJFoIe/67qHZLOIMk2jU2d/O7jFkHil jxY/eHQ1rBeeY4SETs0NU7reWx28EnWkzeXtswTQ11iizY8Cz7r3TI5C93SXgKhQAosy U5Xw== X-Gm-Message-State: AOJu0Yz9iFE6ds9P7TqO4areyr90gBQao8T7K007sw1PmjOsPOvP65bZ K1JjPOO+0RW9DzaADY6SBTOCBXUZ7g2Yt2lkb2aGLCT79XfylkOW4rvlBcwlCgkHR5092e5aiTJ 9Qs5dNgt0 X-Gm-Gg: ASbGnctweANZ2HiZhN20AIaDDz6Uo1qbnzauNXir0xUA6fqLqsv0sB+ZyYbSYdTUMZb c1Wf5phES51RHwSCYQEIkp/+kkbqjkh3XIa3sNVcwKsR0NYZa0WuokqmPTlNMBsii7jEoba9+PQ w8dMdZ77VXbBtVW/YbIa4c4Phs/lY300lJxovpRQOEvkN9kO7urpx2AMA49TPnyyCL25AZ2gFr4 ekhP0nHawAZYy+VEDVG9vcsXtKTjxRV5mOJAcVkv0bWfogf5CM7cM26BeNiBw== X-Received: by 2002:ac8:5e52:0:b0:467:50d0:8866 with SMTP id d75a77b69052e-467953526e6mr7806391cf.19.1733934671070; Wed, 11 Dec 2024 08:31:11 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-46755db613csm43849381cf.70.2024.12.11.08.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:31:10 -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 v3 06/69] target/arm: Convert PACGA to decodetree Date: Wed, 11 Dec 2024 10:29:33 -0600 Message-ID: <20241211163036.2297116-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241211163036.2297116-1-richard.henderson@linaro.org> References: <20241211163036.2297116-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::835; envelope-from=richard.henderson@linaro.org; helo=mail-qt1-x835.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_2src, as this was the last insn decoded by that function. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 65 ++++++---------------------------- target/arm/tcg/a64.decode | 2 ++ 2 files changed, 13 insertions(+), 54 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 00e55d42ff..ca8b644dc7 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7674,6 +7674,16 @@ static bool trans_GMI(DisasContext *s, arg_rrr *a) return false; } +static bool trans_PACGA(DisasContext *s, arg_rrr *a) +{ + if (dc_isar_feature(aa64_pauth, s)) { + gen_helper_pacga(cpu_reg(s, a->rd), tcg_env, + cpu_reg(s, a->rn), cpu_reg_sp(s, a->rm)); + return true; + } + return false; +} + /* Logical (shifted register) * 31 30 29 28 24 23 22 21 20 16 15 10 9 5 4 0 * +----+-----+-----------+-------+---+------+--------+------+------+ @@ -8555,59 +8565,6 @@ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) } -/* Data-processing (2 source) - * 31 30 29 28 21 20 16 15 10 9 5 4 0 - * +----+---+---+-----------------+------+--------+------+------+ - * | sf | 0 | S | 1 1 0 1 0 1 1 0 | Rm | opcode | Rn | Rd | - * +----+---+---+-----------------+------+--------+------+------+ - */ -static void disas_data_proc_2src(DisasContext *s, uint32_t insn) -{ - unsigned int sf, rm, opcode, rn, rd, setflag; - sf = extract32(insn, 31, 1); - setflag = extract32(insn, 29, 1); - rm = extract32(insn, 16, 5); - opcode = extract32(insn, 10, 6); - rn = extract32(insn, 5, 5); - rd = extract32(insn, 0, 5); - - if (setflag && opcode != 0) { - unallocated_encoding(s); - return; - } - - switch (opcode) { - case 12: /* PACGA */ - if (sf == 0 || !dc_isar_feature(aa64_pauth, s)) { - goto do_unallocated; - } - gen_helper_pacga(cpu_reg(s, rd), tcg_env, - cpu_reg(s, rn), cpu_reg_sp(s, rm)); - break; - default: - do_unallocated: - case 0: /* SUBP(S) */ - case 2: /* UDIV */ - case 3: /* SDIV */ - case 4: /* IRG */ - case 5: /* GMI */ - case 8: /* LSLV */ - case 9: /* LSRV */ - case 10: /* ASRV */ - case 11: /* RORV */ - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: /* CRC32 */ - unallocated_encoding(s); - break; - } -} - /* * Data processing - register * 31 30 29 28 25 21 20 16 10 0 @@ -8674,7 +8631,7 @@ static void disas_data_proc_reg(DisasContext *s, uint32_t insn) if (op0) { /* (1 source) */ disas_data_proc_1src(s, insn); } else { /* (2 source) */ - disas_data_proc_2src(s, insn); + goto do_unallocated; } break; case 0x8 ... 0xf: /* (3 source) */ diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index f0a5ffb1cd..a23d6a6645 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -682,6 +682,8 @@ SUBPS 1 01 11010110 ..... 000000 ..... ..... @rrr IRG 1 00 11010110 ..... 000100 ..... ..... @rrr GMI 1 00 11010110 ..... 000101 ..... ..... @rrr +PACGA 1 00 11010110 ..... 001100 ..... ..... @rrr + # Data Processing (1-source) # Logical (shifted reg) # Add/subtract (shifted reg)