From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPNeO-0003BH-V2 for qemu-devel@nongnu.org; Wed, 12 Aug 2015 00:28:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPNeJ-0004KF-Vz for qemu-devel@nongnu.org; Wed, 12 Aug 2015 00:28:28 -0400 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]:35111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPNeJ-0004KB-QV for qemu-devel@nongnu.org; Wed, 12 Aug 2015 00:28:23 -0400 Received: by qkbm65 with SMTP id m65so1897454qkb.2 for ; Tue, 11 Aug 2015 21:28:23 -0700 (PDT) Sender: Richard Henderson References: <1439151229-27747-1-git-send-email-laurent@vivier.eu> <1439151229-27747-8-git-send-email-laurent@vivier.eu> From: Richard Henderson Message-ID: <55CACB63.3000001@twiddle.net> Date: Tue, 11 Aug 2015 21:28:19 -0700 MIME-Version: 1.0 In-Reply-To: <1439151229-27747-8-git-send-email-laurent@vivier.eu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.5 07/30] m68k: allow to update flags with operation on words and bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, Andreas Schwab , gerg@uclinux.org On 08/09/2015 01:13 PM, Laurent Vivier wrote: > @@ -168,46 +209,66 @@ void cpu_m68k_flush_flags(CPUM68KState *env, int cc_op) > case CC_OP_FLAGS: > flags = dest; > break; > + case CC_OP_LOGICB: > + SET_NZ(dest, int8_t); > + goto set_x; > + break; > + case CC_OP_LOGICW: > + SET_NZ(dest, int16_t); > + goto set_x; > + break; > case CC_OP_LOGIC: > - SET_NZ(dest); > + SET_NZ(dest, int32_t); > +set_x: Drop the break after goto. > + if (!m68k_feature(env, M68K_FEATURE_M68000)) { > + /* Unlike m68k, coldfire always clears the overflow bit. */ > + env->cc_x = 0; > + } Err.. that's not the overflow bit. But yes, it's different between CF and m68k. > +#define SET_CC_OP(opsize, op) do { \ > + switch (opsize) { \ > + case OS_BYTE: \ > + s->cc_op = CC_OP_##op##B; break; \ > + case OS_WORD: \ > + s->cc_op = CC_OP_##op##W; break; \ > + case OS_LONG: \ > + s->cc_op = CC_OP_##op; break; \ > + default: \ > + abort(); \ > + } \ > +} while (0) > + If OS_BYTE == 0, then this can just be CC_OP_##op##B + opsize. r~