9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] splitting the compiler
@ 2002-02-27 15:32 paurea
  2002-02-28 10:13 ` Thomas Bushnell, BSG
  0 siblings, 1 reply; 9+ messages in thread
From: paurea @ 2002-02-27 15:32 UTC (permalink / raw)
  To: 9fans

As I see it we have three sets of constraints here:
1) - being fast compiling
2) - generating fast code (even if it breaks...? )
3) - being portable

We can make the first and the second not exclusive by having -O flags so
while developing (you want fast compiling and no new bugs generated by the compiler) you don't use 2. The issue here is the 3rd constraint. If you add 
a complex optimizer the code is less portable. 

I think the only way out of that is having two independant compilers
(the may share a lot of codebase) say, 8c and 8co (optimized). The
idea is that 8c compiles 8co, 8c is portable, fast and simple.
8co is slow but generates fast code.

Not that I am writing any compiler, it is just a suggestion. :-)

By the way, I have just recompiled XFree86 tree and it has taken me
three quarters of an hour. That is not the path to follow!!!.
-- 
                 Saludos,
                         Gorka

"Curiosity sKilled the cat"


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-02-27 15:32 [9fans] splitting the compiler paurea
@ 2002-02-28 10:13 ` Thomas Bushnell, BSG
  2002-02-28 16:02   ` ozan s yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Bushnell, BSG @ 2002-02-28 10:13 UTC (permalink / raw)
  To: 9fans

paurea@gsyc.escet.urjc.es writes:

> We can make the first and the second not exclusive by having -O
> flags so while developing (you want fast compiling and no new bugs
> generated by the compiler) you don't use 2. The issue here is the
> 3rd constraint. If you add a complex optimizer the code is less
> portable.

I'm pretty familiar with GCC internals, and it's pretty darn
portable.  But perhaps there's a whole level of portability I'm
missing.  Could someone with familiarity with both compilers (GCC and
8c) say [in some detail] what kind of portability 8c has that GCC
lacks, so I could understand it better.

Thomas


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-02-28 10:13 ` Thomas Bushnell, BSG
@ 2002-02-28 16:02   ` ozan s yigit
  2002-02-28 16:53     ` Thomas Bushnell, BSG
  0 siblings, 1 reply; 9+ messages in thread
From: ozan s yigit @ 2002-02-28 16:02 UTC (permalink / raw)
  To: 9fans

"Thomas Bushnell, BSG" <tb+usenet@becket.net> writes:

> I'm pretty familiar with GCC internals, and it's pretty darn
> portable.  But perhaps there's a whole level of portability I'm
> missing.

original poster meant retargeting (i think). with (say) lcc, all one has
to worry about is a relatively straight-forward code generator. a student
targeted it for ns32000 in about a week. i would expect no more time for
8c, but estimate three to six months for gcc.

oz
-- 
www.cs.yorku.ca/~oz	 | don't count your chickens in glass houses
york u. computer science | until the cows come home. -- david vestal


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-02-28 16:02   ` ozan s yigit
@ 2002-02-28 16:53     ` Thomas Bushnell, BSG
  2002-03-04 10:03       ` ozan s. yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Bushnell, BSG @ 2002-02-28 16:53 UTC (permalink / raw)
  To: 9fans

ozan s yigit <oz@blue.cs.yorku.ca> writes:

> "Thomas Bushnell, BSG" <tb+usenet@becket.net> writes:
> 
> > I'm pretty familiar with GCC internals, and it's pretty darn
> > portable.  But perhaps there's a whole level of portability I'm
> > missing.
> 
> original poster meant retargeting (i think). with (say) lcc, all one has
> to worry about is a relatively straight-forward code generator. a student
> targeted it for ns32000 in about a week. i would expect no more time for
> 8c, but estimate three to six months for gcc.

Hrm, I retargeted GCC (back in the days of version 1) for the old
Clipper chip in about a month.

Thomas


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-02-28 16:53     ` Thomas Bushnell, BSG
@ 2002-03-04 10:03       ` ozan s. yigit
  2002-03-04 17:04         ` Thomas Bushnell, BSG
  0 siblings, 1 reply; 9+ messages in thread
From: ozan s. yigit @ 2002-03-04 10:03 UTC (permalink / raw)
  To: 9fans

Thomas Bushnell:
 
> Hrm, I retargeted GCC (back in the days of version 1) for the old
> Clipper chip in about a month.
> 
> Thomas

is that after you figured out how to use RTL? were you around people who
knew and you could ask? in the version 1 days, adults were reduced to tears
with the fumes coming from RTL :) sometimes free costs so much...

oz
---
a technology is indistinguishable from | electric: oz@cs.yorku.ca
its implementation.   -- Marshall Rose | or ozan.yigit@sun.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-03-04 10:03       ` ozan s. yigit
@ 2002-03-04 17:04         ` Thomas Bushnell, BSG
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Bushnell, BSG @ 2002-03-04 17:04 UTC (permalink / raw)
  To: 9fans

"ozan s. yigit" <oz@cs.yorku.ca> writes:

> is that after you figured out how to use RTL? were you around people who
> knew and you could ask? in the version 1 days, adults were reduced to tears
> with the fumes coming from RTL :) sometimes free costs so much...

