Shop OBEX P1 Docs P2 Docs Learn Events
new gcc and binutils source code — Parallax Forums

new gcc and binutils source code

ersmithersmith Posts: 6,053
edited 2015-03-12 07:35 in Propeller 1
I have some git repos available for more recent versions of gcc and binutils ported to the Propeller. They are at:

https://github.com/totalspectrum/binutils-propeller
https://github.com/totalspectrum/gcc-propeller

There's also a git repo for the Propeller C library at

https://github.com/totalspectrum/proplib

Only source code is provided for now -- these are not stable and tested versions. They (mostly) work for me, but your mileage may vary. (By "mostly" I mean that the C stuff works; libstdc++ has not been ported yet, but as that's too big to be of practical use on the Propeller it's not much of a loss.)

If you want to build these from source, I suggest checking out the PropGCC tree and then replacing the binutils, gcc, and lib directories with the git repositories checked out from above. Eventually I hope to use git submodules to automate all of this.

The gcc (version 5) has support for new ISO C11 and C++14 features. The Propeller environment is largely unchanged from PropGCC, except that the LMM kernel is now overlaid with the bss and heap, which means that we gain back about 1K of effectively usable memory. There are a few minor improvements in floating point performance as well. On the minus side the code generator seems to be slightly worse than the old PropGCC (it hasn't been tuned yet for gcc 5 changes), although again your mileage may vary -- some benchmarks perform a bit better, some perform a bit worse.

Eric

Comments

  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-12 06:29
    Thanks Eric. I'll try to build this over the weekend.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-12 06:40
    ersmith wrote: »
    The Propeller environment is largely unchanged from PropGCC, except that the LMM kernel is now overlaid with the bss and heap, which means that we gain back about 1K of effectively usable memory.
    So this version does not allow starting up additional C cogs, correct?
  • David BetzDavid Betz Posts: 14,516
    edited 2015-03-12 06:47
    Dave Hein wrote: »
    So this version does not allow starting up additional C cogs, correct?
    No, I think it is probably using the new COG cloning code Eric added to the default branch of propgcc a while ago.
  • ersmithersmith Posts: 6,053
    edited 2015-03-12 06:59
    Dave Hein wrote: »
    So this version does not allow starting up additional C cogs, correct?

    No, as David mentioned the cogs can be cloned at run time (the code for the cog is copied out of COG memory back to hub in order to start a new COG). This does require that about 2K of hub memory be free at the time you want to start a new COG.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-03-12 07:08
    It seems like there are two possible ways of cloning a cog. A small loader could be started in the new cog, and the master cog would send an image of it's memory to the new cog. The other way would be to malloc space for the cog image and then free it after the new cog is finished loading. Does it use one of these methods, or is there another way to do that I haven't thought of?

    EDIT: I see that Eric answered my question while I was making my post. Thanks.
  • ersmithersmith Posts: 6,053
    edited 2015-03-12 07:16
    Dave Hein wrote: »
    It seems like there are two possible ways of cloning a cog. A small loader could be started in the new cog, and the master cog would send an image of it's memory to the new cog. The other way would be to malloc space for the cog image and then free it after the new cog is finished loading. Does it use one of these methods, or is there another way to do that I haven't thought of?

    I like your "use a small loader and copy from COG to COG" idea -- it would remove the requirement for a large buffer at run time. Unfortunately it does mean larger changes to the library. We should look at it, though, it would be nice not to have to worry about the 2K buffer at thread startup time.
  • DavidZemonDavidZemon Posts: 2,973
    edited 2015-03-12 07:35
    Congrats on getting this functional! I can't wait to try it at home tonight.
Sign In or Register to comment.