From patchwork Fri Oct 13 21:27:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 733258 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1677635wrv; Fri, 13 Oct 2023 14:29:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0E6wuU2p/nqNX17izQMZmAPHdORDLUQo6TUAeOhklFj/LBq1u+M73dnZ7f+AhcwjhdFdH X-Received: by 2002:ad4:5310:0:b0:653:5960:8959 with SMTP id y16-20020ad45310000000b0065359608959mr27780269qvr.41.1697232579255; Fri, 13 Oct 2023 14:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697232579; cv=none; d=google.com; s=arc-20160816; b=JGiS38Zqnm5orSN3OmWiePLRxCkEzhDTiYXCZOx1y/7MdRNB7YFDViKMwauQma1Ew8 zNgrOnwXVn43VaDeu2l/VvUN8EPEw4JB4D/QH4vCgE+mvjzhZ9RWsdLuG5jpr4YELZSW 6z80IwcXj/5FL9+CzfmzPLFrhCKUNwuOdLQytdS0+K6QS/f+Zo3s13xSl6LqktJ/wX9+ Seket2LyprD+myFRxCQzOyu3GtP84uotx+9Ar0Ax34zb/ZabMmSPh0AY+ZKhrpwHiQIB i7yJ2rYZvZJSG6PrQM6NblLvJcTO017JLgBcAN3Q3fdK8Ry7wJkGH4uyPCl4ZSD/WEvy 30qw== 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=PNIL4pN5JeJ3Z5YvYXuXP0cO4Np1EpKLwd4Cf3DmRtw=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=Vl+ITOy6EKLwG89yrbSByJ8qkmqj5y4Qb/YWla3nXn9izGGtwQrlTeTfSgxEJPpJ1F RFT20MQT+DvYI5ecUCOv08u4+7PgbeJQTOKhanUtCM0qGRfTAr69XA9p9lAcqa6rDK/n BNTG0+NamIRlh/J64YUyvsz2xo88kwreejtEAcOgHhrV9ytY1eP+LXP3mYZw5ImPZHgf vHWuGYbH6pDohAxFA1WHdx4xpk/kPbDROhkmK7FRgGUiOPkroNw4rNnXnaNztt/V1bpZ Hg8846QHOl4sc2GbI2km8PkNFD6zsZPOmLw3VKciX7N/Wr3UInrk5rhcsvNJAYnXS+Fn EA4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HrEO8QD4; 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 l11-20020ad44bcb000000b0066d108deb40si1805522qvw.547.2023.10.13.14.29.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 14:29:39 -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=HrEO8QD4; 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 1qrPiN-0006Cf-Ts; Fri, 13 Oct 2023 17:28:59 -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 1qrPiL-0006BG-OK for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:28:57 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrPiJ-0000Pt-59 for qemu-devel@nongnu.org; Fri, 13 Oct 2023 17:28:56 -0400 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso646959b3a.2 for ; Fri, 13 Oct 2023 14:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697232534; x=1697837334; 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=PNIL4pN5JeJ3Z5YvYXuXP0cO4Np1EpKLwd4Cf3DmRtw=; b=HrEO8QD4AbGnqEZtfwEVS8mHeLYKbOvrPLXs06e+EThQ6g3z4v50rG0Pb8OHPOqbh5 tLfIizAkfwpFaD7WJ3g/j+KdGzVrHyTFfL69nVC0j2KV4J6vogtsfhdPts4SjMwZeakT pQj8hN3K4QGFPgt7m7+riIi2n86zCA1/5nfdpka34EMozg7+Mbm7moU6ZSQG5puse5gs YFfYTq5iAnbhRdHzS4inVUads6BDDTqenjHTJu4AZhKdPzOn67orZCReGKtmuXJIejoM FQ9SJqlIPWx41p8CViRfBz4ZYwNrsfr/thWPa7rMh2M1njQbLjzHwMMuzYnM895PKnSz QHKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697232534; x=1697837334; 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=PNIL4pN5JeJ3Z5YvYXuXP0cO4Np1EpKLwd4Cf3DmRtw=; b=CcX555feHQGCZPJeQ0OrDLVxCK59/B+DLtK+AIUZ3FG/2Km6bvtFtxaqcZNXC61rSr S4ZuiBCIPR3I7Ka/Ktc9bYHViH2aX5TMAmNXUSPl9Lt0cDG1fSyoFLbF+f21zyPY7RA0 vFmIO9wlzOSPn78PNLiMT+mLxq7o7Qj460kKk4d1w4gwPWH2RDABg/gu/pG7cLhBBgEf L7TyZZ63wGuhYI/9mNgm1ZiKpcfsAiVsyJ9vjvDBbF4ndeUYjnTKb8eL6VsEVh8gyG94 /F0ZBT5bZrQBCVXuz0+9BSBhN4xm8xD59WIRc6mjDDrkOcVl9xepNgS5c+teofKwBJsk 9Ldg== X-Gm-Message-State: AOJu0YzC62AqsOJcNIrvQeC/KjPYCpHUn6q14JgXLvYKY1B+CifvjTLo TgZzKdFWOy46WsZAroFPT6YYvwbYFdL87ueAs+I= X-Received: by 2002:a05:6a20:5490:b0:13d:8876:4c97 with SMTP id i16-20020a056a20549000b0013d88764c97mr31049740pzk.16.1697232533927; Fri, 13 Oct 2023 14:28:53 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id b185-20020a6334c2000000b0058988954686sm70753pga.90.2023.10.13.14.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 14:28:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 06/85] target/sparc: Move CALL to decodetree Date: Fri, 13 Oct 2023 14:27:27 -0700 Message-Id: <20231013212846.165724-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013212846.165724-1-richard.henderson@linaro.org> References: <20231013212846.165724-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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 | 33 ++++++++++++++++----------------- 2 files changed, 17 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 da6503e101..bc1033231f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -3002,6 +3002,20 @@ static bool advance_pc(DisasContext *dc) return true; } +static bool trans_CALL(DisasContext *dc, arg_CALL *a) +{ + target_long target = dc->pc + a->i * 4; + + gen_store_gpr(dc, 15, tcg_constant_tl(dc->pc)); + gen_mov_pc_npc(dc); + + if (unlikely(AM_CHECK(dc))) { + target &= 0xffffffffULL; + } + dc->npc = target; + return true; +} + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -3107,23 +3121,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);