Mail Archives: djgpp/1998/12/29/11:10:10
From: | Leendert Combee <combeel AT oslo DOT geco-prakla DOT slb DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | gcc as crosscompiler
|
Date: | Tue, 29 Dec 1998 16:45:50 +0100
|
Organization: | Geco-Prakla
|
Lines: | 51
|
Message-ID: | <3688F92E.7F88990@oslo.geco-prakla.slb.com>
|
NNTP-Posting-Host: | sunw220.oslo.geco-prakla.slb.com
|
Mime-Version: | 1.0
|
X-Mailer: | Mozilla 4.04j2 [en] (X11; I; SunOS 5.5.1 sun4u)
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
<HTML>
I use gcc/djgpp all the time, now I need to ask something offtopic
but related to using gcc as
<BR>cross-compiler. I tried to find appropriate resources on the
web/newsgroups to resolve my
<BR>compiling problem but could not find them sofar. Any help will
be much approeciated - otherwise
<BR>please ignore my message below.
<BR>-----------------------------------------------------------
<P> I am using gcc as a cross-compiler for (Hitachi) SH70xx type microcontroller.
(gcc 2.7.2.1)
<BR>(I use unix gcc binaries as well as dos binaries; both were created
by 'Cygnus' for free distribution
<BR>, the dos version is based on the older djgpp version 1.12m4 etc.,
but that's not the issue here - I
<BR>obviously use the latest djgpp for normal compiling etc.)
<BR><B>Problem: I can't get gcc to produce the (SH) MAC.W instruction</B>
(multiply and accumulate).
<BR>Whatever optimisation switches I use (typically gcc -m1 -O2 ....),
it always breaks a loop like
<P> for (i=0; i<n; i++) mac += a[i]*b[i];
<P>up into seperate MOV.W's for a[i] and b[i] and then a MUL(tiply)
and an ADD(ition)... This
<BR>takes a lot of cycles while it can be done with a simple single MAC.W
instruction. Then I tried
<BR>inline assembly or - alternatively - modifying the assembler output.
This is fine, <I>e</I><B>xcept then</B>
<BR><B>gdb (with target sim) chokes on the MAC instruction</B> (SIGSEGV
- it plainly aborts). I am pretty
<BR>sure I have the MAC instruction correct etc., so following this my
conclusion is that :
<P> - either I am missing something fundamental
here,
<BR> - or gcc output for SH processor doesn't know
about the MAC instruction and neither does
<BR> gdb. Strangely, the
assembler does know about (and complains when I do not specify
<BR> the instruction arguments
correctly).
<P> Any SH/gcc programmers out there that can help?! any ideas/help/etc
is *much* appreciated.
<P>-Leendert Combee
<BR> email: combeel AT oslo DOT geco-prakla DOT slb DOT com
<BR>------------------------------------------------------------------</HTML>
- Raw text -