From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from co1outboundpool.messaging.microsoft.com (co1ehsobe004.messaging.microsoft.com [216.32.180.187]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3982A2C0040 for ; Tue, 11 Feb 2014 03:51:09 +1100 (EST) Date: Mon, 10 Feb 2014 10:50:45 -0600 From: James Yang To: Stephen N Chivers Subject: Re: arch/powerpc/math-emu/mtfsf.c - incorrect mask? In-Reply-To: Message-ID: References: <20140206082635.GA7048@visitor2.iram.es> <20140207101036.GA823@visitor2.iram.es> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Cc: James Yang , Chris Proctor , linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sun, 9 Feb 2014, Stephen N Chivers wrote: > James Yang wrote on 02/08/2014 07:49:40 AM: > > > From: James Yang > > To: Gabriel Paubert > > Cc: Stephen N Chivers , Chris Proctor > > , > > Date: 02/08/2014 07:49 AM > > Subject: Re: arch/powerpc/math-emu/mtfsf.c - incorrect mask? > > > > On Fri, 7 Feb 2014, Gabriel Paubert wrote: > > > > > Hi Stephen, > > > > > > On Fri, Feb 07, 2014 at 11:27:57AM +1000, Stephen N Chivers wrote: > > > > Gabriel Paubert wrote on 02/06/2014 07:26:37 PM: > > > > > > > > > From: Gabriel Paubert > > > > > To: Stephen N Chivers > > > > > Cc: linuxppc-dev@lists.ozlabs.org, Chris Proctor > > > > > > Date: 02/06/2014 07:26 PM > > > > > Subject: Re: arch/powerpc/math-emu/mtfsf.c - incorrect mask? > > > > > > > > > > On Thu, Feb 06, 2014 at 12:09:00PM +1000, Stephen N Chivers wrote: > > > > > > With the above mask computation I get consistent results for > > > > > > both the MPC8548 and MPC7410 boards. > > > > > > > > > > > > Am I missing something subtle? > > > > > > > > > > No I think you are correct. This said, this code may probably be > > > > optimized > > > > > to eliminate a lot of the conditional branches. I think that: > > > > > > If the compiler is enabled to generate isel instructions, it would not > > use a conditional branch for this code. (ignore the andi's values, > > this is an old compile) > > > From limited research, the 440GP is a processor > that doesn't implement the isel instruction and it does > not implement floating point. > > The kernel emulates isel and so using that instruction > for the 440GP would have a double trap penalty. Are you writing about something outside the scope of this thread? OP was using MPC8548 not a 440GP. The compiler should not be using or targeting 8548 for a 440GP so having to emulate isel shouldn't be an issue because there wouldn't be any. (The assembly listing I posted was generated by gcc targeting 8548.) Anyway, I had measured the non-isel routines to be faster and that works without illop traps. > Correct me if I am wrong, the isel instruction first appears > in PowerPC ISA v2.04 around mid 2007. isel appeared in 2003 in the e500 (v1) core that is in the MPC8540. The instruction is Power ISA 2.03 (9/2006).