9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-18 13:14 forsyth
  2002-02-20 10:08 ` Thomas Bushnell, BSG
  0 siblings, 1 reply; 26+ messages in thread
From: forsyth @ 2002-02-18 13:14 UTC (permalink / raw)
  To: 9fans

>>A C implementor might well choose "int" to be 32 bits even
>>on a machine where 64 bits would be more natural, in order
>>to ease importing of code written sloppily on a so-called
>>32-bit platform.

or perhaps just to avoid wasting space on even more zero bits,
especially if there is little or no cost associated with the use of 32
bits instead of 64.


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-22 16:15 anothy
  0 siblings, 0 replies; 26+ messages in thread
From: anothy @ 2002-02-22 16:15 UTC (permalink / raw)
  To: 9fans

// Last I heard a MIPS was a 32 bit processor.  

MIPS produces both 32 and 64 bit processors.

it is true that MIPS sells far more chips for embeded systems
than for desktops/servers. shortly after the MIPS-based Nintendo
64 started shipping, MIPS became the most common 64 or 32 bit
embeded chip (finally dislodging one of the 68K series from the
top spot). i'm not sure if it's still #1.
ア



^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-20 10:55 forsyth
  0 siblings, 0 replies; 26+ messages in thread
From: forsyth @ 2002-02-20 10:55 UTC (permalink / raw)
  To: 9fans

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

yes, but perhaps i'd like to put the extra memory to more constructive use if i've
got a lot of it.  perhaps i'd even like to buy less of it anyway so i
can put the money to better use elsewhere.


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

To: 9fans@cse.psu.edu
Subject: Re: [9fans] Plan9 16bit C compilers
Date: Wed, 20 Feb 2002 10:08:47 GMT
Message-ID: <87zo24ln69.fsf@becket.becket.net>

forsyth@caldo.demon.co.uk writes:

> or perhaps just to avoid wasting space on even more zero bits,
> especially if there is little or no cost associated with the use of 32
> bits instead of 64.

Since memory is so expensive these days...

^ permalink raw reply	[flat|nested] 26+ messages in thread
[parent not found: <miller@hamnavoe.demon.co.uk>]
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15 14:08 Fco.J.Ballesteros
  0 siblings, 0 replies; 26+ messages in thread
From: Fco.J.Ballesteros @ 2002-02-15 14:08 UTC (permalink / raw)
  To: rsc, 9fans

Well, this time I don't want a `portable' program, since
some of the Plan 9 C extensions are *really* convenient.
It would be great if you could send me your C translator.


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15 13:59 Russ Cox
  0 siblings, 0 replies; 26+ messages in thread
From: Russ Cox @ 2002-02-15 13:59 UTC (permalink / raw)
  To: 9fans

> Now that we talk about compilers, anyone used 8c to generate
> binaries on Linux? I saw that emu is compiled using `cc' and not 8c. 
> My actual question is: anyone used Plan 9 C extensions on programs that
> must run on Linux (eg emu)?

I got 8c/8l to generate a Linux 'hello world' program and then stopped.
vc/vl have been used to generate Irix binaries for a while.
I also have a basic C translator, from Plan 9 C to ANSI C.
All of these seem not quite reasonable.  If you want portable
programs, better to write portable code.

Russ


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15 13:57 Russ Cox
  2002-02-15 14:02 ` Boyd Roberts
  0 siblings, 1 reply; 26+ messages in thread
From: Russ Cox @ 2002-02-15 13:57 UTC (permalink / raw)
  To: 9fans

> Or at least I *hope* the Plan9 coders used
> long instead of int when they needed more than 16 bits, something
> that has been standard practice since about 1977.

There's a difference between long and int?!?!?!?



^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15 12:30 forsyth
  0 siblings, 0 replies; 26+ messages in thread
