From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30389 invoked by alias); 30 Jan 2015 19:37:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 30332 invoked by uid 48); 30 Jan 2015 19:36:52 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/53949] [SH] Add support for mac.w / mac.l instructions Date: Fri, 30 Jan 2015 19:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-01/txt/msg03561.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53949 Oleg Endo changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-01-30 Ever confirmed|0 |1 --- Comment #12 from Oleg Endo --- This is an example from Renesas public material regarding the SH-DSP. The example program can utilize either the regular mac.w instruction, or the DSP ISA (found on SH2-DSP, SH3-DSP, SH4AL-DSP). typedef short Fixed; typedef long Lfixed; typedef long Laccum; #define __X #define __Y void func(__X Fixed x[5],Fixed *out, __Y Fixed y[128][5] ) { int i; __Y Fixed *yp=y[0]; __X Fixed *xp=x; Fixed x0,y0; Lfixed m0; Laccum a0; for(i=0;i<128;i++) { a0=0; x0=*xp++; y0=*yp++; m0=x0*y0; x0=*xp++; y0=*yp++; a0+=m0; m0=x0*y0; x0=*xp++; y0=*yp++; a0+=m0; m0=x0*y0; x0=*xp++; y0=*yp++; a0+=m0; m0=x0*y0; x0=*xp++; y0=*yp++; a0+=m0; m0=x0*y0; a0+=m0; *out++=a0; } } which should compile to something like: _func: mov #-128,r1 mov r5,r3 extu.b r1,r1 .L11: clrmac mac.w @r6+,@r4+ dt r1 mac.w @r6+,@r4+ mac.w @r6+,@r4+ mac.w @r6+,@r4+ sts macl,r2 mov.w r2,@r3 bf/s .L11 add #2,r3 rts nop