From patchwork Tue Oct 17 06:11:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 734284 Delivered-To: patch@linaro.org Received: by 2002:adf:f0cd:0:b0:32d:baff:b0ca with SMTP id x13csp323691wro; Mon, 16 Oct 2023 23:18:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvnH5bQUc845EDK1xOOHaQ44J9dFqTUGWBSYo2+QKOj0cEyfv3p07Z9LQtlKug69OsenMl X-Received: by 2002:a05:620a:2947:b0:777:74c0:4f3b with SMTP id n7-20020a05620a294700b0077774c04f3bmr1116994qkp.76.1697523539668; Mon, 16 Oct 2023 23:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697523539; cv=none; d=google.com; s=arc-20160816; b=SxM93fBhu9Vw6cfii/dLhqQa29Da3wGZsO1EFY2XMMsbwW/6KnMhEcSbYShLmKCntr eJfcfA0VkH/+lLy48e3DM2HoiVa+hKWliUCW7NwyxT4UafnlcUnx72LyHb1tVWghAz2j 7SQBneEx9r0J3vckxEoza3g6ZeHpKn1+oLSkTIpawFBC2obAmGtmMv0YSwizxNO4oQtd Mc4UOtozqUANCqHqjgcBPXyn6Z9PzPYSE8m17XQd1Z+/KE5keFjEWxqA93PibjWb8EtX jh7P/aEvfrGWipLhwACFYWioBLnErTXgR9dl2wILdWMgLzqHlKJNW4T1rZiDHwCjG0s+ Ihog== 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=ExtlfcmBRE2sB2/CWMkspqZTp25HPrR30GPM9tlU6fg=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=pC28bYnCQlGzKmHsM6YuZKvGclK1eWhFKe1bPgt7nDMu4xAXEiGIkW8a+Jr5D8vnXZ C1NuwSzJ7yd7idEA62sjPnV8tqx4wXCLhhTM1uiFCuXhzK3kW5PxnkBbONEITdpLH6fc +c+Etu6JFpxXGk8lrTprap028Mn0RioAPC+9lYkJH9A/3HIyfuhOTjs86wTPcMOHsYBW blcnczZPqmUXGYLbLb4Rs6JLssUEgnAwU5fDV/yvBnE+slPC3MfZaD3b/H0I5alqeEe8 djMaMuIdgm8YrVz8BW2vMOy98+y9dftnNnTyL2miog/hvSP1TXsrDgN5u22pzSYL4k6P qK/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ps5rbuSq; 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 az17-20020a05620a171100b00775a6554b41si633305qkb.285.2023.10.16.23.18.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Oct 2023 23:18:59 -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=ps5rbuSq; 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 1qsdNU-0002eS-9I; Tue, 17 Oct 2023 02:16:28 -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 1qsdNQ-0002Hq-K4 for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:24 -0400 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qsdNO-0004f8-GZ for qemu-devel@nongnu.org; Tue, 17 Oct 2023 02:16:24 -0400 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-57b8cebf57dso2797760eaf.0 for ; Mon, 16 Oct 2023 23:16:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697523381; x=1698128181; 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=ExtlfcmBRE2sB2/CWMkspqZTp25HPrR30GPM9tlU6fg=; b=ps5rbuSqCxYnNhjFl3Ve5e0yP5c51DqgmMKVqqhAWm7gXOZemFVwdUb/b5Lc9qSV96 I7oe2KAIqofQUS8XbPa2gUn5m0YOI9ICBydhPssPgBShqCov77Udxv7/414LnJ5liuUO gfp/Pfv6RecSUrKSmrzJ1eC+0+QqlVUUi7d6R/38ZuLhWUr4CzcnfO/2afxk+CPxPRmP pPRxUUy8TCkB2qo8l9L5xEAL2dcftaULrH82jmzExJqUn/xO6iYXWDr/oXSh1xsHFHYq AB7ocQQkGmaBr6Rey+TDn9PUYjSqlnQnB0a8ghCWzrXJCw+5cxa8rawqY7laVs7T1Fxo xy4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697523381; x=1698128181; 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=ExtlfcmBRE2sB2/CWMkspqZTp25HPrR30GPM9tlU6fg=; b=DcUXC455sD1DotbW/+adN2bBfJG5wKeBrep41K5cAOovY1yZ0sYiGfuDGOH901fi98 ruhYIWCSq/LmCk0jQYtQo6EayBgXSQ5fnGy0gfDIOtnVEZetis2iKArFprxFojJeNK5c dqLEq07j11xrS1ho6jVT/903psUijKBecw4DAfbP1mveCA8p4kG45V4Z02s0UvrIjvoQ 4SBnNtPaim6zpmYYg0+kFSak3c+vgcHMFzChMn56b/n7Pdr8uY4aVanuCW2kemIrydsr 8pOCn83ctLWOoqjc4CUNQkjVnCKJx1KS7o+I5icfTjcLoS2L+P+oiW3LqCOj9blNgAiF 9S+A== X-Gm-Message-State: AOJu0YxBWOYkYy3TADtxXBFPK7hn7/I7Ah2LiWQDiY0FUlw5Bi+5pG51 qj5I2y89dX0cOXofSmUdJWhe/MmMtwnhAkuw4LY= X-Received: by 2002:a05:6359:2f81:b0:164:8225:83a8 with SMTP id rs1-20020a0563592f8100b00164822583a8mr1629604rwb.0.1697523380925; Mon, 16 Oct 2023 23:16:20 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id m10-20020a056a00080a00b00690ca4356f1sm579280pfk.198.2023.10.16.23.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 23:16:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v2 42/90] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree Date: Mon, 16 Oct 2023 23:11:56 -0700 Message-Id: <20231017061244.681584-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017061244.681584-1-richard.henderson@linaro.org> References: <20231017061244.681584-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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 | 4 ++++ target/sparc/translate.c | 35 +++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 060ee79db0..9c4c493630 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -216,6 +216,10 @@ JMPL 10 ..... 111000 ..... . ............. @r_r_ri RETT 10 00000 111001 ..... . ............. @n_r_ri RETURN 10 00000 111001 ..... . ............. @n_r_ri } +NOP 10 00000 111011 ----- 0 00000000----- # FLUSH reg+reg +NOP 10 00000 111011 ----- 1 ------------- # FLUSH reg+imm +SAVE 10 ..... 111100 ..... . ............. @r_r_ri +RESTORE 10 ..... 111101 ..... . ............. @r_r_ri NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bf8d611942..5fc46d1b20 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4138,6 +4138,11 @@ static bool do_saved_restored(DisasContext *dc, void (*func)(TCGv_env)) TRANS(SAVED, 64, do_saved_restored, gen_helper_saved) TRANS(RESTORED, 64, do_saved_restored, gen_helper_restored) +static bool trans_NOP(DisasContext *dc, arg_NOP *a) +{ + return advance_pc(dc); +} + static bool trans_NOP_v7(DisasContext *dc, arg_NOP_v7 *a) { /* @@ -4526,6 +4531,24 @@ static bool do_return(DisasContext *dc, int rd, TCGv src) TRANS(RETURN, 64, do_add_special, a, do_return) +static bool do_save(DisasContext *dc, int rd, TCGv src) +{ + gen_helper_save(tcg_env); + gen_store_gpr(dc, rd, src); + return advance_pc(dc); +} + +TRANS(SAVE, ALL, do_add_special, a, do_save) + +static bool do_restore(DisasContext *dc, int rd, TCGv src) +{ + gen_helper_restore(tcg_env); + gen_store_gpr(dc, rd, src); + return advance_pc(dc); +} + +TRANS(RESTORE, ALL, do_add_special, a, do_restore) + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -5341,18 +5364,10 @@ static void disas_sparc_legacy(DisasContext *dc, unsigned int insn) switch (xop) { case 0x38: /* jmpl */ case 0x39: /* rett, V9 return */ - g_assert_not_reached(); /* in decode tree */ - case 0x3b: /* flush */ - /* nop */ - break; + case 0x3b: /* flush */ case 0x3c: /* save */ - gen_helper_save(tcg_env); - gen_store_gpr(dc, rd, cpu_tmp0); - break; case 0x3d: /* restore */ - gen_helper_restore(tcg_env); - gen_store_gpr(dc, rd, cpu_tmp0); - break; + g_assert_not_reached(); /* in decode tree */ #if !defined(CONFIG_USER_ONLY) && defined(TARGET_SPARC64) case 0x3e: /* V9 done/retry */ {