From patchwork Fri Dec 12 13:47:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Green X-Patchwork-Id: 4216 Received: (qmail 13017 invoked by alias); 12 Dec 2014 13:47:40 -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 13004 invoked by uid 89); 12 Dec 2014 13:47:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-qc0-f179.google.com Received: from mail-qc0-f179.google.com (HELO mail-qc0-f179.google.com) (209.85.216.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 12 Dec 2014 13:47:38 +0000 Received: by mail-qc0-f179.google.com with SMTP id c9so5417194qcz.24 for ; Fri, 12 Dec 2014 05:47:35 -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=+kGG7a3obSL7/FJjFDr31tsNT4tbnVMm19h7VwdKJCw=; b=Pe9X/eJ7iPo6Svk2smUAS/pdSn9XrNvQwll6DlNbjbimKK9oorvG9yQ68sIl6CuZux 7R+FbH2yCjFMx9TF+N8pIGqyAP8Xew6UwYQhRmAqYnXZWmiZOxpETGjL/VL/fd70aAFu FO6FzY1XDv6pipr2XsJWHVAD7bu0UjLq1IlcgAGAnp7W8qb3DW3gEDiVTxNSoEIxmjwB q+0tqiCPLQhvBQRq+ypcQvd9/vZxuLglnBQEHQHwMoWEEmePXoLz1QLW8O1XMsX/eetb tcZSE1aHJbLvXKe3WOAgy/Bc0Q0ExCvD4yxatrolmKfP6RIXmHfKJWss7SzGUjzBuFXQ /RLA== X-Gm-Message-State: ALoCoQlcYSyOvjgiaVmmFZAgMy55wsMjbI0O4zA+iuR6ToW/giTCajbfBPdF0hGHc2J1m5LQ0Iwm X-Received: by 10.224.14.133 with SMTP id g5mr30830445qaa.81.1418392055802; Fri, 12 Dec 2014 05:47:35 -0800 (PST) Received: from localhost (dbawny17.d.subnet.rcn.com. [206.71.239.16]) by mx.google.com with ESMTPSA id i4sm1343911qas.12.2014.12.12.05.47.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Dec 2014 05:47:35 -0800 (PST) From: Anthony Green To: gdb-patches@sourceware.org Subject: [patch, moxie, committed] Add zex instructions to moxie simulator Date: Fri, 12 Dec 2014 08:47:34 -0500 Message-ID: <87r3w5c749.fsf@moxielogic.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes I've committed the following small patch to add support for the zex instructions to the moxie simulator. GCC and binutils already support these instructions. Thanks, AG in sim/moxie... 2014-12-12 Anthony Green * interp.c (sim_resume): Add zex instructions. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index 4362c66..fdb6528 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -604,8 +604,24 @@ sim_resume (sd, step, siggnal) cpu.asregs.regs[a] = (int) bv; } break; - case 0x12: /* bad */ - case 0x13: /* bad */ + case 0x12: /* zex.b */ + { + int a = (inst >> 4) & 0xf; + int b = inst & 0xf; + signed char bv = cpu.asregs.regs[b]; + TRACE("zex.b"); + cpu.asregs.regs[a] = (int) bv & 0xff; + } + break; + case 0x13: /* zex.s */ + { + int a = (inst >> 4) & 0xf; + int b = inst & 0xf; + signed short bv = cpu.asregs.regs[b]; + TRACE("zex.s"); + cpu.asregs.regs[a] = (int) bv & 0xffff; + } + break; case 0x14: /* bad */ case 0x15: /* bad */ case 0x16: /* bad */