Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Most portable compiler: llvl llc or pcc or gcc rtl?

Reply
Thread Tools

Most portable compiler: llvl llc or pcc or gcc rtl?

 
 
Philipp Klaus Krause
Guest
Posts: n/a
 
      10-11-2012
On 11.10.2012 00:17, David Brown wrote:
> There is, in fact, an open source compiler that is suited to such cpus -
> SDCC. But it is harder to port to new architectures than gcc or llvm,
> and is not renowned for producing top-class code (though it is still
> good enough for many people). It might be the OP's best bet for a PIC16
> compiler, however.


Well, it is improving. For Z80 (and the related Z180, Rabbit 2000/3000,
Rabbit 3000A and LR35902), sdcc mostly seems to able to generate better
code compared to any other compiler except IAR
(https://sourceforge.net/apps/trac/sd...%20code%20size). For the
HC08 and S08 there were substancial improvements recently
(https://sourceforge.net/apps/trac/sd...%20code%20size), but
commercial compilers still generate much more compact code for them. The
pic ports, somewhat popular among users, still need more work though.

Philipp
 
Reply With Quote
 
 
 
 
88888 Dihedral
Guest
Posts: n/a
 
      10-11-2012
Philipp Klaus Krause於 2012年10月11日星期四UTC+8上午10時30分20 寫道:
> On 09.10.2012 21:39, Ir. Hj. Othman bin Hj. Ahmad wrote:
>
>
>
> > My bet is in llc. I shall try to produce a PIC 16 code generator.

>
>
>
> If you just want to have a free C compiler for the PIC 16, I recommend
>
> having a look at sdcc, which has an existing PIC 16 backend. While the
>
> PIC16 backend it is used by some people, it is still considered in
>
> development, and not up to the quality of the other backends, and help
>
> to improve it, fix the bugs it has, etc would most likely be welcome.
>
>
>
> Philipp


Nowadays people are more interested to write programs in c for really cheap
and working DISP/CPU/MCU cores in the embedded systems in the development
stages.

Thus, a c compiler with the assembler support like GCC and PCC are
popular.

But be careful about the license conditions in the commercial usese.

In schools of USA non-commercial projects are charged very very low
or even free in the tools.

I worked out my own assemblers for 2 riscs before.

 
Reply With Quote
 
 
 
 
Les Cargill
Guest
Posts: n/a
 
      10-11-2012
88888 Dihedral wrote:
> Philipp Klaus Krause於 2012年10月11日星期四UTC+8上午10時30分20 寫道:
>> On 09.10.2012 21:39, Ir. Hj. Othman bin Hj. Ahmad wrote:
>>
>>
>>
>>> My bet is in llc. I shall try to produce a PIC 16 code generator.

>>
>>
>>
>> If you just want to have a free C compiler for the PIC 16, I recommend
>>
>> having a look at sdcc, which has an existing PIC 16 backend. While the
>>
>> PIC16 backend it is used by some people, it is still considered in
>>
>> development, and not up to the quality of the other backends, and help
>>
>> to improve it, fix the bugs it has, etc would most likely be welcome.
>>
>>
>>
>> Philipp

>
> Nowadays people are more interested to write programs in c for really cheap
> and working DISP/CPU/MCU cores in the embedded systems in the development
> stages.
>
> Thus, a c compiler with the assembler support like GCC and PCC are
> popular.
>
> But be careful about the license conditions in the commercial usese.
>



So far as I know, there is absolutely no encumbrance on commercial
projects compiled and linked with GCC.

> In schools of USA non-commercial projects are charged very very low
> or even free in the tools.
>
> I worked out my own assemblers for 2 riscs before.
>


--
Les Cargill
 
Reply With Quote
 
Ir. Hj. Othman bin Hj. Ahmad
Guest
Posts: n/a
 
      10-11-2012
On Oct 10, 1:02*am, Walter Banks <(E-Mail Removed)> wrote:
> "Ir. Hj. Othman bin Hj. Ahmad" wrote:
>
> > After reading about The history of Unix, portable c compiler, pcc contributed to the dominance of C over other languages because it is available
> > quickly and cheaply, while maintaining reasonable performance.

>
> > We now have Magnusson's C99 pcc.
> > Can it match the portability of gcc? Gcc's portability could be due to its use of RTL, but its RTL is not accessible, and
> > despite my earlier assumption, RTL is actually of higher level than LLVM IR.

>
> > Llvm IR is accessible, and is compiled by llc compiler. Looking at its source code,
> > it appears to be that of a machine independent code. The machine dependent is not specified by the docs that I had
> > read, unlike pcc, wher machine dependent parts are well identified and described, with lots of papers describing them.

>
> > My bet is in llc. I shall try to produce a PIC 16 code generator.

>
> I have written two PIC 16 C compilers. It is not a trivial undertaking.
>
> Walter Banks
> Byte Craft Limited


Writing is very different from porting.
Porting should be easier.
It also depends on the kind of compilers.
All of them are c99 compatible and growing.
 
Reply With Quote
 
Ir. Hj. Othman bin Hj. Ahmad
Guest
Posts: n/a
 
      10-11-2012
On Oct 10, 2:08*am, jacob navia <(E-Mail Removed)> wrote:
> Le 09/10/12 19:05, Walter Banks a crit :
>
>
>
> > "Ir. Hj. Othman bin Hj. Ahmad" wrote:

>
> >> My bet is in llc. I shall try to produce a PIC 16 code generator.

>
> > I have written two PIC 16 C compilers. It is not a trivial undertaking.

>
> > Walter Banks
> > Byte Craft Limited

>
> You can say that because you know what you are talking about: you have
> written two PIC 16 C compilers.
>
> He hasn't, so he thinks it is easy, just filling in the blanks in some
> portable C compiler.
>
> As if you could translate from a preemptive 32/64 bit architecture to a
> PIC 16 without rewriting everything.


There are examples such as avr and dsps as guides. Lots of
documentations to follow and learn.
To get a good job is equivalent to a MSc thesis, because some of them
did it for their thesis.

However, I am only interested to do the basics, just as limiting the
data types to just a few.
If I can get some form assembler sources, it will be enough.
The first stage is just to compile and generate cross assemblies
first.

I have got a feeling that current compilers are getting portable. They
just need more documentatiions to enable people
to port to many architectures. The techniques can be improved further.
Instead of just for speed, we can optimise for
portablility. Just like the old pcc, and now resurrected.


>
> In general I have found that most open source code compilers are just
> too bulky for small machines, much too full of hidden assumptions for
> cramped environments.


It may be bulky but machines are so fast, they become so
insignificant. We are working with Terabytes now.

>
> Even lcc was too big when I ported it to an analog devices 16 bit DSP,
> and that was a machine that wasn't at all as difficult as the PIC 16!
>
> jacob


 
Reply With Quote
 
Ir. Hj. Othman bin Hj. Ahmad
Guest
Posts: n/a
 
      10-11-2012
On Oct 11, 10:48*am, 88888 Dihedral <(E-Mail Removed)>
wrote:
> Philipp Klaus Krause於 2012年10月11日星期四UTC+8上午10時30分20 寫道:
>
>
>
>
>
>
>
>
>
> > On 09.10.2012 21:39, Ir. Hj. Othman bin Hj. Ahmad wrote:

>
> > > My bet is in llc. I shall try to produce a PIC 16 code generator.

>
> > If you just want to have a free C compiler for the PIC 16, I recommend

>
> > having a look at sdcc, which has an existing PIC 16 backend. While the

>
> > PIC16 backend it is used by some people, it is still considered in

>
> > development, and not up to the quality of the other backends, and help

>
> > to improve it, fix the bugs it has, etc would most likely be welcome.

>
> > Philipp

>
> Nowadays people are more interested to write programs in c for really cheap
> and working DISP/CPU/MCU cores in the embedded systems in the development
> stages.
>
> Thus, a c compiler with the assembler support like GCC and PCC are
> popular.
>
> But be careful about the license conditions in the commercial usese.
>
> In schools of USA non-commercial projects are charged very very low
> or even free in the tools.
>
> I worked out my own assemblers for 2 riscs before.


Assemblers should be easier but C will allow us to write more code.

GCC and PCC appear to be equivalent. LLVM appear to be promising but I
am having problems compiling it.
LLVM is written in C++ but that could contribute to the problems.

LLVM has abandoned PIC support. GCC does not have any at all, only
AVR.
PIC is well supported with free C compilers but they are limited. They
are not even compatible with the latest versions of C.

And yet there are many PIC in the world. They get more and more
powerful while maintaining its price and low power consumption. That
is why I chose the PIC as a starting point. It is accumulator based,
so some techniques for i386 should apply.
 
Reply With Quote
 
Walter Banks
Guest
Posts: n/a
 
      10-11-2012


88888 Dihedral wrote:

> I worked out my own assemblers for 2 riscs before.


Our typical implementation time budget for an 8 bit macro
assembler is 10 man hours, for a C compiler port that
has working code generation within a couple man weeks
and V1.0 release after 10 to 12 man months.

Walter Banks
Byte Craft Limited


 
Reply With Quote
 
Ir. Hj. Othman bin Hj. Ahmad
Guest
Posts: n/a
 
      10-11-2012
On Oct 11, 8:38*pm, Walter Banks <(E-Mail Removed)> wrote:
> 88888 Dihedral wrote:
> > I worked out my own assemblers for 2 riscs before.

>
> Our typical implementation time budget for an 8 bit macro
> assembler is 10 man hours, for a C compiler port that
> has working code generation within a couple man weeks
> and V1.0 release after 10 to 12 man months.
>
> Walter Banks
> Byte Craft Limited

If you're still active, you may compare porting using these 3 portable
but optimising techniques. I bet you can get a workable compiler with
just one man-month. For commercial use, pcc and llvm licensing terms
are preferable, but you may be out of date if you don't sync with the
main developers. Just my guess.

Is there any commercial C compilers that can overcome significantly
gcc? When even apple has gone the gcc approach.
 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      10-11-2012
Le 11/10/12 15:20, Ir. Hj. Othman bin Hj. Ahmad a crit :

> Is there any commercial C compilers that can overcome significantly
> gcc? When even apple has gone the gcc approach.
>


Yes. In general, Microsoft compilers outperform gcc by a wide margin

And Intel's compilers outperform Microsoft's by a wide margin too

 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      10-11-2012
jacob navia wrote:

> Yes. In general, Microsoft compilers outperform gcc by a wide margin
>
> And Intel's compilers outperform Microsoft's by a wide margin too


Your definition of "wide margin" appears to be a bit exaggerated, and also
the "outperform" part. At least according to this:


Impact des compilateurs sur les architectures CPU x86/x64
http://www.hardware.fr/articles/847-...itectures-cpu-
x86-x64.html


The general idea that is conveyed by those benchmarks is that the
performance difference between compilers is only significant in a hand full
of very specific cases where specific code compiled by Intel's compiler is
executed on a specific processor from Intel. Even in those cases, it's
debatable whether these performance differences are meaningful at all.


Rui Maciel
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling pcc in cygwin Ir. Hj. Othman bin Hj. Ahmad C Programming 0 10-11-2012 09:48 AM
NovelSpace Media, LLC announces the launch of their new online bookstore and web portal devoted to developers and programmers. paquejd@gmail.com Java 0 05-13-2006 07:04 PM
Novosoft Inc, Novosoft LLC and Softlogica LLC Morgan Pugh Computer Support 5 04-18-2005 08:31 PM
Blue Digits LLC releases VM Rover - Universal Voicemail Client Blue Digits VOIP 1 03-07-2005 06:09 AM
muti printer use fron one PCc Piemanlager Digital Photography 3 03-02-2005 05:35 AM



Advertisments