From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1596 invoked by alias); 25 Dec 2014 13:26:47 -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 1574 invoked by uid 89); 25 Dec 2014 13:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: mail-ie0-f173.google.com Received: from mail-ie0-f173.google.com (HELO mail-ie0-f173.google.com) (209.85.223.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 25 Dec 2014 13:26:40 +0000 Received: by mail-ie0-f173.google.com with SMTP id y20so8682129ier.18 for ; Thu, 25 Dec 2014 05:26:38 -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:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=z4TKShryHlEApX52mbj8/Hogg8qloWZgtk9cE518nf0=; b=XIB/fPxHHjU+yMzWGkXtxMCxWqA/Ij7kTJncho5yH0kOkDbu+MwaoU0FVUZS73LWtY 1+53Zn9JoLH7vZOUfnHfBbfuN9e/+3YKSsj/705EtFfWXSIlgGW/x1WL6ngTUbYTM56h x4gCOsHyvlT3KWLCWIeRdPmqzVJcHPfbMriS/Gkx/uaW1f0pPXoW3D6DafgsOAFBhiZr 8//fM8ggo1b3cZjQZ3XG4gz7U+lvobiwyzUQCv812lcka7a8ahqly4XXZ4X1pgQ/S2DS 7a2mVRdGK1qgk0brbe3Z8+8R/1RPQlI2g+8+jfL/mc+zxSANLCoPlaUVJk9xoZOSAZbi BJVw== X-Gm-Message-State: ALoCoQm3DNepzWyZ+LNhl7LLyw02Li27F7I2dqiCZ8toVzaI9TBQW0w4xbpGIaKGnJReNtgdpfo0 X-Received: by 10.107.170.162 with SMTP id g34mr35117359ioj.2.1419513998007; Thu, 25 Dec 2014 05:26:38 -0800 (PST) Received: from localhost (CPE687f74122463-CM84948c2e0610.cpe.net.cable.rogers.com. [99.226.94.59]) by mx.google.com with ESMTPSA id ao5sm9297770igc.3.2014.12.25.05.26.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Dec 2014 05:26:37 -0800 (PST) From: Anthony Green To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [PATCH, moxie, sim] Add mul.x and umul.x instruction support References: <87ioh1890s.fsf@moxielogic.com> <20141224134337.GR12884@adacore.com> Date: Thu, 25 Dec 2014 13:26:00 -0000 In-Reply-To: <20141224134337.GR12884@adacore.com> (Joel Brobecker's message of "Wed, 24 Dec 2014 08:43:37 -0500") Message-ID: <87egrn97xv.fsf@moxielogic.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00628.txt.bz2 Joel Brobecker writes: > Can you add an empty line after the local variable declarations? > This is part of GDB's Coding Standard... Ok, I'm checking in the attached patch. It adds a blank line after every group of local variable declarations. Thanks, AG 2014-12-25 Anthony Green * interp.c (sim_resume): Whitespace changes to align with GDB coding standard. * interp.c (sim_resume): Add mul.x and umul.x instructions. diff --git a/sim/moxie/interp.c b/sim/moxie/interp.c index fdd94af..6a72e41 100644 --- a/sim/moxie/interp.c +++ b/sim/moxie/interp.c @@ -366,6 +366,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 8) & 0xf; unsigned av = cpu.asregs.regs[a]; unsigned v = (inst & 0xff); + TRACE("inc"); cpu.asregs.regs[a] = av + v; } @@ -375,6 +376,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 8) & 0xf; unsigned av = cpu.asregs.regs[a]; unsigned v = (inst & 0xff); + TRACE("dec"); cpu.asregs.regs[a] = av - v; } @@ -383,6 +385,7 @@ sim_resume (sd, step, siggnal) { int a = (inst >> 8) & 0xf; unsigned v = (inst & 0xff); + TRACE("gsr"); cpu.asregs.regs[a] = cpu.asregs.sregs[v]; } @@ -391,6 +394,7 @@ sim_resume (sd, step, siggnal) { int a = (inst >> 8) & 0xf; unsigned v = (inst & 0xff); + TRACE("ssr"); cpu.asregs.sregs[v] = cpu.asregs.regs[a]; } @@ -416,6 +420,7 @@ sim_resume (sd, step, siggnal) case 0x01: /* ldi.l (immediate) */ { int reg = (inst >> 4) & 0xf; + TRACE("ldi.l"); unsigned int val = EXTRACT_WORD(pc+2); cpu.asregs.regs[reg] = val; @@ -426,6 +431,7 @@ sim_resume (sd, step, siggnal) { int dest = (inst >> 4) & 0xf; int src = (inst ) & 0xf; + TRACE("mov"); cpu.asregs.regs[dest] = cpu.asregs.regs[src]; } @@ -434,6 +440,7 @@ sim_resume (sd, step, siggnal) { unsigned int fn = EXTRACT_WORD(pc+2); unsigned int sp = cpu.asregs.regs[1]; + TRACE("jsra"); /* Save a slot for the static chain. */ sp -= 4; @@ -479,6 +486,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; unsigned av = cpu.asregs.regs[a]; unsigned bv = cpu.asregs.regs[b]; + TRACE("add.l"); cpu.asregs.regs[a] = av + bv; } @@ -488,6 +496,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int sp = cpu.asregs.regs[a] - 4; + TRACE("push"); wlat (scpu, opc, sp, cpu.asregs.regs[b]); cpu.asregs.regs[a] = sp; @@ -498,6 +507,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int sp = cpu.asregs.regs[a]; + TRACE("pop"); cpu.asregs.regs[b] = rlat (scpu, opc, sp); cpu.asregs.regs[a] = sp + 4; @@ -507,6 +517,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("lda.l"); cpu.asregs.regs[reg] = rlat (scpu, opc, addr); pc += 4; @@ -516,6 +527,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("sta.l"); wlat (scpu, opc, addr, cpu.asregs.regs[reg]); pc += 4; @@ -526,6 +538,7 @@ sim_resume (sd, step, siggnal) int src = inst & 0xf; int dest = (inst >> 4) & 0xf; int xv; + TRACE("ld.l"); xv = cpu.asregs.regs[src]; cpu.asregs.regs[dest] = rlat (scpu, opc, xv); @@ -535,6 +548,7 @@ sim_resume (sd, step, siggnal) { int dest = (inst >> 4) & 0xf; int val = inst & 0xf; + TRACE("st.l"); wlat (scpu, opc, cpu.asregs.regs[dest], cpu.asregs.regs[val]); } @@ -544,6 +558,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("ldo.l"); addr += cpu.asregs.regs[b]; cpu.asregs.regs[a] = rlat (scpu, opc, addr); @@ -555,6 +570,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("sto.l"); addr += cpu.asregs.regs[a]; wlat (scpu, opc, addr, cpu.asregs.regs[b]); @@ -570,7 +586,6 @@ sim_resume (sd, step, siggnal) int vb = cpu.asregs.regs[b]; TRACE("cmp"); - if (va == vb) cc = CC_EQ; else @@ -591,6 +606,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; signed char bv = cpu.asregs.regs[b]; + TRACE("sex.b"); cpu.asregs.regs[a] = (int) bv; } @@ -600,6 +616,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; signed short bv = cpu.asregs.regs[b]; + TRACE("sex.s"); cpu.asregs.regs[a] = (int) bv; } @@ -609,6 +626,7 @@ sim_resume (sd, step, siggnal) 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; } @@ -618,6 +636,7 @@ sim_resume (sd, step, siggnal) 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; } @@ -628,9 +647,10 @@ sim_resume (sd, step, siggnal) 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; + + TRACE("mul.x"); cpu.asregs.regs[a] = r >> 32; } break; @@ -640,9 +660,10 @@ sim_resume (sd, step, siggnal) 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; + + TRACE("umul.x"); cpu.asregs.regs[a] = r >> 32; } break; @@ -682,6 +703,7 @@ sim_resume (sd, step, siggnal) case 0x1a: /* jmpa */ { unsigned int tgt = EXTRACT_WORD(pc+2); + TRACE("jmpa"); pc = tgt - 2; } @@ -689,8 +711,8 @@ sim_resume (sd, step, siggnal) case 0x1b: /* ldi.b (immediate) */ { int reg = (inst >> 4) & 0xf; - unsigned int val = EXTRACT_WORD(pc+2); + TRACE("ldi.b"); cpu.asregs.regs[reg] = val; pc += 4; @@ -701,6 +723,7 @@ sim_resume (sd, step, siggnal) int src = inst & 0xf; int dest = (inst >> 4) & 0xf; int xv; + TRACE("ld.b"); xv = cpu.asregs.regs[src]; cpu.asregs.regs[dest] = rbat (scpu, opc, xv); @@ -710,6 +733,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("lda.b"); cpu.asregs.regs[reg] = rbat (scpu, opc, addr); pc += 4; @@ -719,6 +743,7 @@ sim_resume (sd, step, siggnal) { int dest = (inst >> 4) & 0xf; int val = inst & 0xf; + TRACE("st.b"); wbat (scpu, opc, cpu.asregs.regs[dest], cpu.asregs.regs[val]); } @@ -727,6 +752,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("sta.b"); wbat (scpu, opc, addr, cpu.asregs.regs[reg]); pc += 4; @@ -737,6 +763,7 @@ sim_resume (sd, step, siggnal) int reg = (inst >> 4) & 0xf; unsigned int val = EXTRACT_WORD(pc+2); + TRACE("ldi.s"); cpu.asregs.regs[reg] = val; pc += 4; @@ -747,6 +774,7 @@ sim_resume (sd, step, siggnal) int src = inst & 0xf; int dest = (inst >> 4) & 0xf; int xv; + TRACE("ld.s"); xv = cpu.asregs.regs[src]; cpu.asregs.regs[dest] = rsat (scpu, opc, xv); @@ -756,6 +784,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("lda.s"); cpu.asregs.regs[reg] = rsat (scpu, opc, addr); pc += 4; @@ -765,6 +794,7 @@ sim_resume (sd, step, siggnal) { int dest = (inst >> 4) & 0xf; int val = inst & 0xf; + TRACE("st.s"); wsat (scpu, opc, cpu.asregs.regs[dest], cpu.asregs.regs[val]); } @@ -773,6 +803,7 @@ sim_resume (sd, step, siggnal) { int reg = (inst >> 4) & 0xf; unsigned int addr = EXTRACT_WORD(pc+2); + TRACE("sta.s"); wsat (scpu, opc, addr, cpu.asregs.regs[reg]); pc += 4; @@ -781,6 +812,7 @@ sim_resume (sd, step, siggnal) case 0x25: /* jmp */ { int reg = (inst >> 4) & 0xf; + TRACE("jmp"); pc = cpu.asregs.regs[reg] - 2; } @@ -790,6 +822,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int av, bv; + TRACE("and"); av = cpu.asregs.regs[a]; bv = cpu.asregs.regs[b]; @@ -802,6 +835,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; int av = cpu.asregs.regs[a]; int bv = cpu.asregs.regs[b]; + TRACE("lshr"); cpu.asregs.regs[a] = (unsigned) ((unsigned) av >> bv); } @@ -812,6 +846,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; int av = cpu.asregs.regs[a]; int bv = cpu.asregs.regs[b]; + TRACE("ashl"); cpu.asregs.regs[a] = av << bv; } @@ -822,6 +857,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; unsigned av = cpu.asregs.regs[a]; unsigned bv = cpu.asregs.regs[b]; + TRACE("sub.l"); cpu.asregs.regs[a] = av - bv; } @@ -831,6 +867,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int bv = cpu.asregs.regs[b]; + TRACE("neg"); cpu.asregs.regs[a] = - bv; } @@ -840,6 +877,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int av, bv; + TRACE("or"); av = cpu.asregs.regs[a]; bv = cpu.asregs.regs[b]; @@ -851,6 +889,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int bv = cpu.asregs.regs[b]; + TRACE("not"); cpu.asregs.regs[a] = 0xffffffff ^ bv; } @@ -861,6 +900,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; int av = cpu.asregs.regs[a]; int bv = cpu.asregs.regs[b]; + TRACE("ashr"); cpu.asregs.regs[a] = av >> bv; } @@ -870,6 +910,7 @@ sim_resume (sd, step, siggnal) int a = (inst >> 4) & 0xf; int b = inst & 0xf; int av, bv; + TRACE("xor"); av = cpu.asregs.regs[a]; bv = cpu.asregs.regs[b]; @@ -882,6 +923,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; unsigned av = cpu.asregs.regs[a]; unsigned bv = cpu.asregs.regs[b]; + TRACE("mul.l"); cpu.asregs.regs[a] = av * bv; } @@ -889,6 +931,7 @@ sim_resume (sd, step, siggnal) case 0x30: /* swi */ { unsigned int inum = EXTRACT_WORD(pc+2); + TRACE("swi"); /* Set the special registers appropriately. */ cpu.asregs.sregs[2] = 3; /* MOXIE_EX_SWI */ @@ -969,6 +1012,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; int av = cpu.asregs.regs[a]; int bv = cpu.asregs.regs[b]; + TRACE("div.l"); cpu.asregs.regs[a] = av / bv; } @@ -979,6 +1023,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; unsigned int av = cpu.asregs.regs[a]; unsigned int bv = cpu.asregs.regs[b]; + TRACE("udiv.l"); cpu.asregs.regs[a] = (av / bv); } @@ -989,6 +1034,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; int av = cpu.asregs.regs[a]; int bv = cpu.asregs.regs[b]; + TRACE("mod.l"); cpu.asregs.regs[a] = av % bv; } @@ -999,6 +1045,7 @@ sim_resume (sd, step, siggnal) int b = inst & 0xf; unsigned int av = cpu.asregs.regs[a]; unsigned int bv = cpu.asregs.regs[b]; + TRACE("umod.l"); cpu.asregs.regs[a] = (av % bv); } @@ -1013,6 +1060,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("ldo.b"); addr += cpu.asregs.regs[b]; cpu.asregs.regs[a] = rbat (scpu, opc, addr); @@ -1024,6 +1072,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("sto.b"); addr += cpu.asregs.regs[a]; wbat (scpu, opc, addr, cpu.asregs.regs[b]); @@ -1035,6 +1084,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("ldo.s"); addr += cpu.asregs.regs[b]; cpu.asregs.regs[a] = rsat (scpu, opc, addr); @@ -1046,6 +1096,7 @@ sim_resume (sd, step, siggnal) unsigned int addr = EXTRACT_WORD(pc+2); int a = (inst >> 4) & 0xf; int b = inst & 0xf; + TRACE("sto.s"); addr += cpu.asregs.regs[a]; wsat (scpu, opc, addr, cpu.asregs.regs[b]);