To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 3598
3597  |  3599
Subject: 
Re: NQC v. LegOS / size
Newsgroups: 
lugnet.robotics
Date: 
Tue, 9 Feb 1999 22:05:15 GMT
Original-From: 
John A. Tamplin <JAT@TRAVELLER.COMspamcake>
Viewed: 
1452 times
  
On Tue, 9 Feb 1999, dave madden wrote:

That's where they would be, if there were any.  I don't think GCC has
code for the helpers; as I recall, it relies on the native C compiler
to produce object files which are archived into libgcc.a.  For
systems where GCC *is* the native compiler, it either has to be able
to "open code" the operations (i.e. express them as raw machine
instructions), or the helpers have to have been provided by some other
means.  (I think the creation of libgcc.a is where some people have
been having trouble building the cross-compiler.)

In most cross-compilers, there is assembly code for those helper
functions.  In EGCS, those are in config/h8300/lib1funcs.asm.

Can your installation of gcc/egcs compile _& LINK_ this program:

int main( )
{
extern int x;
extern int y;

return x / y;
}

Mine tries to call a helper function for the divide, and I don't have
it anywhere in the material from EGCS that I was able to build &
install.

It calls __divhi3, which is defined in config/h8300/lib1funcs.asm.  I
built egcs-1.1.1 without any changes (that I remember :), and it put
those in libgcc1.a, which then gets merged into libgcc.a.  In addition
to the 16-bit routines your example uses, it also has 32-bit multiply and
divide functions (__mulsi3, etc).  I don't have it still around, but I am
pretty sure egcs-1.1a also properly handled this.  I have not ever built
gcc 2.8 or egcs-1.1 as a cross compiler for the H8, so if you are using
one of those it may not have the helper functions.

Did you configure it as a cross compiler (setting --target h8300-hitachi-hms
and --host to whatever your host platform is)?

John A. Tamplin Traveller Information Services
jat@Traveller.COM 2104 West Ferry Way
256/705-7007 - FAX 256/705-7100 Huntsville, AL 35801

--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



Message has 3 Replies:
  Re: NQC v. LegOS / size
 
(...) There are two problems with lib1funcs.asm. First, all the functions are in one .asm file. That means you have the code for all math functions even if you use only one of them. Second, most of the routines are already in ROM, so if you can take (...) (25 years ago, 9-Feb-99, to lugnet.robotics)
  Re: NQC v. LegOS / size
 
=>From: "John A. Tamplin" <jat@Traveller.COM> =>... =>It calls __divhi3, which is defined in config/h8300/lib1funcs.asm. I =>built egcs-1.1.1 without any changes (that I remember :), and it put =>those in libgcc1.a, which then gets merged into (...) (25 years ago, 10-Feb-99, to lugnet.robotics)
  Re: NQC v. LegOS / size
 
Hi John, (...) I'm currently working on compiler details with Chris. He sent me some patches to produce cleaner code for ROM calls (register allocation issues), and after we have consolidated these, there'll be both patches and binary releases for (...) (25 years ago, 10-Feb-99, to lugnet.robotics)

Message is in Reply To:
  Re: NQC v. LegOS / size
 
=>From: "John A. Tamplin" <jat@Traveller.COM> =>... =>On Tue, 9 Feb 1999, dave madden wrote: => =>> Yes, the H8 divide instruction can only do (16 bits)/(8 bits), so GCC =>> calls a helper routine [...] => =>Are you linking libgcc.a? I believe it (...) (25 years ago, 9-Feb-99, to lugnet.robotics)

23 Messages in This Thread:










Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR