From nobody Mon Feb 9 09:28:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1498051200799849.4291181686203; Wed, 21 Jun 2017 06:20:00 -0700 (PDT) Received: from localhost ([::1]:53922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNfY6-0001t0-Qt for importer@patchew.org; Wed, 21 Jun 2017 09:19:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNfEE-0008Fu-Ne for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNfEE-0008Vv-0Y for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:26 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:33327) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNfED-0008VJ-Ps for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:25 -0400 Received: by mail-lf0-x242.google.com with SMTP id u62so20947942lfg.0 for ; Wed, 21 Jun 2017 05:59:25 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id s203sm3722394lja.65.2017.06.21.05.59.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 05:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QaoFNezuv6RLVhSFTOBn+VUZ/FkMCpnNnON3vh7I4PI=; b=cu8GX7f9H+Gb1/Gz6glNBVgeCl0r7s27NQAs3MoQMcDnaPCiHpwJx9pH1TagqzRbhr x2Yhhviw00vQW4Hp1JOzIW/98JELSguF0W2KMGBrVXpjlUinv7DbOJJ0mizqzFAJ7sO5 uNO1UPT9DVSNZz0j8np4eQklq3XQd0yVeB20u/vKbqlQCNGU4t7YyUNz2+1VqfO4wLSp M/CXQW7yXMpcExr/69fpiiibbTEeUIq1WU1AKpWBqRdEfztwN6NPqdvyOafidHexT8WY AKyHN3ZYK6JRS5nuIomd90etQumBrACCT0J1Ogl1x7MTUOZSCOTQmCWha88e1QnXYD/b hG5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QaoFNezuv6RLVhSFTOBn+VUZ/FkMCpnNnON3vh7I4PI=; b=Mc10r3bKvnw8yrUkBmobliBU/Q3MXfdNvd7LeOizMvIFQCVEs9DKLYufbRKkXbcu2Y qI9utfIM2pzPli0xqgmztCD+PVbSxOEFPivxuVD4CgVuBrE5FAydzI5dhI72WYsNW3n4 lQzF4RUr0yCy65Svf4iCqSeNKO5l4n9JJCxk5TSRcEwNCAHWEx32TQKAFK364T9Dc0dJ vbAuwQ/hKsMDxloMwnKidY4PIJrcDK80AyXX6eJzv7H/5+47KlOaOpzmS/MvTYhDy82C fz1Dj52gsZpeTW2Dte4Me4qZmxQNl31eh6bTCTj2EexvAtx+hYcqZ8Lc7mVULbjBb3nk t35g== X-Gm-Message-State: AKS2vOz7DRjTsKcJ0oIpnR2L1ymScGKqBMKxnybMLfimnQ+y2RJoi/CF GTzY3ShjFXFRWVuo X-Received: by 10.46.88.86 with SMTP id x22mr10096680ljd.106.1498049964246; Wed, 21 Jun 2017 05:59:24 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Wed, 21 Jun 2017 14:59:14 +0200 Message-Id: <1498049955-28646-7-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498049955-28646-1-git-send-email-edgar.iglesias@gmail.com> References: <1498049955-28646-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::242 Subject: [Qemu-devel] [PATCH v2 6/7] target-microblaze: dec_barrel: Add BSIFI X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sai.pavan.boddu@xilinx.com, edgar.iglesias@xilinx.com, alistai@xilinx.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add support for BSIFI. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 3fad13c..cb65d1e 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -661,7 +661,7 @@ static void dec_barrel(DisasContext *dc) { TCGv t0; unsigned int imm_w, imm_s; - bool s, t, e =3D false; + bool s, t, e =3D false, i =3D false; =20 if ((dc->tb_flags & MSR_EE_FLAG) && (dc->cpu->env.pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) @@ -673,6 +673,7 @@ static void dec_barrel(DisasContext *dc) =20 if (dc->type_b) { /* Insert and extract are only available in immediate mode. */ + i =3D extract32(dc->imm, 15, 1); e =3D extract32(dc->imm, 14, 1); } s =3D extract32(dc->imm, 10, 1); @@ -692,6 +693,17 @@ static void dec_barrel(DisasContext *dc) } else { tcg_gen_extract_i32(cpu_R[dc->rd], cpu_R[dc->ra], imm_s, imm_w= ); } + } else if (i) { + int width =3D imm_w - imm_s + 1; + + if (imm_w < imm_s) { + /* These inputs have an undefined behavior. */ + qemu_log_mask(LOG_GUEST_ERROR, "bsifi: Bad input w=3D%d s=3D%d= \n", + imm_w, imm_s); + } else { + tcg_gen_deposit_i32(cpu_R[dc->rd], cpu_R[dc->rd], cpu_R[dc->ra= ], + imm_s, width); + } } else { t0 =3D tcg_temp_new(); =20 --=20 2.7.4