9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Rick Hohensee <humbubba@smarty.smart.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] partial-Plan9ification question
Date: Thu, 12 Jul 2001 21:55:21 -0400	[thread overview]
Message-ID: <200107130155.VAA26822@smarty.smart.net> (raw)
In-Reply-To: <07b001c10b20$8bbe7b60$c0b7c6d4@SOMA> from "Boyd Roberts" at Jul 13, 2001 12:18:14 AM

>
> From: "Rick Hohensee" <humbubba@smarty.smart.net>
> >  Given a POSIXy unix, with lots of inline assembly interlaced in the C
> > with Gcc asm(""), consider losing all the asm("") in lieu of C-called
> > assembly and inlined C.
>
> asm's?  who in their right mind uses those?  PUSy unix...

The very insanest. Talented kids.

>
> > This presents a factoring problem for header files
> > and so on relative to unix. Given also that Plan 9's header structure is
> > the best for languages like C, and given that we want that Plan9ism, but
> > not the cross-compile facilities any time soon, how would you restructure
> > the sources?
>
> that is an oxymoron.

OK, header files structure like Plan 9 without the cross-compiler
capabilities is the oxymoron. So what's left? What's the Plan 9
subset? What's Plan 9 for a one-cpu world? That's what I want. I'm not
Bell Labs.

>
> > (I'll be presuming my whole world is one cpu.)
>
> very bad choice.  one of the big features of plan 9 is the
> cross compiler stuff.  name one unix (or any other) system
> that can do it.  well i'm a huge limbo fan, but that's
> a virtual machine, but so what.
>

I can't name any such unix. I also don't know any unix user off-hand that
has ever cross-compiled anything. It's not something that happens a lot.
The whole joint gets ported by some major effort, and then all the people
on a particular platform install that. Plan 9 heterogeny is great, but
it's way ahead of my needs.

> ever heard the expression?
>
>     all the world's a vax
>

No, I haven't. Ever heard the expression "If you've seen one Forth, you've
seen one Forth."

i.e. I miss your point.

> > I know I'll need a cpu.S, a cpu.o, but then things get variable. I'll
> > also probably be doing ld-related #pragmas, and maybe a mk or a proto-mk
> > in sh, but I don't know that that pertains to the above issue if I just
> > assume one CPU. Care to comment, maestros?
>
> one cpu?  where is the problem?  why not write in in assembler?
>

So the next guy can write it for another arch in finite time.

> take a look at inferno's mash mk.
>

Will do, if public source.

> the only reasons for those hacks and cruft was back when machines
> where big, expensive and slow.  sure an asm("movc3 ...");  may beat
> strcpy but it will _bite_ you when you change compilers
> (register allocation problem) or architectures.

It's biting me between Gcc 2.5 and 3.0, (5 year span?) and is so complex
as to be likely to recur.

>
> like henry spencer once said:
>
>     that little tin god efficiency

It's not even efficiency so much. You can use some obscure deformed
looping construct for some fossil CPU (x86) in linked assembly with a
function call interface that ports reasonably and the hit will not be
noticable if your loops aren't all tiny. For the short ones involving
control registers and other oddities, performance is usually irrelevant.
You're in a trap handler or something. There are exceptions, where you're
gonna pay, but thinking more bottom-up also leads to maximal use of better
methods otherwise available. Inlined C is pretty snappy if you can use it,
and if you have to then you do look for those opportunities.

Speaking of that, what's the calling convention of 8c? Gcc is, I think
caller saves, args are pushed last to first, return value in eax on x86.

Rick Hohensee
		www.clienux.com


  reply	other threads:[~2001-07-13  1:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-12 22:16 Rick Hohensee
2001-07-12 22:18 ` Boyd Roberts
2001-07-13  1:55   ` Rick Hohensee [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-07-13 22:34 David Gordon Hogan
2001-07-13 19:15 David Gordon Hogan
2001-07-13 18:08 brucee
2001-07-13 18:37 ` Rick Hohensee
2001-07-13  6:39 David Gordon Hogan
2001-07-13  6:23 David Gordon Hogan
2001-07-13 18:26 ` Rick Hohensee
2001-07-13  5:53 forsyth
2001-07-13  6:26 ` Mike Haertel
2001-07-12 22:08 David Gordon Hogan
2001-07-13  1:27 ` Rick Hohensee
2001-07-13 14:53 ` Douglas A. Gwyn
2001-07-13 22:18 ` Dan Cross
2001-07-14  1:21   ` Boyd Roberts

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=200107130155.VAA26822@smarty.smart.net \
    --to=humbubba@smarty.smart.net \
    --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).