No, I just read the internals manual an looked at examples in the code


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
@ 2002-02-28 17:21 forsyth
  0 siblings, 0 replies; 9+ messages in thread
From: forsyth @ 2002-02-28 17:21 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

oh yes, i'd forgotten about the Clipper.
i did Ka Kc and Kl for the Fairchild/Intergraph Clipper chip in a week
(1992/3 Plan 9), but i wasn't working very hard.  the Plan 9 assembler
is nearly always at most an afternoon's effort.  the time for the
compiler varies quite a bit.  the Clipper architecture was
straightforward.  the compiler was easy.
most of the time was spent on the linker.  Kl got to
compensate for all the processor pipeline/scoreboard bugs.  dreadful.
nice architecture but buggy implementation.


[-- Attachment #2: Type: message/rfc822, Size: 2358 bytes --]

To: 9fans@cse.psu.edu
Subject: Re: [9fans] splitting the compiler
Date: Thu, 28 Feb 2002 16:53:08 GMT
Message-ID: <87bse9h7ni.fsf@becket.becket.net>

ozan s yigit <oz@blue.cs.yorku.ca> writes:

> "Thomas Bushnell, BSG" <tb+usenet@becket.net> writes:
> 
> > I'm pretty familiar with GCC internals, and it's pretty darn
> > portable.  But perhaps there's a whole level of portability I'm
> > missing.
> 
> original poster meant retargeting (i think). with (say) lcc, all one has
> to worry about is a relatively straight-forward code generator. a student
> targeted it for ns32000 in about a week. i would expect no more time for
> 8c, but estimate three to six months for gcc.

Hrm, I retargeted GCC (back in the days of version 1) for the old
Clipper chip in about a month.

Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
  2002-02-28  9:04 forsyth
@ 2002-02-28  9:42 ` Matt H
  0 siblings, 0 replies; 9+ messages in thread
From: Matt H @ 2002-02-28  9:42 UTC (permalink / raw)
  To: 9fans


> many (i'd have said nearly all) of the worthwhile fancier global
> optimisations are perfectly portable, however much code they take to
> implement. 

As I said before, all of this concerns me for the future speed
imporvements on the next round of hardware. In the Itanium tech reviews
here :

http://www.extremetech.com/article/0,3396,s=1005&a=22477&app=7&ap=8,00.asp

it mentions :

"Intel's formally stated goal was to shift complexity out of the processor
logic and to the compiler. "

 From what I know of Intel it could well be conciously making this move as
part of it's destructive competitive instincts with regard to both AMD and
other compiler vendors.

This article :
http://www.open-mag.com/754088105111.htm

does a shoot out between Intel's C++ compiler and GCC, reporting that for
the OBLcpu benchmark suite Intel's compiler, on average, produced code
that ran 47% faster than GCC! (and sometimes 100% faster).

Intel's compiler, of course, made full use of SIMD instructions but,
significantly, showed a similar improvement over GCC when targetting
Athlons!

I'm glad 8c compiles quickly. Although I was disappointed the first time I
compiled a kernel. I went to make a cup of tea while it compiled only to
return for my cup and the bugger had already finished!

M


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] splitting the compiler
@ 2002-02-28  9:04 forsyth
  2002-02-28  9:42 ` Matt H
  0 siblings, 1 reply; 9+ messages in thread
From: forsyth @ 2002-02-28  9:04 UTC (permalink / raw)
  To: 9fans

>>We can make the first and the second not exclusive by having -O flags
>>so while developing (you want fast compiling and no new bugs generated
>>by the compiler) you don't use 2.  The issue here is the 3rd
>>constraint.  If you add a complex optimizer the code is less portable.

many (i'd have said nearly all) of the worthwhile fancier global optimisations are
perfectly portable, however much code they take to implement.   indeed, it's often
much easier to do them in a high-level intermediate representation
than a low-level machine-oriented one because there is much more context available.
arguably, some of the fancier optimisations are often compensating for
the low level of the programming language, and it's sometimes much
better to address that directly.   (very high-level languages can pose their
own different problems for compilation, of course.)

furthermore, the least buggy optimising compilers i've used
have had most of the optimiser on by default.  it's the rarely-invoked
things that tend to introduce bugs (in my experience, and that
of Linux, i've observed, with gcc).

as someone observed, for system implementation languages like C--and
come to think of it, it was even true of less system-y FORTRAN and Pascal, certainly
Ada--what the language definition actually guarantees is often a
significant subset of what programmers simply assume they can rely
upon.  readable language definitions that spell out these points
clearly would help, but that often conflicts with the desire for
(notional) precision or flexibility in implementation.  by contrast
with many users of a language, most compiler writers tend to know the
definition fairly well, except perhaps for enormous langauges,
but authors of compilers that are intended to
offer big code improvements (for particular classes of programs) are
even more like shyster lawyers with an eye for the fine print.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-03-04 17:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-27 15:32 [9fans] splitting the compiler paurea
2002-02-28 10:13 ` Thomas Bushnell, BSG
2002-02-28 16:02   ` ozan s yigit
2002-02-28 16:53     ` Thomas Bushnell, BSG
2002-03-04 10:03       ` ozan s. yigit
2002-03-04 17:04         ` Thomas Bushnell, BSG
2002-02-28  9:04 forsyth
2002-02-28  9:42 ` Matt H
2002-02-28 17:21 forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).