Received: from eggs.gnu.org ([2001:4830:134:3::10]:38909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsQ73-0001Jv-3G for qemu-devel@nongnu.org; Fri, 07 Oct 2016 04:02:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsQ6y-0006C2-4J for qemu-devel@nongnu.org; Fri, 07 Oct 2016 04:02:37 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:35158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsQ6x-0006BJ-Sw for qemu-devel@nongnu.org; Fri, 07 Oct 2016 04:02:32 -0400 Received: by mail-wm0-x243.google.com with SMTP id f193so1664625wmg.2 for ; Fri, 07 Oct 2016 01:02:31 -0700 (PDT) Sender: Paolo Bonzini References: <1475767463-12045-1-git-send-email-pbonzini@redhat.com> <1475767463-12045-6-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <5b6d2360-d3a3-38fc-98f7-b13bc9bcd44b@redhat.com> Date: Fri, 7 Oct 2016 10:02:28 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/10] qemu-tech: document lazy condition code evaluation in cpu.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On 06/10/2016 20:45, Peter Maydell wrote: > On 6 October 2016 at 16:24, Paolo Bonzini wrote: >> Unlike the other sections, they are pretty specific to a particular CPU. >> >> Signed-off-by: Paolo Bonzini >> --- >> qemu-tech.texi | 25 ------------------------- >> target-cris/cpu.h | 7 +++++++ >> target-i386/cpu.h | 7 +++++++ >> target-m68k/cpu.h | 8 ++++++++ >> target-sparc/cpu.h | 5 +++++ >> 5 files changed, 27 insertions(+), 25 deletions(-) > > target-s390x/ also seems to have the CC optimization... Indeed: diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 4fb34b5..4e58cde 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -671,6 +671,13 @@ ObjectClass *s390_cpu_class_by_name(const char *name); /* CC optimization */ +/* Instead of computing the condition codes after each x86 instruction, + * QEMU just stores the result (called CC_DST), the type of operation + * (called CC_OP) and whatever operands are needed (CC_SRC and possibly + * CC_VR). When the condition codes are needed, the condition codes can + * be calculated using this information. Condition codes are not generated + * if they are only needed for conditional branches. + */ enum cc_op { CC_OP_CONST0 = 0, /* CC is 0 */ CC_OP_CONST1, /* CC is 1 */ Paolo