From patchwork Thu Oct 26 00:14:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 738257 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp557525wrq; Wed, 25 Oct 2023 17:33:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtcf7I7qtha/nMRV1bx5n8jHVLUeg4xpWc1pj8sKMC1VqKHnzH2vhPF6R5haihV0hKsbKR X-Received: by 2002:a17:907:eab:b0:9bf:1142:4361 with SMTP id ho43-20020a1709070eab00b009bf11424361mr14172916ejc.10.1698280403557; Wed, 25 Oct 2023 17:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698280403; cv=none; d=google.com; s=arc-20160816; b=dtHJHUkujNOGIHfSU360bGRHQ4Cd5xMUyObqHvyGmO7O+uKpn82/+0UmZmDQ7PZ659 jWAwfI2n/ZM5VyTNypojFVGZPaEP7Q9UiMhMO9DpV65MMPa3Qf9VijthXRsRYs0WcW35 vvNbHF6QJyYBLLMJB0N+u6/udPg8aAIm+VcHP5R5jRlg6d+nrmZbCovehiwTUADgyiCV /UVWrMGw+NQSOoI2+d9hqFfSD6GOUa+jp44Y8TKnjZdMvMqd4zobcjWf0TZ80ox0t4qn g0OobNAuuGOkB5J7J2LNpq8BqLf8cCzaC8l0RsO5QXNDKvVWpT4mQ9O6ICHMXcGKlHfQ /igQ== 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=PvPbrl15JgqhGwk9JcRkjLrmHs6hD8F59ocp/OQFjPE=; fh=rYI8DiHAAFX3O5g969KmOAQ7d45Sb8OxQX1+DywGDk4=; b=vHR81gKDu8Er1jb7kPBpgJNFHoGaKXjHGh4LqD3fn6pELoga4oFusccDLKnuO14Ayi b0U9PzQKpgRk3GVHFD+7kz4ooL7z78yj6GYsQvONaP1o+jDwhVlOMXpZbp4b6FTUc6c8 IcAC38i0wfpqvMGJrh6o4ddofZoUUH/hCGTWPdAv1sWuM7+eBGs9pWuGXMED825Z6B0y nA3c0WfqiC9Fy4e2fbFr3CFgqLLUXPAmEl1cUntc4MS54/Eo+bnNdPFTzJd71WaNwj/n p8wfJL2R9wBDWUPUhueDywSI7Y6odt7Xp45XDKBNbQUIiV/YuVyJrMd/oecseyucIbrZ ZIVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ef613Kob; 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 dc11-20020a170906c7cb00b009a63cbd4b02si5844855ejb.932.2023.10.25.17.33.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 17:33:23 -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=Ef613Kob; 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 1qvo6u-0002Id-GM; Wed, 25 Oct 2023 20:20: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 1qvo6L-0001Rx-9d for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:53 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo6F-0006tk-DR for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:53 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cbf47fa563so2295715ad.2 for ; Wed, 25 Oct 2023 17:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279586; x=1698884386; 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=PvPbrl15JgqhGwk9JcRkjLrmHs6hD8F59ocp/OQFjPE=; b=Ef613KobZB1+X34OVOYNv7+fQ0M0SLeCUoUBefglu36311oTL9aRT/iOfl9Vd9lZuL gY1Lu4DGfWm+teMvPdvT7IMiMFovPHrq1SdiSsXU3W3reAt3pSF//xF4aY0UluxG4T/c 6nRmUFczcPz+iErYuJWS+xsyH+XM2RlIBVUAWOXSWmUDNQ+S5txsOMDlcK33I8OWAuA3 2gwRrm0DoqNpsV5d/S0BEI+0o99GrigYyQsV5STa9XwBGi5AqCGo8DBXBV0nMA/aDktX O8B4ie/9CLM/h0QP79vNSdBV16PJ35cbJnrBCuSLgcNbU+cn93h/5RTyAa82XlAsNAJx msSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279586; x=1698884386; 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=PvPbrl15JgqhGwk9JcRkjLrmHs6hD8F59ocp/OQFjPE=; b=vOhns/EOQOTycR9/tagGW61fkgfSDZ9V1XQOcRbQUjbBAZ+jHT3lhmstYBOLiR37CE f1Cl8vcM74ENi62PZmcRZ8UYUn8NB7VlkTQgPdPFdrQcWAGLoxGJcpeCu0vPLNh7o2e3 xJho1AbPq1N0TiR53tombiZ0Txo4NF640qZchH14WoI6lzwvx78WqtrcnDBotutVEALo uxRetPVM+PsBG/AndRw59X4336Wf9zYIeSnJT0IuRbskxmgntgHtN5G4NKYwder2XetY SWuVGJlahXFh1DYAjslYoqJPfe7i8PIv3ONrZ5xYFFN3pOE0/375QqqO27VcobO0x85p FHMQ== X-Gm-Message-State: AOJu0YwA0iihpy9edirMrVVNirnkhmyktnklDBI27Ajdk7qR5qnL79D6 BHFkUbxewDxAnPM7S9/HVQRPXkGa/3ArOXX/cVk= X-Received: by 2002:a17:902:ec8e:b0:1ca:82f0:131a with SMTP id x14-20020a170902ec8e00b001ca82f0131amr19214169plg.19.1698279586024; Wed, 25 Oct 2023 17:19:46 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c5fc291ef9sm9754655plb.209.2023.10.25.17.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:19:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 46/94] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree Date: Wed, 25 Oct 2023 17:14:54 -0700 Message-Id: <20231026001542.1141412-76-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::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 91de0b1206..e0a13e5d29 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) { /* @@ -4457,6 +4462,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; @@ -5272,18 +5295,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 */ {