From patchwork Wed Dec 24 13:36:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Green X-Patchwork-Id: 4420 Received: (qmail 15385 invoked by alias); 24 Dec 2014 13:36:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15372 invoked by uid 89); 24 Dec 2014 13:36:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ig0-f182.google.com Received: from mail-ig0-f182.google.com (HELO mail-ig0-f182.google.com) (209.85.213.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 24 Dec 2014 13:36:23 +0000 Received: by mail-ig0-f182.google.com with SMTP id hn15so6993699igb.9 for ; Wed, 24 Dec 2014 05:36:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=cTFc+3l1b18CBqAZasd1uJMBm4Bd2kJiXM/PecBcibo=; b=A55TehK1C4roxDFCvFHaMre3+niBuGint/ynaGz1LmSXFZ4Xua1VAZNWWIZKRoCNR4 sqSeRvG79QOxUpOAZC05ZA8Y023EQ6f9vdyJQEhNl9cYs9rigWcsjKzl1Tj+189WuUlw 1T1mXM0HxlH3geE8pwNBCjc7VOdXCtOVqzBkVu5UcCnSg6Ugq0NZ7X6cUzAG13CRbL3D zpViLe+nkYLStBsTBDEaeJPVlGC3YXOApYRMqEwFto89o780nmcSQdhcWYmzX1P0eTk5 D61XtaTjpR72N6fZQAJG03V9hitOWN/nfe1utKkEuXViNrD7dxuCil0R4Oi8GXAvuDj1 fDzA== X-Gm-Message-State: ALoCoQnrejl7tDbp+5Joax9YgEPhs5EvUC2DkBkxatHbQYUXqzXurNP8a/eJPXVNvfeKfc2Y35MD X-Received: by 10.107.9.96 with SMTP id j93mr30502942ioi.83.1419428181115; Wed, 24 Dec 2014 05:36:21 -0800 (PST) Received: from localhost (CPE687f74122463-CM84948c2e0610.cpe.net.cable.rogers.com. [99.226.94.59]) by mx.google.com with ESMTPSA id r7sm7788724igg.20.2014.12.24.05.36.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Dec 2014 05:36:20 -0800 (PST) From: Anthony Green To: gdb-patches@sourceware.org Subject: [PATCH, moxie, sim] Add mul.x and umul.x instruction support Date: Wed, 24 Dec 2014 08:36:19 -0500 Message-ID: <87ioh1890s.fsf@moxielogic.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes This patch adds support for the new mul.x and umul.x instructions for the moxie simulator. I'm checking this in. Thanks, AG From sim/moxie/ChangeLog 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; + } + 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; + } + break; case 0x16: /* bad */ case 0x17: /* bad */ case 0x18: /* bad */