From nobody Wed Nov 27 14:21:53 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=1698279902; cv=none; d=zohomail.com; s=zohoarc; b=G9HVmtglJDDHlUBhSKVZ6FSGNBj4sxm4E6bXvIxd4ekTph2CPMficfsuZ8wvMCQ9GxoLnz6/sAsAn4q2+0p/QpOI81e1VRW09Leu42rAgDiBDoNITT0hLJo5uWRw9mETiDFIkdPJt4JHOLgF7QyCpfLuhMhQ0ZDsmU17/Qlogpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698279902; 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=UaLDZUlxbnEBMWQWA0yY43XdPUXdultOeDE7cUVCPGo=; b=NbCpZSU3PMAYpmr1J923WdQhlbwmUVX9xu/6IpR7PrmoAlgK48cFW0JxvpVLGbdhmh+UXGdi5uOpsKknXzTfGj3gJk4G0wwYl/LBwGkbL5VoE5piDOo0xweTZIVtEcRzeuFNt9KfSWI1ttSFtmnuo2oaP/MiKFsP/nQKOIaRWRE= 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 1698279902326529.9744058205129; Wed, 25 Oct 2023 17:25:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvo6e-00025s-4W; Wed, 25 Oct 2023 20:20:12 -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 1qvo6K-0001Mz-0y for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:52 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvo6E-0006sc-2b for qemu-devel@nongnu.org; Wed, 25 Oct 2023 20:19:51 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c9e06f058bso11227355ad.0 for ; Wed, 25 Oct 2023 17:19:44 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id jh1-20020a170903328100b001c5fc291ef9sm9754655plb.209.2023.10.25.17.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 17:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698279584; x=1698884384; 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=UaLDZUlxbnEBMWQWA0yY43XdPUXdultOeDE7cUVCPGo=; b=zWaYqCjbKeNOnR4VUs3rwa1DMB0UkEHxvdSx30I54nsoX3InPZzCEBaD3jlxLnpXwY /8eB292/CaLsN3XjPbeVH+OADN/y4ENqNXFwMRUbXLDOhLAhEEJxALyzBn4rty5CErYS szyDugQxuU0zTxnCxZTTMff3uGF3yQQW36L5Cv2r61Rnm0bky+qV7MnVtLC5jk9SHFdH wjAMYuzJnzAQ+kEdtjnCTz3UAJxtXgsdklti5Qt12E2eqo3AjmGyt4WNkEbiQLdwe0XG 4tPR9f/OODbF3h8jZbotPZaeVR/SbDx35sF+y2pNMeJK5SdESKjWQca7RFNFkjfFWhaD xQxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698279584; x=1698884384; 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=UaLDZUlxbnEBMWQWA0yY43XdPUXdultOeDE7cUVCPGo=; b=sXnGEpd1tI7XleBoRuf+ezTTPY0MQqsOIvJji8eZFLp4hB4xACiT/uKPpB1ddkaXKC l39bwR1v/I+cyxikhxW8JoR0uft0V/NIw/S0yXJkX/6vSnslG5VRGXi9Xl+bZWCD1eZj b3GtxkW+i26HhjOI0YafrAT7UomxRX0aQiCJSi5ab0M40ZGz0Bp89pj8jjlkm67Bh9eE qK06q4TdblXX08SF9c/helQhKBbp/PSpZciejE1HYcFnx3TzDZboygUl2IcUH8D8Hnk0 xWrc+rAYr/uYLDQfBUW3oaoHe+MJUUnizW5k75aVNGdelbHjfmvIPNmplJFUqj8FSmbt b5bA== X-Gm-Message-State: AOJu0YztZoSH1amuuS/8CYjWRbTuiK76UrBk9rQlarWBirbKk9twPMRw JrIOmwftn6sTEteebEwuHfkpuqnqVJLyDCMfTLo= X-Google-Smtp-Source: AGHT+IErRqavVHHCzJ7ih8xrXDD0wAAO4oEzwaXSUu6H9wcuCWfDOU/e3EiSMLeE2mMEGvpTH5FyQQ== X-Received: by 2002:a17:903:32c4:b0:1c7:5776:a30f with SMTP id i4-20020a17090332c400b001c75776a30fmr1373463plr.12.1698279583769; Wed, 25 Oct 2023 17:19:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland Subject: [PULL 43/94] target/sparc: Move POPC to decodetree Date: Wed, 25 Oct 2023 17:14:51 -0700 Message-Id: <20231026001542.1141412-73-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::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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: 1698279902847100001 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 | 3 +++ target/sparc/translate.c | 56 +++++++-------------------------------- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index cb21405e1a..a596b0fc85 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -183,6 +183,9 @@ TSUBcc 10 ..... 100001 ..... . ............. = @r_r_ri_cc1 TADDccTV 10 ..... 100010 ..... . ............. @r_r_ri_cc1 TSUBccTV 10 ..... 100011 ..... . ............. @r_r_ri_cc1 =20 +POPC 10 rd:5 101110 00000 imm:1 rs2_or_imm:s13 \ + &r_r_ri_cc rs1=3D0 cc=3D0 + &shiftr rd rs1 rs2 x:bool @shiftr .. rd:5 ...... rs1:5 . x:1 ....... rs2:5 &shiftr =20 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 10b2d1b578..9122f82844 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -740,6 +740,11 @@ static void gen_op_tsubcctv(TCGv dst, TCGv src1, TCGv = src2) gen_helper_tsubcctv(dst, tcg_env, src1, src2); } =20 +static void gen_op_popc(TCGv dst, TCGv src1, TCGv src2) +{ + tcg_gen_ctpop_tl(dst, src2); +} + // 1 static void gen_op_eval_ba(TCGv dst) { @@ -2733,19 +2738,6 @@ static TCGv get_src1(DisasContext *dc, unsigned int = insn) return gen_load_gpr(dc, rs1); } =20 -static TCGv get_src2(DisasContext *dc, unsigned int insn) -{ - if (IS_IMM) { /* immediate */ - target_long simm =3D GET_FIELDs(insn, 19, 31); - TCGv t =3D tcg_temp_new(); - tcg_gen_movi_tl(t, simm); - return t; - } else { /* register */ - unsigned int rs2 =3D GET_FIELD(insn, 27, 31); - return gen_load_gpr(dc, rs2); - } -} - #ifdef TARGET_SPARC64 static void gen_fmovs(DisasContext *dc, DisasCompare *cmp, int rd, int rs) { @@ -4176,6 +4168,9 @@ TRANS(SDIVX, 64, do_arith, a, -1, gen_op_sdivx, NULL,= NULL) TRANS(UDIV, DIV, do_arith, a, CC_OP_DIV, gen_op_udiv, NULL, gen_op_udivcc) TRANS(SDIV, DIV, do_arith, a, CC_OP_DIV, gen_op_sdiv, NULL, gen_op_sdivcc) =20 +/* TODO: Should have feature bit -- comes in with UltraSparc T2. */ +TRANS(POPC, 64, do_arith, a, -1, gen_op_popc, NULL, NULL) + static bool trans_OR(DisasContext *dc, arg_r_r_ri_cc *a) { /* OR with %g0 is the canonical alias for MOV. */ @@ -4731,40 +4726,7 @@ static void disas_sparc_legacy(DisasContext *dc, uns= igned int insn) goto illegal_insn; } } else if (xop < 0x36) { - if (xop < 0x20) { - goto illegal_insn; - } else { - cpu_src1 =3D get_src1(dc, insn); - cpu_src2 =3D get_src2(dc, insn); - switch (xop) { - case 0x20: /* taddcc */ - case 0x21: /* tsubcc */ - case 0x22: /* taddcctv */ - case 0x23: /* tsubcctv */ - case 0x24: /* mulscc */ - case 0x25: /* sll */ - case 0x26: /* srl */ - case 0x27: /* sra */ - goto illegal_insn; /* in decodetree */ - case 0x30: - goto illegal_insn; /* WRASR in decodetree */ - case 0x32: - goto illegal_insn; /* WRPR in decodetree */ - case 0x33: /* wrtbr, UA2005 wrhpr */ - goto illegal_insn; /* WRTBR, WRHPR in decodetree = */ -#ifdef TARGET_SPARC64 - case 0x2c: /* V9 movcc */ - case 0x2f: /* V9 movr */ - goto illegal_insn; /* in decodetree */ - case 0x2e: /* V9 popc */ - tcg_gen_ctpop_tl(cpu_dst, cpu_src2); - gen_store_gpr(dc, rd, cpu_dst); - break; -#endif - default: - goto illegal_insn; - } - } + goto illegal_insn; /* in decodetree */ } else if (xop =3D=3D 0x36) { /* UltraSparc shutdown, VIS, V8 = CPop1 */ #ifdef TARGET_SPARC64 int opf =3D GET_FIELD_SP(insn, 5, 13); --=20 2.34.1