9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: tlaronde@polynum.com
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: [9fans] Arithmetic on Plan 9
Date: Wed, 25 Jul 2007 17:51:55 +0200	[thread overview]
Message-ID: <20070725155155.GA2324@polynum.com> (raw)

Hello,

I'm working on KerGIS, a BSD licenced revival of CERL GRASS, in order to
make it compile and run on Plan 9 too---at the moment, it compiles and
runs on any POSIX Unix flavour.

Even if a huge amount of work has already been done for cleaning,
reorganizing and extending the original sources, confrontation with Plan
9 shows that it is far from being, if not ideal, even sensible in some
area.

The first step---for Plan 9---will be a compilation using APE, and the
development of a graphical visualization using Plan 9 libdraw.

But I need too, for Plan 9 and others, to isolate correctly arithmetic
operations (I include not only integers but floats too in this
expression) in order to identify correctly the domain of definition of
the algorithms.

AFAIK, ISO C for examples does not mandate anything about integer
overflows (may silently wraps). C99 has added some support for IEEE754,
but the handling of "exceptions"---that may or may not be faults---is
still fuzzy for me.

Calculus is, if I'm not mistaken, a typical "userland" stuff. But it
involves, obviously the machine---MMIX[1] for example has distinct
instructions for not signaling integer arithmetic and signaling i.e.
unsigned integers operations silently wrap while signed overflow---, the
language and the compiler---is C enough to access all the capabilities
of the hardware or is assembly required---, and the operating
system---for the policy on notes.

So some questions (hoping at least some of them make sense):

1) Is there a Plan 9 policy concerning the "notes" (exceptions) on
arithmetic operations, both integer and float?

2) Concerning float, if the FPU is a (from the ISA point of
view) separate entity, are registers put in a known state on process
entry?

3) Is there some high level arithmetic homogeneous behavior between
machines---a IEEE754 behavior even on machines lacking a compliant FPU,
or lacking a FPU?

4) Is there a way, via C, to handle extended precision on IEEE754, or is
assembly required (even if the assembler does not provide directly the
symbolic opcodes, embedding directly the values is possible)?

I just discover libgeometry and arith(2) etc. so I suspect reading these
sources will help.

But if somebody has a résumé or pointers, it will be greatly
appreciated.

TIA,
-- 
Thierry Laronde (Alceste) <tlaronde +AT+ polynum +dot+ com>
                 http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


             reply	other threads:[~2007-07-25 15:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-25 15:51 tlaronde [this message]
2007-07-25 15:57 ` [9fans] " tlaronde
2007-07-25 16:25 ` [9fans] " andrey mirtchovski
2007-07-25 18:22   ` tlaronde
2007-07-25 22:52   ` tlaronde

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=20070725155155.GA2324@polynum.com \
    --to=tlaronde@polynum.com \
    --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).