From mboxrd@z Thu Jan 1 00:00:00 1970 From: tlaronde@polynum.com Date: Wed, 25 Jul 2007 17:51:55 +0200 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Message-ID: <20070725155155.GA2324@polynum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Subject: [9fans] Arithmetic on Plan 9 Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: 972c6826-ead2-11e9-9d60-3106f5b1d025 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=E9sum=E9 or pointers, it will be greatly appreciated. TIA, --=20 Thierry Laronde (Alceste) http://www.kergis.com/ Key fingerprint =3D 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C