From patchwork Tue May 29 10:49:50 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: 10434951 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 5B04C602BF for ; Tue, 29 May 2018 10:57:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CAE4286C2 for ; Tue, 29 May 2018 10:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40FB8286C6; Tue, 29 May 2018 10:57:31 +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.8 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 BE1CB286C2 for ; Tue, 29 May 2018 10:57:30 +0000 (UTC) Received: from localhost ([::1]:60119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcJl-000797-Uc for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 May 2018 06:57:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDD-0001WD-JS for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcDC-000416-Nv for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:43 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:39229) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNcDC-00040K-Gd for qemu-devel@nongnu.org; Tue, 29 May 2018 06:50:42 -0400 Received: by mail-wm0-x233.google.com with SMTP id f8-v6so39341022wmc.4 for ; Tue, 29 May 2018 03:50:42 -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=haPNN6ycLEghWOSBgf9fgUxJqsAV1VssmBsi2JT1vUo=; b=CvDhQHmzb6kVRL3JuACjXOtBNBQBub9Kx4V6SX9FgwUNIE+mWKrFSe5jewNvx7bJpv 3FvH4oJIWi2g9V4StE/rsNQS/InkWu46QLQ1GWS8ImjNfZquWYJsxi1cAQG52fq+abKC Ypqinzg223bZqcTcg+UsUWa+jX91DoqQHE8lqvScpE3JjLShAE/joRVYEX6wKmax+rMG 6KJ6t70W9/VpZ2tJyePHKq9hLHXB9Lw3wksxZqmC8G+5kze5Oio+HWWY1PpGRWPmzKOG Q3PYRV2A/EBSePssyV2I91VKhZW2yyr/oOZd7Xj68c8oJHqne95FeTdwipLKzrdO8duV cdgQ== 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=haPNN6ycLEghWOSBgf9fgUxJqsAV1VssmBsi2JT1vUo=; b=k4JzP2BzYfSGEAkYxhuGTBgOGVrDGW+0dhSzD8xKdN73Xkmj9n6k7y1dvu3kolaex6 lZt/hrOP6blYYGSb/dw4yH7nySiSNgGeM+QWXD8x3nzFAI3ynH6uDfExo6jvWnGmUv4r QrgrpGQdMSUd4vQz8Cs7T9HoQQHzlJ0P9Vuyly7jHNKmPRQF/Yv73FKrOskdjSf3NlJy uBRc6EDO8ld10Q4OTMvQFD4O/uFehpuKoZiiRyIWAyPZr+U34lHz6cuKX0co0RIEEvVg MX0Dx93+I/wobin7sSNZ1VETDTs6v6K5Nrnfiy4D616o4k8j4zgjpfr6hvwGef7xnRes EGPA== X-Gm-Message-State: ALKqPwdWCnUyIoWHIhlYFcmYVlA+BJfCO6uEhCM9IlcBRtEjsU86loxP kO93MPx/rwsX38D7MGGlEoHfVQ== X-Google-Smtp-Source: AB8JxZoBjCR2BGcFDsBnXd0EGplEnNOVNNV5IYn9Eec4MNT5y2GaMNe0q07Rvveio5vib1Lqyb5GnQ== X-Received: by 2002:a2e:42d2:: with SMTP id h79-v6mr10769785ljf.26.1527591041118; Tue, 29 May 2018 03:50:41 -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 66-v6sm513563ljz.28.2018.05.29.03.50.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 03:50:40 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 12:49:50 +0200 Message-Id: <20180529105011.1914-18-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180529105011.1914-1-edgar.iglesias@gmail.com> References: <20180529105011.1914-1-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::233 Subject: [Qemu-devel] [PULL v1 17/38] 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 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. Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- 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 d63226db8f..e322c82c06 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);