From patchwork Thu May 3 09:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10377457 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 722F56037D for ; Thu, 3 May 2018 09:33:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 706E9288CA for ; Thu, 3 May 2018 09:33:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64E782906E; Thu, 3 May 2018 09:33:49 +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=-3.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, MAILING_LIST_MULTI, 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 E74FA288CA for ; Thu, 3 May 2018 09:33:48 +0000 (UTC) Received: from localhost ([::1]:54906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEAcW-0004rX-33 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 03 May 2018 05:33:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEAP4-00010D-CD for qemu-devel@nongnu.org; Thu, 03 May 2018 05:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEAP3-00056h-Lx for qemu-devel@nongnu.org; Thu, 03 May 2018 05:19:54 -0400 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]:38124) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEAP3-00056Q-DZ for qemu-devel@nongnu.org; Thu, 03 May 2018 05:19:53 -0400 Received: by mail-lf0-x241.google.com with SMTP id z130-v6so24921341lff.5 for ; Thu, 03 May 2018 02:19:53 -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=tT4tlQBk0DcWglB1xGSDcQBqzfIi5cbbQBxiEyo9lY0=; b=h1WCHQpMX1xjfBteIjp7TZS7/D46CfcfQmJpzKH6iliyFpjdrS9YWhT7cRrKsdhRbj VEN53f+pwGEyvC6pZaXdtUI1teAChqYkWKxXGwCOJutn5lIH/Xee5kdKtDxHqGoBetrf DW17GPbYjwBBybe3hg3O8Hb4PT4MwSbBonut7PTZHohjgk8MqbdOoUpnbeietgD7z5N8 fxem8ZaWnq4sQrBXwqHdPlBhX5/AHRlZzNvaBj2AW8dqs/At6+SURdvNlPSRRl300pOc LWFoEw99AVIDGIk4xIJKmF/i1diiD+mOr6b6WCcQpW286H/gFAN1ZFDgQjA5NUGP5mMa inZw== 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=tT4tlQBk0DcWglB1xGSDcQBqzfIi5cbbQBxiEyo9lY0=; b=lFpBIr9CdpJ45uWoOWHLufOre0ZYZA1fC5+UA18l7yEPgo90Its+48HpeKDMxn/y1v xeAXUs8HzYdLtA/R5NRWrQL1ih3VhfEb1FHGkF+QutsZB82RLW0m+mEp/F8OiQCcgFEI wi7DiXNMP99DAFv8dHx25Ejfnaxol8X83Q5/9g7bOOuQRz3Kxyf2Lu8dRY9QOGTyp0UN 2Kpv/it3fa+rBkqRBatos0stIKReEQDt+58gtw1/HvvR3/fUvUZyeAH1Ec/6XXHyH47l HeWEFgyb5xZ9TRGrY97zvSh0u13fT5Zaey+WwnwNGumpDXPISABaVY3dhRs2aF2+vGpG GA6w== X-Gm-Message-State: ALQs6tAWxOrdBxHH6WK2kx+KnPYZ/1LFjGbQo/hWw2fVLdFjRWizv7Xx lkViir12J/gZiTKt3GfcuIlpPg== X-Google-Smtp-Source: AB8JxZocJ943B8JJXUQt6t8WSYp4dMA613Gi51VPu76E44NO+bL+8PQXpFcU0FqXMcmWzdiy6zqIlw== X-Received: by 2002:a2e:9949:: with SMTP id r9-v6mr3384538ljj.53.1525339191912; Thu, 03 May 2018 02:19:51 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id i20-v6sm2002716lfe.69.2018.05.03.02.19.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 02:19:51 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Thu, 3 May 2018 11:19:10 +0200 Message-Id: <20180503091922.28733-18-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180503091922.28733-1-edgar.iglesias@gmail.com> References: <20180503091922.28733-1-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::241 Subject: [Qemu-devel] [PATCH v1 17/29] target-microblaze: dec_msr: Use bool and 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org 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 bool and extract32 to represent the to, clr and clrset flags. No functional change. Signed-off-by: Edgar E. Iglesias Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 3029e0e873..d2788451fe 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -458,17 +458,20 @@ static void dec_msr(DisasContext *dc) { CPUState *cs = CPU(dc->cpu); TCGv_i32 t0, t1; - unsigned int sr, to, rn; + unsigned int sr, rn; + bool to, clrset; - sr = dc->imm & ((1 << 14) - 1); - to = dc->imm & (1 << 14); + sr = extract32(dc->imm, 0, 14); + to = extract32(dc->imm, 14, 1); + clrset = extract32(dc->imm, 15, 1) == 0; dc->type_b = 1; - if (to) + if (to) { dc->cpustate_changed = 1; + } /* msrclr and msrset. */ - if (!(dc->imm & (1 << 15))) { - unsigned int clr = dc->ir & (1 << 16); + if (clrset) { + bool clr = extract32(dc->ir, 16, 1); LOG_DIS("msr%s r%d imm=%x\n", clr ? "clr" : "set", dc->rd, dc->imm);