From patchwork Tue Jun 20 16:08:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 9799923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8486960329 for ; Tue, 20 Jun 2017 16:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F69720008 for ; Tue, 20 Jun 2017 16:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72A31201BC; Tue, 20 Jun 2017 16:10:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F18E220008 for ; Tue, 20 Jun 2017 16:10:40 +0000 (UTC) Received: from localhost ([::1]:49636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLjj-0003Ma-UB for patchwork-qemu-devel@patchwork.kernel.org; Tue, 20 Jun 2017 12:10:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNLiK-0002tO-1E for qemu-devel@nongnu.org; Tue, 20 Jun 2017 12:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNLiI-0003ZF-Ap for qemu-devel@nongnu.org; Tue, 20 Jun 2017 12:09:12 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:35731) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNLiI-0003YH-3N for qemu-devel@nongnu.org; Tue, 20 Jun 2017 12:09:10 -0400 Received: by mail-lf0-x242.google.com with SMTP id n136so4201569lfn.2 for ; Tue, 20 Jun 2017 09:09:10 -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=x0nLrMZzuKkExRmzYcRvVDXCJ4soe31qSqfx3yxGEsc=; b=N0V/hGCAoTuWE2swCzJgtV3g4bZWe2UIMiYv2wkH0hKLGM3xbBG4BSExq6/rdmRvGJ tJDdy8f2wgQk8pfE73TxViNYk1SYkVUrsQ0xLxUX4d/TS70vR0RU831v4S9KXn1a5ezo +D3n4zh4SIZLDCvA53i2rGHEUzgOuCprQcjCXx+rSUO6MNy79Ow+IaE0ZAswxjLb7Zu9 HmOUPlpV/l+cmTJYzgBM3Xhmhl6H9XTZm7piE/dGY1eHKZHabYxdq6xFr1QUWq/3W0JC dj5sphBljDUQn41Mv16YMFnolpExMPVBlhzWGqR4x8U1L/vsmcwUkMEeATbTac6otAjA aSng== 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=x0nLrMZzuKkExRmzYcRvVDXCJ4soe31qSqfx3yxGEsc=; b=aZmbcbhvT9j/WHqVqTJAnsAI7P5Khcz5YXR6pHjTM2ieN+RMZYzgQz9qmm+DrYPe4I swFktp5iUICgngoBPbpZ1fpHTkrFzm2R8QL11GKH/XhFrHuZa/w5ftajDBOilSUGGg3A Q5eF/30agEMQA9lGGoeupw/H/EcBGBYBYnmTl8Zfze5hDCoUEmRYY6d51OV9y200K2UZ nyMv8BsVjt7CwT8Htt5gfwVVS6VwFlb8qrB96Ey3r6ty7dNUoe2m3EC2l+rnhibJGSzm z93C2P02do8JsRxodDWC9XxnLXrgyJYQ4q1sxpFyvd0q0dtfpxeaVBKMa7NtUJ5SuOLA KkCg== X-Gm-Message-State: AKS2vOz6HqQI4DmhmuUxsqDYtP8z+aRYUhZl1Z37DNc+ylR4uQU3Xs3z yB6+6ho8Tpv87dL9 X-Received: by 10.46.84.90 with SMTP id y26mr8901387ljd.77.1497974948673; Tue, 20 Jun 2017 09:09:08 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id g65sm3216117lji.37.2017.06.20.09.09.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 09:09:07 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 20 Jun 2017 18:08:59 +0200 Message-Id: <1497974944-27050-3-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497974944-27050-1-git-send-email-edgar.iglesias@gmail.com> References: <1497974944-27050-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 v1 2/7] target-microblaze: dec_barrel: Use extract32 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Use extract32 instead of opencoding the shifting and masking. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4136a8e..e959de7 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -670,8 +670,8 @@ static void dec_barrel(DisasContext *dc) return; } - s = dc->imm & (1 << 10); - t = dc->imm & (1 << 9); + s = extract32(dc->imm, 10, 1); + t = extract32(dc->imm, 9, 1); LOG_DIS("bs%s%s r%d r%d r%d\n", s ? "l" : "r", t ? "a" : "l", dc->rd, dc->ra, dc->rb);