9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: forsyth@caldo.demon.co.uk
To: 9fans@cse.psu.edu
Subject: Re: [9fans] plan or side effect
Date: Fri,  1 Mar 2002 11:35:39 +0000	[thread overview]
Message-ID: <20020301113801.8833D19995@mail.cse.psu.edu> (raw)

Given the results of (say) that integer benchmark run that
was shown here earlier, my inclination would have been
to compare the object code to find out where and how
the difference arose, rather than speculating that -O999 had
a lot to do with it.  Certainly I've found in the past, especially
with such microbenchmarks, that small things often count
for a lot.  As a simple example, one code generator I wrote
didn't do as well on a particular sequence as another compiler,
even though in some ways the code I generated was better;
it turned out that the difference was whether parts of the
loop were aligned on cache boundaries.   Sometimes particular
instructions or instruction sequences that are logically identical
differ markedly in speed.

As to the repeated assertion that 8c (actually there's a larger family than that)
isn't used because of the licence or the code quality, I can observe
that I do not use 8c to compile hosted Inferno on anything other
than Plan 9, and to my certain knowledge it is for neither reason.
It's simply that [8qk]c does not produce code that is easily compatible
with the hosting system.   Unlike GCC, the compiler does not
produce assembly language that can be assembled by the host assembler.
The compiler is part of a larger suite that includes a linker that is designed
to work with the compiler.  The compiler produces a binary file
but that is not object code, let alone object code in the obscure
Windows and Unix formats.  The linker converts only that binary representation
to an executable format.  You can't link the compiler's output
binary with a host linker.   Conversely, the linker
does not know how to read host object files.   It would be very hard
work to make it do so (in general), especially with ghastly, subtle
instruction encodings as on x86 and 680x0.   It operates with
a binary representation from the compiler that's set at a higher level
than raw machine code with relocation bits.   Indeed, there is
no relocation information in it.   Consequently, the linker cannot
link with the system's existing libraries.

Of course, the linker could take its current input and produce
executable images for the hosting operating system.  This is limiting
unless you've got the source for all the libraries (and they are written
in reasonable C), since you will probably not be able to do graphics
(eg, under Windows).   The linker does this is in a small way
on every platform, where it produces an executable image that
is sufficient disguise for this or that bootstrap program to accept it
(and even that's not easy).

I took a stab at using the suite years ago on AIX and RS6000, partly because
I wanted a platform to test the powerpc compiler suite.   At the time,
there was no documentation  I could find that adequately described
the AIX COFF format and dynamic linking conventions
so that I could generate it.  This is, by the way, often true
on other platforms.  IBM (at the time)
was not particularly helpful; not obstructive, just unhelpful.
I wasted time guessing and finally gave up, wrote a powerpc interpreter,
and used that until my BeBox turned up.
I was able to use AIX as a cross-compiling environment, though,
for another target system,
because the compilers require no special configuration for that:
just compile them on the new host.

Thus, the best reason not to use the Plan9 suite has nothing to do
with licences or code quality: it's that it's typically quite impractical.
If I could use them more generally, I certainly would.



             reply	other threads:[~2002-03-01 11:35 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-01 11:35 forsyth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-08 19:22 forsyth
2002-03-07 13:45 rob pike
2002-03-07 15:47 ` AMSRL-CI-C
2002-03-06 10:24 geoff
2002-03-07  9:56 ` Douglas A. Gwyn
2002-03-05  9:54 Fco.J.Ballesteros
2002-03-06  9:51 ` Thomas Bushnell, BSG
2002-03-06  9:52 ` Douglas A. Gwyn
2002-03-08  9:59   ` ozan s. yigit
2002-02-28 17:41 David Gordon Hogan
2002-03-01 10:02 ` Thomas Bushnell, BSG
2002-03-01 12:07   ` Boyd Roberts
2002-03-04 10:04     ` Thomas Bushnell, BSG
2002-03-04 17:11       ` Sean Quinlan
2002-03-04 18:23       ` ozan s yigit
2002-03-05  9:41         ` Thomas Bushnell, BSG
2002-03-05  9:56           ` Boyd Roberts
2002-03-05  9:43       ` Boyd Roberts
2002-03-08 17:30         ` Thomas Bushnell, BSG
2002-03-08 18:00           ` Dan Cross
2002-03-11 10:04             ` Ralph Corderoy
2002-03-11 10:04             ` Thomas Bushnell, BSG
2002-03-01 11:57 ` Boyd Roberts
2002-02-27 15:08 presotto
2002-02-27 15:27 ` Sean Quinlan
2002-02-28  9:58   ` Thomas Bushnell, BSG
2002-02-28 12:51     ` Ralph Corderoy
2002-02-28 16:57       ` Thomas Bushnell, BSG
2002-02-28 16:01     ` AMSRL-CI-CN
2002-02-28 16:52       ` Thomas Bushnell, BSG

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020301113801.8833D19995@mail.cse.psu.edu \
    --to=forsyth@caldo.demon.co.uk \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).