From nobody Sun Nov 2 07:38:23 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152759149376043.50620503789105; Tue, 29 May 2018 03:58:13 -0700 (PDT) Received: from localhost ([::1]:60119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcKK-000797-Cm for importer@patchew.org; Tue, 29 May 2018 06:58:04 -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) 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) 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) 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+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" 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 =3D CPU(dc->cpu); TCGv_i32 t0, t1; - unsigned int sr, to, rn; + unsigned int sr, rn; + bool to, clrset; =20 - sr =3D dc->imm & ((1 << 14) - 1); - to =3D dc->imm & (1 << 14); + sr =3D extract32(dc->imm, 0, 14); + to =3D extract32(dc->imm, 14, 1); + clrset =3D extract32(dc->imm, 15, 1) =3D=3D 0; dc->type_b =3D 1; - if (to) + if (to) { dc->cpustate_changed =3D 1; + } =20 /* msrclr and msrset. */ - if (!(dc->imm & (1 << 15))) { - unsigned int clr =3D dc->ir & (1 << 16); + if (clrset) { + bool clr =3D extract32(dc->ir, 16, 1); =20 LOG_DIS("msr%s r%d imm=3D%x\n", clr ? "clr" : "set", dc->rd, dc->imm); --=20 2.14.1