From patchwork Sun Oct 22 23:28:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737071 Delivered-To: patch@linaro.org Received: by 2002:adf:dd81:0:b0:32d:baff:b0ca with SMTP id x1csp1283318wrl; Sun, 22 Oct 2023 16:35:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHK0TVllAUbgDBCMsV+/6ZLsfTCg9BT3zNHb9PHjmecnvwDPeleqEeYu85Sz/SjlFvVuNzo X-Received: by 2002:a05:620a:4548:b0:76f:b00:4e66 with SMTP id u8-20020a05620a454800b0076f0b004e66mr16404210qkp.9.1698017757108; Sun, 22 Oct 2023 16:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698017757; cv=none; d=google.com; s=arc-20160816; b=BLvRTWgrf+sCdd93cxmLEwpMj4nW/woFqKC4MUIV47dVRHsFqu5ib2XnVbpBkybiie p7i7PDlitEgEAF89JNiRaxDQuYO0O2FSDTB1DKtM8K7Bnivx8TSTh9RPS48IZB82whOj O7hN6X/TSFHoFo6t8JE37FVEhYO9tWfiBcYhDv2E8eGSQMSsJ+u6qUNQ75rTDlcIWjbt iq5pt6B+L5FziwH+wNRcmjhjXupO0fr1yj7oaBT6wmghp060Jc8wn8Je++pneAVqoNpw diAFlcjtYokGZMKxLGP60QMSeTyZ2ici+THTQVX6tRrW4TzdlsftMPINX3aYHluvmwNf p55A== 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=FGKFAuhaFR6s2v1QljnD4mKd9249Dwf7ZIsDOC+Vbuw=; fh=TYrED6TOMxGX0VC4GtjviASLbYyJe19+7/tKWjN44KQ=; b=XcAlWH0qGxTNLKs5ExVlNT6GTAneP3jxtSSqnkPUVG4q4UCfW3Jw/0mL+df4zRJAeH UUjLDPlhs6ZoYAZMkHOTY6s0Nl8feHn3/w32E9ekH0bT64hzbe3SYPkfflDUZqSnEK6u v+UcQOc1k75We/uqdxwxJdWQMP6ol6XP6SLhfRfNHeNE78tjI/Y39Aa0WJM55fM4oQ0K vV3o3SnwdiCHpESijgCF3ohTRLSsvIyT5K/vKRgDpeuMEvF9LeO3gRv5ziD+yNEGUneN izztMjIyjtGVNEiR8Oet6qLsd8/vWxqqnjQq8dROSkQ25FhdnyJylt+LEqv/pmotMPsG RZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PgUdv8MS; 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 bk5-20020a05620a1a0500b0077076a46511si5099696qkb.255.2023.10.22.16.35.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Oct 2023 16:35:57 -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=PgUdv8MS; 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 1quhwg-0004Mz-9F; Sun, 22 Oct 2023 19:33:23 -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 1quhwe-0004ET-Vu for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:21 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1quhwb-0007Uo-6a for qemu-devel@nongnu.org; Sun, 22 Oct 2023 19:33:19 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-6bd73395bceso1935270b3a.0 for ; Sun, 22 Oct 2023 16:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698017594; x=1698622394; 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=FGKFAuhaFR6s2v1QljnD4mKd9249Dwf7ZIsDOC+Vbuw=; b=PgUdv8MS9Hp7LWpHC3Mwh0sUgOiv3E0qqiIu4glng8xd880TbsQLmVsn0IzA8/n49X y4QC/+3tndJUQjS/CG7mH0kZB0oI5lIIrwzWgUI5b3mmS0a2n+iY4VPVr2P8ehsFUoh0 DcJuJG6fC35U15dyW8HCthxV9nGfDSY5uCv1tHvJm/pGbtEUUMcYODS7rjQEAEk8liCa /4bKKgQ12RKVXRHo7ydouGzViQP3QQCOFTFq3VNm5SLz4Uz9UoUbNPZ+U/VASZI/S0SW 0pv/eJVQLlA2OZliqedjo/1VnHC4Tyhy19lwn5leJloozszlTt3bCTD1slUpre3R0A8I mkgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698017594; x=1698622394; 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=FGKFAuhaFR6s2v1QljnD4mKd9249Dwf7ZIsDOC+Vbuw=; b=l1GU2KEuxH9rO1L/TxkXDUwSLfgFyXVIPA1O5pLdWoKbJTNNCvKnOUA5Tae2BjmqBC 87vYLuQk9YML0NX2O4nJduWaE3tfYa08asvEU6eCC5ltMWlpfep5JrDdXjdheiAf1UvZ pwDD1JgFjLH/RgLY+vQjm0Jkyxdo+RAwZhrDVTPcH5a+E13F+6md++PIHET1qpyQG4/2 C7yL6TW6aGeWavb4xIMmT8VGn+hdCkGR9cYKXHRSUlGhhk2hEzmPxSFF0KvxdTpo5HgD 9Fp/YfscYBleX7VbJ/nvzrC112HFcRdCizOt8xUrAntm1px+NZB2/xL1ATuzzU1qqZhf 9nEg== X-Gm-Message-State: AOJu0Yzt1SY9WFGUqKP4UeYLmcn7L132xjEhRuJwaKrdxyuYGl/YggLJ BkIkJgqDK22O6tDYM8sjyVDMlUMuIotMyrtWn8g= X-Received: by 2002:a05:6a00:1817:b0:68e:3616:604a with SMTP id y23-20020a056a00181700b0068e3616604amr10905528pfa.8.1698017593716; Sun, 22 Oct 2023 16:33:13 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id fe12-20020a056a002f0c00b0066a4e561beesm5182855pfb.173.2023.10.22.16.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 16:33:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Subject: [PATCH v5 46/94] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree Date: Sun, 22 Oct 2023 16:28:44 -0700 Message-Id: <20231022232932.80507-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231022232932.80507-1-richard.henderson@linaro.org> References: <20231022232932.80507-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 | 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 271789ac13..aa90b5c5bb 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -223,6 +223,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 f3cb5e5146..e90be8b959 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4077,6 +4077,11 @@ static bool do_saved_restored(DisasContext *dc, bool saved) TRANS(SAVED, 64, do_saved_restored, true) TRANS(RESTORED, 64, do_saved_restored, false) +static bool trans_NOP(DisasContext *dc, arg_NOP *a) +{ + return advance_pc(dc); +} + static bool trans_NOP_v7(DisasContext *dc, arg_NOP_v7 *a) { /* @@ -4454,6 +4459,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; @@ -5269,18 +5292,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 */ {