From: forsyth @ 2002-02-15 12:30 UTC (permalink / raw)
  To: 9fans

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.


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15 12:14 forsyth
  2002-02-15 12:21 ` Boyd Roberts
  0 siblings, 1 reply; 26+ messages in thread
From: forsyth @ 2002-02-15 12:14 UTC (permalink / raw)
  To: 9fans

>>will run slower.)  Or at least I *hope* the Plan9 coders used
>>long instead of int when they needed more than 16 bits, something
>>that has been standard practice since about 1977.

it started out that way in Plan 9, but my impression is that people
don't bother as much any more.  a few things can change in 25 years.

i thought steve simon was asking about using a port of the C compiler as
a cross-compiler.    it might well be feasible.   the compiler distinguishes
short, int and long (and others such as vlong) internally, allowing them
different sizes.  (at one time, it sometimes blurred int and long when type checking
but that was changed some time ago.)



^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15  9:41 Fco.J.Ballesteros
  0 siblings, 0 replies; 26+ messages in thread
From: Fco.J.Ballesteros @ 2002-02-15  9:41 UTC (permalink / raw)
  To: 9fans

Now that we talk about compilers, anyone used 8c to generate
binaries on Linux? I saw that emu is compiled using `cc' and not 8c. 
My actual question is: anyone used Plan 9 C extensions on programs that
must run on Linux (eg emu)?

thanks


^ permalink raw reply	[flat|nested] 26+ messages in thread
* Re: [9fans] Plan9 16bit C compilers
@ 2002-02-15  9:28 nigel
  0 siblings, 0 replies; 26+ messages in thread
From: nigel @ 2002-02-15  9:28 UTC (permalink / raw)
  To: 9fans

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

Not that there is an 80c165 compiler for Inferno or Plan9, but I
have to say that Inferno would be a much better prospect on
that hardware.


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

From: steve.simon@snellwilcox.com
To: 9fans@cse.psu.edu
Subject: [9fans] Plan9 16bit C compilers
Date: Thu, 14 Feb 2002 16:15:02 +0000
Message-ID: <1463098921@snellwilcox.com>

Hi,

Are there any 16bit ports of the plan9 C compiler?

We do embedded software using the Siemens / Infineon 80C165
CPU (Big brother of the 8051) and would love to use Plan9 as the main
development platform.

I know the plan9 compiler has been designed to be portable but has
anyone tried to port it to a 16 bit CPU?
Does anyone have opinions on how difficult it might be?

I guess I am just dreaming... but maybe one day, when I have time...

-Steve


----------------------------------------------------------------------
The contents of this communication are confidential to the normal user of
the email address to which it was sent.  If you have received this email
in error, any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.  If this is the case, please notify the
sender and delete this message.
---------------------------------------------------------------------- 

^ permalink raw reply	[flat|nested] 26+ messages in thread
* [9fans] Plan9 16bit C compilers
@ 2002-02-14 16:15 steve.simon
  2002-02-15  9:55 ` Douglas A. Gwyn
  0 siblings, 1 reply; 26+ messages in thread
From: steve.simon @ 2002-02-14 16:15 UTC (permalink / raw)
  To: 9fans

Hi,

Are there any 16bit ports of the plan9 C compiler?

We do embedded software using the Siemens / Infineon 80C165
CPU (Big brother of the 8051) and would love to use Plan9 as the main
development platform.

I know the plan9 compiler has been designed to be portable but has
anyone tried to port it to a 16 bit CPU?
Does anyone have opinions on how difficult it might be?

I guess I am just dreaming... but maybe one day, when I have time...

-Steve


----------------------------------------------------------------------
The contents of this communication are confidential to the normal user of
the email address to which it was sent.  If you have received this email
in error, any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.  If this is the case, please notify the
sender and delete this message.
---------------------------------------------------------------------- 



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

end of thread, other threads:[~2002-02-22 16:15 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-18 13:14 [9fans] Plan9 16bit C compilers 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
  -- 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-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:30 forsyth
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

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).