From patchwork Wed Jun 21 12:59:10 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: 9801793 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 557E46038C for ; Wed, 21 Jun 2017 13:09:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 441042074F for ; Wed, 21 Jun 2017 13:09:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 383622856F; Wed, 21 Jun 2017 13:09:00 +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 BB10B2074F for ; Wed, 21 Jun 2017 13:08:59 +0000 (UTC) Received: from localhost ([::1]:53843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNfNS-0006nQ-MU for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 09:08:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNfEA-0008BZ-Hn for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNfE8-0008TF-U3 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:22 -0400 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:33318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dNfE8-0008Sq-Mp for qemu-devel@nongnu.org; Wed, 21 Jun 2017 08:59:20 -0400 Received: by mail-lf0-x242.google.com with SMTP id u62so20947380lfg.0 for ; Wed, 21 Jun 2017 05:59:20 -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=4R87KcPOoL+7Y2wsdvgPeiuolpWrBD9es4URbgEk13A=; b=qITuyEPwrdK9pPB9t9hoJzXgp503rovCXj7rFCitgMlm2Ylvu3vJVLYlv3wxflnsQO jtW9v8ej+aPhD3EFswko3fwMlZ4PHDxx+u45/d5sWRQt855ZjUKTNR0DHx5uHhpKtYzQ 8tR3qHTPBI2VuOk4P9YJpOjveDieDYi43DVg2eU+WHKzTmYm1PRRBCivJnADlzElx1su HfQiHvJOrrPJSn0skvhxouiDEO1K9W7BA6gYRYk5KMW0mo7poIgLAwOSgifPiVWWrJZb duoVzWuWSQZW39Wet30zF6EE/ulgqrzyBNuAOkiQweazvBINsjsa7tBYUrxwWDAdiCci OAww== 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=4R87KcPOoL+7Y2wsdvgPeiuolpWrBD9es4URbgEk13A=; b=NtT7EEiJDVfIZXzxqkBf8Ivmor/iCWUrRGOXX0U8XzGwUwNXksmSsDPBvGhVTKuV2d PGrRfbb7/d4uKzPDG7lMsdfnNYHNHYB9IxtnBIjMNio0l97dQ6N3Dydkew2fd+YznxqT FpvYQu0LNBx31xRcR/jx6BGNNPkNfnyvKCEvzYRP6XyRYS8L+HfkoVD9Sz/ylbBjO/wQ y98jo/R0fWc3GuMXHQWbywTW3CLQZUM3rCpEV/9+KaiR+e7jQQrw5M8gyJYAwaP2bavl CZ4G7uyxX8lafP8YVfXKDuSQEt/IFVpIlBgmrfIRw4eueCBTrfQIVTQnVntvWxLs9mdq tDvg== X-Gm-Message-State: AKS2vOxKQCuNJPtB+ZgnPs2Zvf51iubQg5+c3S9iGogdtTUly+Pv2wjG 6AzVok/G5bkjG6ZQ X-Received: by 10.46.84.77 with SMTP id y13mr7181049ljd.133.1498049959164; Wed, 21 Jun 2017 05:59:19 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id z70sm4741443lff.66.2017.06.21.05.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 05:59:18 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Wed, 21 Jun 2017 14:59:10 +0200 Message-Id: <1498049955-28646-3-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 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. Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- 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);