From patchwork Sun Oct 22 05:59:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 736942 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1004090wrl; Sat, 21 Oct 2023 23:05:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPnt9CLvMwrTP0Q6IhW0OlWfGHnR/Yr9ps1EgDIPNebcoyNxYsFdgLaUTOj/573b216ims X-Received: by 2002:a05:620a:24cb:b0:774:3147:4251 with SMTP id m11-20020a05620a24cb00b0077431474251mr7319111qkn.6.1697954729742; Sat, 21 Oct 2023 23:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697954729; cv=none; d=google.com; s=arc-20160816; b=RHz5H4JXwMmbjCkkPy7eloDw37TN15i7ThGj5y7fTK/qA5uUuGB7JwYDVCncATioYL 0ncU/KN7cJtV5AmQYxB1CZuNj8HJta3XzswRnGTFiNm+eyjQZpZhk2UOxPh8HHfoHnwI K9R6GBfv1Us8VVFHz/SqIKGdoHtvUg1zkSmNCIbup3ghptup9erdOEkh9IsSDpkZq2kd iDL8UlVagH8syn5lEfBvJJX2pZN/7j3hx4NDnri+lNYZubeUFeVUVNbZ6nuxPeDZmSMP 0zkDFg6h8yfJC/VGHZhQWMr1AJzihXicVPa72ujJQBmwiq2K4lfY3GG+9cxSTciQ9CcO 7HFA== 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=Kh4UR/x6NVS8OMj/epOA+pEm4qe7LB7jB8T5mbBYeEw=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=UfnCk2+5iyedcqiC2vuGuytRERxMCI1ZqdLMXfwx2ltVMLznlGTAUQxob5MI3yiBqr qEub9KiDtHBiNlFkiL6MVm1gpv031Q0TXoN68Jud7vt+cWxqyqWVQceqBsdpEdLxikw5 +4kx9rZhX7ImFef56MURvx9yE8xvFTcI1WNjD9ip5ChfsHrHlbuiG9D8hyUkuOyuMQd+ iVF0veFT9cMn17/Xy5tiFQ+ah42CrRV9uN+uAZcLv9+9HBx5bALt5ZHd62KzZA5pPCK3 jtS0o7TlkQHqjeV0Lj8c+72fb04ZUm1n80me/LiuIR3CI5ukiR6171vmHoePaT5luGp6 t4XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TFHTqxyX; 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 f1-20020a05620a280100b007741e910951si4120993qkp.695.2023.10.21.23.05.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Oct 2023 23:05:29 -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=TFHTqxyX; 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 1quRW3-0000Vc-MF; Sun, 22 Oct 2023 02:00:47 -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 1quRW1-0000UQ-P7 for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:00:45 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quRW0-0001Wy-00 for qemu-devel@nongnu.org; Sun, 22 Oct 2023 02:00:45 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6bb4abb8100so1741093b3a.2 for ; Sat, 21 Oct 2023 23:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697954442; x=1698559242; 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=Kh4UR/x6NVS8OMj/epOA+pEm4qe7LB7jB8T5mbBYeEw=; b=TFHTqxyXoBvkBd3cX23jmhkXeiLslFau7llcqZWqwTvsJcQLD7KhrGPVM/0Bs7Vren vT+I75F5f5Zs6Xt4Y2lAyeCN1oaPHxyVXR+G9xi5mOrtKfSFob1JYQ9pve++49gD8DL9 tpsDMGG/kVKhJQUe546tEoa/XWYvwKk3SLnMv/rQHG8B8YoTBXjI+0jtxyvJHqZNuCSR uI89KLvjULpMrNc/Fqh7nmTNwJs7ICaZIIkhorcf1C/36CLHiDIEd0iTOb60/MpiWcaa YmahZBL+w8D3cmWH77fwMPHPE9appLhPt7BlPG4IQAoCK3oE4VwCGnXsDvcSOHgizwHn OBig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697954442; x=1698559242; 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=Kh4UR/x6NVS8OMj/epOA+pEm4qe7LB7jB8T5mbBYeEw=; b=IVFBHDEvxdHXtaVDJ+nf25Zsg7HsvO+v664wzjP4glmXjkX5byWZGULEfOTY2WTYDl gxI838Dc+qz3RcHmHzlNU9TaCrhnHi4lYk4lyMCNRaf5YJCuer1Zp+sq40L9Bax/CrIs TB2kGW/ED48L7Qhrhs51eWOmEIgKaLMXZQv437LoaD1dEcknoUjp4iCwxGAQL5IzXRDX 9IJgMhog3Ijs4bez1q9V/LhvGTqZWuQptDftIEGxT4ZAxQGKKmmrWfHR5vI1RWlPJaLX t5Z2W1sFjT9vMBSwaiZ+DQtGwnLObbsSVrC5/PG/GGva42wHngsGPFsUDFEBXgfWhnVn nXNQ== X-Gm-Message-State: AOJu0YzeyK6tevC1lhjJ5L2HLfrbHVWgjsHleHefroEPawflowFHPoYJ 72ZZaEnBlSq4Y7pMJpbJ40YrFp5hl181SHBS9ZI= X-Received: by 2002:a17:903:2310:b0:1c1:e7b2:27ad with SMTP id d16-20020a170903231000b001c1e7b227admr4860226plh.60.1697954442353; Sat, 21 Oct 2023 23:00:42 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id je17-20020a170903265100b001c728609574sm3999887plb.6.2023.10.21.23.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 23:00:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v4 11/90] target/sparc: Move CALL to decodetree Date: Sat, 21 Oct 2023 22:59:12 -0700 Message-Id: <20231022060031.490251-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022060031.490251-1-richard.henderson@linaro.org> References: <20231022060031.490251-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 1 + target/sparc/translate.c | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 5811a679db..a5f5d2681e 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -3,3 +3,4 @@ # Sparc instruction decode definitions. # Copyright (c) 2023 Richard Henderson +CALL 01 i:s30 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 9eb2b7e52f..7ef4c6d4f7 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -285,6 +285,11 @@ static void gen_address_mask(DisasContext *dc, TCGv addr) } } +static target_ulong address_mask_i(DisasContext *dc, target_ulong addr) +{ + return AM_CHECK(dc) ? (uint32_t)addr : addr; +} + static TCGv gen_load_gpr(DisasContext *dc, int reg) { if (reg > 0) { @@ -3041,6 +3046,16 @@ static bool advance_pc(DisasContext *dc) return true; } +static bool trans_CALL(DisasContext *dc, arg_CALL *a) +{ + target_long target = address_mask_i(dc, dc->pc + a->i * 4); + + gen_store_gpr(dc, 15, tcg_constant_tl(dc->pc)); + gen_mov_pc_npc(dc); + dc->npc = target; + return true; +} + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -3146,23 +3161,8 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) break; } break; - case 1: /*CALL*/ - { - target_long target = GET_FIELDs(insn, 2, 31) << 2; - TCGv o7 = gen_dest_gpr(dc, 15); - - tcg_gen_movi_tl(o7, dc->pc); - gen_store_gpr(dc, 15, o7); - target += dc->pc; - gen_mov_pc_npc(dc); -#ifdef TARGET_SPARC64 - if (unlikely(AM_CHECK(dc))) { - target &= 0xffffffffULL; - } -#endif - dc->npc = target; - } - goto jmp_insn; + case 1: + g_assert_not_reached(); /* in decodetree */ case 2: /* FPU & Logical Operations */ { unsigned int xop = GET_FIELD(insn, 7, 12);