From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19477 invoked by alias); 24 Dec 2014 13:43:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 19466 invoked by uid 89); 24 Dec 2014 13:43:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 24 Dec 2014 13:43:39 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9791711651C; Wed, 24 Dec 2014 08:43:37 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jLYYIIXUNDeh; Wed, 24 Dec 2014 08:43:37 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7F84011651A; Wed, 24 Dec 2014 08:43:37 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 279ED41013; Wed, 24 Dec 2014 08:43:37 -0500 (EST) Date: Wed, 24 Dec 2014 13:43:00 -0000 From: Joel Brobecker To: Anthony Green Cc: gdb-patches@sourceware.org Subject: Re: [PATCH, moxie, sim] Add mul.x and umul.x instruction support Message-ID: <20141224134337.GR12884@adacore.com> References: <87ioh1890s.fsf@moxielogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ioh1890s.fsf@moxielogic.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-12/txt/msg00623.txt.bz2 > 2014-12-24 Anthony Green > > * interp.c (sim_resume): Add mul.x and umul.x instructions. > > > diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c > index fdb6528..f57d166 100644 > --- a/sim/moxie/interp.c > +++ b/sim/moxie/interp.c > @@ -622,8 +622,30 @@ sim_resume (sd, step, siggnal) > cpu.asregs.regs[a] = (int) bv & 0xffff; > } > break; > - case 0x14: /* bad */ > - case 0x15: /* bad */ > + case 0x14: /* mul.x */ > + { > + int a = (inst >> 4) & 0xf; > + int b = inst & 0xf; > + unsigned av = cpu.asregs.regs[a]; > + unsigned bv = cpu.asregs.regs[b]; > + TRACE("mul.x"); > + signed long long r = > + (signed long long) av * (signed long long) bv; > + cpu.asregs.regs[a] = r >> 32; Can you add an empty line after the local variable declarations? This is part of GDB's Coding Standard... Also, you appear to have some code in between local variable declarations, which is not allowed (non C90, I think). Can you fix? > + } > + break; > + case 0x15: /* umul.x */ > + { > + int a = (inst >> 4) & 0xf; > + int b = inst & 0xf; > + unsigned av = cpu.asregs.regs[a]; > + unsigned bv = cpu.asregs.regs[b]; > + TRACE("umul.x"); > + unsigned long long r = > + (unsigned long long) av * (unsigned long long) bv; > + cpu.asregs.regs[a] = r >> 32; Same here. > + } > + break; > case 0x16: /* bad */ > case 0x17: /* bad */ > case 0x18: /* bad */ Thank you, -- Joel