From patchwork Thu Oct 26 00:14:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738290 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp559610wrq; Wed, 25 Oct 2023 17:39:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4xq1X1nVsLsSOiGu0+dKmeo9h3gNVYxueIw1kup7Mmw9ZlFa9imPY8iLPp6ICOGAcilaE X-Received: by 2002:adf:e7c5:0:b0:32d:83b7:bdb9 with SMTP id e5-20020adfe7c5000000b0032d83b7bdb9mr13164478wrn.21.1698280793387; Wed, 25 Oct 2023 17:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280793; cv=none; d=google.com; s=arc-20160816; b=G9BJ8uiSgedYlgDfYaYwTFQgXwrCBSSbSQ6lIM3hjsKWk1SvUTPI9IMzCzy+VZm9qS Qa+MLvj8XOjXYGfB0TNr0NFLVMV6AiTTHi0Le0ymm4vhWYutoH1zir9mxkE7k0TfIQaA O7c0uuudlJlxr5d8W6QCPFzq8ovEi5jAFsPqxOhWIXqozDh5+h3GQPnE0ucLNEdWQZGN CL9ydouP8C0i5EvNWoYKFAxN9puKUQ5DmIrz8IL8mpStlL+HeaHdhyGD9riQV+mr0EY/ TWUBwefsQlc7VOXFvcuhYvaTG3z8fUTHePe494FQnFUF48iFcq6fHp7whe2+8ZCIe/z+ fRJQ== 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=HaiE1/bSeMZ+5UImRCGkx6jDgHWHLGDLQF46mh2/Gqw=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=MJ9EuraziayHs901ORdP7kf1XjEH7jVZXD9x74J03sIjEF3QmgQCiOnaskzTWk8gqf K3PY7kDD0LkskcyXbKmbXD7rER71wQGp7m2QpBKKIxOGb/Vi/rYOcnTUSZmGeJY/TttY X1u4CKdOjUA+voL0544RL1PpSK9ukgaPKw+o5ox079Y7VOzOiMMirSIcMq90BBJQ5Dse upbl+TtrJY6j0hvcem9lwhVOgK9kalgjgwTKuN8Z+7nS2DN4lf7stxuPI/P+JnZXzyOV U0y5P+fLPzXppE/vdwvA6Ry1ca/jCcNpGJz7XWUQ7E5xlOkt5rJgsFW3T3LK0bqnUSjp 6lDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="QcIP/gLs"; 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 l6-20020a5d4106000000b0032db2ed4a20si8166633wrp.17.2023.10.25.17.39.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:39:53 -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="QcIP/gLs"; 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 1qvo2u-0007CI-Ma; Wed, 25 Oct 2023 20:16:20 -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 1qvo2l-00070w-Gq for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:12 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2h-0004rd-MV for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:10 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1ca6809fb8aso2265995ad.1 for ; Wed, 25 Oct 2023 17:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279363; x=1698884163; 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=HaiE1/bSeMZ+5UImRCGkx6jDgHWHLGDLQF46mh2/Gqw=; b=QcIP/gLsRbPQtBEdXR7pbLVjgSigNds3hbemDgm8ZGcXNRS3sCUvICRvrEfobhPlu2 mz+xryO54onZbeE2be+R5+M8/ilEmO82yR8uGFLpUps9tubVDhQtYsELK+FFsGNkhx6o 8FKpRjuqNnemKTGx8W9ZU10yldIo0ISN4vJXA4DZS/K8DeSrhhWeZfBacJ3hTSYvQrR4 EC+4Smjgzw3kBJxtN1gEyajga1rz6h5Cm9pvaYLDIMcPn9gva4QuwLEy0iRkU8p6uenX bOXWGSpCPAWzhizEwYe2OYERxR+OM4wy2ngOgcJY3Z1f49vrZeev5M3eC5tUDJbPHtYa JeeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279363; x=1698884163; 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=HaiE1/bSeMZ+5UImRCGkx6jDgHWHLGDLQF46mh2/Gqw=; b=tTMUU/A/GTZWShe6hDxky/4aIQO4DTjB5xlD737iM6b7qtXj4/D7XVuk4VXMCrRrgX MaNIzxV7bEJKmGnNOaZFMtGB/8e3jPfq94GzYwebNZnhOkvaz9V4kkAfdIOf7V4bjGj4 aEBuEVOciF4YeyVFpPr02FJH/6yPV86kBHsQzRwU2Wq+O5JWNord56SI6ddJkQfF+8xx STbmrvobupRImXqF+GV8ZONmgnk1YrLSfPxW9RJGgmieLHvdtAZqxw8UtDper78mayzC LQ/r8cxqnDCfRnytdPk/A8txGRn/5TbxdGUhXb+5AtOYGHxzLAgug8ImmnIL+bykoHsO rXLg== X-Gm-Message-State: AOJu0YwwEadt33uQVAThCQH+IDt3RmXkPnqKUUkbjHNVd7o51G3mwreC niddiHkTByatnHSz2CG2uBJADq3VQCaqeu6z5Jc= X-Received: by 2002:a17:903:1212:b0:1c8:92ee:108a with SMTP id l18-20020a170903121200b001c892ee108amr16888850plh.23.1698279362933; Wed, 25 Oct 2023 17:16:02 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 12/94] target/sparc: Move CALL to decodetree Date: Wed, 25 Oct 2023 17:14:02 -0700 Message-Id: <20231026001542.1141412-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231026001542.1141412-1-richard.henderson@linaro.org> References: <20231026001542.1141412-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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 Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland 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);