From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc8XU-0005ZD-Qd for qemu-devel@nongnu.org; Wed, 16 Sep 2015 04:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zc8XR-00072q-JA for qemu-devel@nongnu.org; Wed, 16 Sep 2015 04:58:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc8XR-00072l-Do for qemu-devel@nongnu.org; Wed, 16 Sep 2015 04:58:01 -0400 References: <1442342713-29497-1-git-send-email-rth@twiddle.net> <1442342713-29497-5-git-send-email-rth@twiddle.net> From: Paolo Bonzini Message-ID: <55F92F15.5020400@redhat.com> Date: Wed, 16 Sep 2015 10:57:57 +0200 MIME-Version: 1.0 In-Reply-To: <1442342713-29497-5-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/8] target-i386: Re-introduce optimal breakpoint removal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: ehabkost@redhat.com On 15/09/2015 20:45, Richard Henderson wrote: > + /* Fold the global and local enable bits together into the > + global fields, then xor to show which registers have > + changed collective enable state. */ > + int mod =3D ((old_dr7 | old_dr7 * 2) ^ (new_dr7 | new_dr7 * 2)= ) & 0xff; The AND is not needed at all but, if you add it, you might as well use "& 0xaa" which is clearer. But even better, just do: target_ulong old_dr7 =3D env->dr[7]; int mod =3D old_dr7 ^ new_dr7; ... if ((mod & ~0xff) =3D=3D 0) { and test with if (mod & (3 << i * 2)) inside the loop. Otherwise looks good, I'll write a kvm-unit-tests patch for this. Paolo