From nobody Wed Nov 27 14:23:47 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1698279592; cv=none; d=zohomail.com; s=zohoarc; b=kLgImaU3/uKRZZDSFlUkRWM/u5jCsmpShoMZAwFybFXPCdcRVEgH+cR8n0/FPjH/vhaO/7FETgwywLg7yIW1hrTQ8vIs7GV+XdVSCcaiLngWWelA92xqhildaldN+hmii4jpX1SBPm7EsnUAzwTEXEbdrm4fOOkuQHLwKug2nZc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698279592; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5V/MzDPCPtSl5p/d34/PgkVJsUATuXtmCOJbzl0yEFY=; b=Lmuimjpmw00qCorxVxyhyCN9CSTE3o1VE9pXKWiOkSJSEv3Jw4KtP/e1f9SxxA2xR2hooxvr3acP9mIEk+RWxRUZXMxBrNKKCvE6XHE6oGVAMvulrEjjJpCjlBHCxH9jYlXAih3U3qwMm7ngZSWrxNxM37l9y/DNGKOVa0kJd4I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698279592387504.9169211511413; Wed, 25 Oct 2023 17:19:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo2z-0007Lb-2Z; Wed, 25 Oct 2023 20:16:25 -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 1qvo2v-0007Gh-I5 for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:21 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo2r-0004w5-JR for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:16:21 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6be1bc5aa1cso294899b3a.3 for ; Wed, 25 Oct 2023 17:16:17 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ij23-20020a170902ab5700b001c582de968dsm10038433plb.72.2023.10.25.17.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279376; x=1698884176; 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=5V/MzDPCPtSl5p/d34/PgkVJsUATuXtmCOJbzl0yEFY=; b=ReP/tdTawWVX0Oj/2MovUjQSPcYasaBEXdYuTy8+wJ8A1GgsUtPoCP5QQ3uX6qxjoG jFbCSy72mZeBCN18p/q1K2uq+fcXlQHtdM2IEBRQxQIR5fiX9S4ALpTjzfHDHbB5P2gt BN7Uls2FsxD8fSmp+rWpMkIjb99qpVwUzfvgH9kwwZKUGIXn7B0US7ADezTuEIrRXYHT WllX3l0TNsOUKEhkqzNdFeWZ5ekFYRm9AT0v84/VrdmaXKd1Q/PtTzwYyCc4kMpp3+dT TtrcouAdLS0LvyXyN6cyH4m9JnHPQk6PsC4neS5Y7PdO1tE/z6FD2bpvVt9O90SrqlWz 4CCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279376; x=1698884176; 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=5V/MzDPCPtSl5p/d34/PgkVJsUATuXtmCOJbzl0yEFY=; b=n10ByJeTNWi/FoFBfMveGyu+sat0+dqujaD+yPeVdhCryGRID6iqC97knhgWejEdTF tjaDXTJlF5VP3PRhjkPpcWGNm7C9i0I0xwzvJ15MgeoHci4VQLL7ZLR/5YuutUc3gTir OLnCGe2SI1dqfgu/eudurVR4kbe2uVXFq+d47NPPkBtXsB86egHfSaGOOMfVkcR0bs0M lOSOmDJSPXCW8g/O6XRt87y8cKZ7yfEP5wMZIzMKgsJ6Jkk1X9wdSdCu+dqZDEex8B1n folv9fQEwut/SkTGri9K/cXzlEsAkGsQPAxiKVheGsn9YVodaQdM4lARtvk1L2fGqkMq jc6A== X-Gm-Message-State: AOJu0YxQb03o8S1rFgUvEsZzMtGXFEgtItHz7SbgLzqkuC3Y+bbHeemN +7i8tQp9b70h5ezfWTNc0lfF0edWgPJWB7kHs/4= X-Google-Smtp-Source: AGHT+IHRVVIFFpSO5oULV52pZ/2MhoAJWdL2M2PevJ1aSfnCa95YYB/wN0ALH6rgBpBv6HEBRtkP1w== X-Received: by 2002:a17:902:f550:b0:1ca:7086:60f7 with SMTP id h16-20020a170902f55000b001ca708660f7mr18868027plf.28.1698279376220; Wed, 25 Oct 2023 17:16:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 20/94] target/sparc: Move SETHI to decodetree Date: Wed, 25 Oct 2023 17:14:18 -0700 Message-Id: <20231026001542.1141412-40-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1698279593868100003 Content-Type: text/plain; charset="utf-8" Tested-by: Mark Cave-Ayland Acked-by: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/insns.decode | 6 +++++ target/sparc/translate.c | 50 ++++++++++++--------------------------- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 9ab3f2eb82..f6f5401b10 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -3,6 +3,10 @@ # Sparc instruction decode definitions. # Copyright (c) 2023 Richard Henderson =20 +## +## Major Opcodes 00 and 01 -- branches, call, and sethi. +## + &bcc i a cond cc BPcc 00 a:1 cond:4 001 cc:1 0 - i:s19 &bcc Bicc 00 a:1 cond:4 010 i:s22 &bcc cc=3D0 @@ -14,4 +18,6 @@ BPr 00 a:1 0 cond:3 011 .. - rs1:5 ..............= i=3D%d16 =20 NCP 00 - ---- 111 ---------------------- # CBcc =20 +SETHI 00 rd:5 100 i:22 + CALL 01 i:s30 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index d12f2b4b87..cdd929282a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2873,6 +2873,10 @@ static bool advance_pc(DisasContext *dc) return true; } =20 +/* + * Major opcodes 00 and 01 -- branches, call, and sethi + */ + static bool advance_jump_uncond_never(DisasContext *dc, bool annul) { if (annul) { @@ -3029,6 +3033,15 @@ static bool trans_NCP(DisasContext *dc, arg_NCP *a) #endif } =20 +static bool trans_SETHI(DisasContext *dc, arg_SETHI *a) +{ + /* Special-case %g0 because that's the canonical nop. */ + if (a->rd) { + gen_store_gpr(dc, a->rd, tcg_constant_tl((uint32_t)a->i << 10)); + } + return advance_pc(dc); +} + #define CHECK_IU_FEATURE(dc, FEATURE) \ if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \ goto illegal_insn; @@ -3049,41 +3062,8 @@ static void disas_sparc_legacy(DisasContext *dc, uns= igned int insn) rd =3D GET_FIELD(insn, 2, 6); =20 switch (opc) { - case 0: /* branches/sethi */ - { - unsigned int xop =3D GET_FIELD(insn, 7, 9); - switch (xop) { -#ifdef TARGET_SPARC64 - case 0x1: /* V9 BPcc */ - g_assert_not_reached(); /* in decodetree */ - case 0x3: /* V9 BPr */ - g_assert_not_reached(); /* in decodetree */ - case 0x5: /* V9 FBPcc */ - g_assert_not_reached(); /* in decodetree */ -#else - case 0x7: /* CBN+x */ - g_assert_not_reached(); /* in decodetree */ -#endif - case 0x2: /* BN+x */ - g_assert_not_reached(); /* in decodetree */ - case 0x6: /* FBN+x */ - g_assert_not_reached(); /* in decodetree */ - case 0x4: /* SETHI */ - /* Special-case %g0 because that's the canonical nop. */ - if (rd) { - uint32_t value =3D GET_FIELD(insn, 10, 31); - TCGv t =3D gen_dest_gpr(dc, rd); - tcg_gen_movi_tl(t, value << 10); - gen_store_gpr(dc, rd, t); - } - break; - case 0x0: /* UNIMPL */ - default: - goto illegal_insn; - } - break; - } - break; + case 0: + goto illegal_insn; /* in decodetree */ case 1: g_assert_not_reached(); /* in decodetree */ case 2: /* FPU & Logical Operations */ --=20 2.34.1