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] Plan9 16bit C compilers
Date: Fri, 15 Feb 2002 12:30:30 +0000	[thread overview]
Message-ID: <20020215122234.D163219A2A@mail.cse.psu.edu> (raw)

we aim to avoid Plan 9 C extensions (indeed any C extensions at all) when
writing code that's intended to work in hosted mode for Inferno (ie, emu).
// as comments tends to slip through from time to time because so many
compilers accept it, but i sort it out when i notice (at least one of the target
platforms won't accept it).

the problem with using Plan 9 (or Inferno) compilers to generate code
for other architectures is that the object code runtime conventions of
the target machines's native compilers are often unattractive.  for instance,
on the SPARC, the plan 9 suite doesn't use register windows; on the powerpc,
i avoided using any of the ABIs because there are several and they all involve
some mess.  sometimes the Inferno/Plan9 suites can do things the other compilers
don't.  for instance, again on the powerpc, i found it effective to set R0 to
0, given that the hardware makes it less than general purpose 1/3 of the time,
and  i saved a few percent in code size as a result.  i also avoided having
all that `module linkage' crud in procedure calls.

as another example, the Plan 9/Inferno suite assumes caller-saves for all
volatile registers on all architectures.  this makes it hard -- not impossible,
but requiring care -- to interact with native compiled code in libraries
in some cases.

on the 386, though, where there are precious few sensible registers
and fewer options for interesting use of the instructions, there probably is
enough compatibility between the object code models that it would be feasible
to generate code for Linux and others.  shared libraries
are a potential complication, i suppose (hello, geoff and boyd).
i thought someone had got the Plan 9 or Inferno compilers cross-compiling
for Linux, though.


             reply	other threads:[~2002-02-15 12:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15 12:30 forsyth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-02-22 16:15 anothy
2002-02-20 10:55 forsyth
     [not found] <miller@hamnavoe.demon.co.uk>
2002-02-18 17:43 ` Richard Miller
2002-02-18 18:14   ` Scott Schwartz
2002-02-18 13:14 forsyth
2002-02-20 10:08 ` Thomas Bushnell, BSG
2002-02-20 17:59   ` Scott Schwartz
2002-02-21  9:40   ` Douglas A. Gwyn
2002-02-21 10:08     ` Boyd Roberts
2002-02-21 18:06     ` Thomas Bushnell, BSG
2002-02-21 22:46       ` George Michaelson
2002-02-22  9:58         ` Thomas Bushnell, BSG
2002-02-22 10:58           ` George Michaelson
2002-02-15 14:08 Fco.J.Ballesteros
2002-02-15 13:59 Russ Cox
2002-02-15 13:57 Russ Cox
2002-02-15 14:02 ` Boyd Roberts
2002-02-18 10:14   ` Douglas A. Gwyn
2002-02-18 11:37     ` Boyd Roberts
2002-02-15 12:14 forsyth
2002-02-15 12:21 ` Boyd Roberts
2002-02-15  9:41 Fco.J.Ballesteros
2002-02-15  9:28 nigel
2002-02-14 16:15 steve.simon
2002-02-15  9:55 ` Douglas A. Gwyn

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=20020215122234.D163219A2A@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).