From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws96Y-00011Q-RO for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws96T-00021p-8M for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:11:38 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:52692 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws96T-00021Y-2f for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:11:33 -0400 References: <1401726122-11132-1-git-send-email-alex.bennee@linaro.org> <1401726122-11132-6-git-send-email-alex.bennee@linaro.org> From: Alex =?utf-8?Q?Benn=C3=A9e?= Message-ID: <8738flrkul.fsf@linaro.org> In-reply-to: Date: Wed, 04 Jun 2014 12:11:36 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RCF PATCH 5/8] arm/nwfps: remove use of cpsr_write() and set flags directly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Edgar Iglesias , Riku Voipio , QEMU Developers , Greg Bellows Peter Maydell writes: > On 2 June 2014 17:21, Alex Bennée wrote: >> This is a pre-cursor to removing the cpsr_write function. >> >> diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h >> index bb9ac65..0dbdf75 100644 >> --- a/linux-user/arm/nwfpe/fpa11.h >> +++ b/linux-user/arm/nwfpe/fpa11.h >> @@ -108,7 +108,10 @@ static inline void writeRegister(unsigned int x, unsigned int y) >> >> static inline void writeConditionCodes(unsigned int x) >> { >> - cpsr_write(user_registers,x,CPSR_NZCV); >> + user_registers->ZF = (~val) & CPSR_Z; >> + user_registers->NF = val; >> + user_registers->CF = (val >> 29) & 1; >> + user_registers->VF = (val << 3) & 0x80000000; >> } >> >> #define ARM_REG_PC 15 > > This seems like it's clearly making things worse. > We definitely don't want to have to have code in > linux-user be aware of the "interesting" definitions > of our ZF/NF/CF/VF fields. You are right. I could make restore_state_from_spsr use a mask like the old cpsr_write did or as the flags are a special case have a flag only setting function for these cases. -- Alex Bennée