Newsgroups: comp.sys.transputer
From: djb1@ukc.ac.uk (Dave Beckett)
Subject: Re: Transputer 'C' - How do you do 64-bit Math?
Organization: University of Kent at Canterbury
Date: Mon, 25 Jul 94 17:35:06 GMT
Message-ID: <118@nutmeg.ukc.ac.uk>


>>>>> About "Re: Transputer 'C' - How do you do 64-bit Math?", Jim Dixon <jdd@aiki.demon.co.uk> said:
Jim> In article <301f0l$ioo@chaos.wg.com> ambrose@wgt-dev.wg.com "Steve Ambrose" writes:
Steve>  We are using T425 transputers and are keeping some real-time counters
Steve> that will overflow an INT32.  I cannot seem to find anything in the
Steve> documentation that supports 64-bit data integer data types.
Steve> 
Steve> Does anyone know if such types and operations exist?  Should I write the
Steve> routines myself?  Any recommendations would be greatly appreciated.
Steve> 

Jim> The Inmos ANSI C Toolset doesn't support INT64s.  But the Occam
Jim> Toolset does.  If you have it, you might want to use occam routines to
Jim> do your arithmetic.  Or it might be worth while to define a set of
Jim> occam INT64 library functions and disassemble them (using the /ZAS
Jim> switch, as I recall). 

There is no need to disassemble the libraries.  INMOS have been kind enough
to provide the source for the (old) occam toolset libraries, as part of the
source release of the 'oc' compiler.

See the Parallel Computing archive at HENSA/Unix:

	unix.hensa.ac.uk (129.12.43.16)
	/parallel/occam/compilers/inmos/oc/oc-src.tar.gz

and in that file, in the directory src/libs/compiler, there are lots of T2
specific occam files, for things such as (i64add.occ):

	--{{{  INT64ADD -- T2
	INT64 FUNCTION INT64ADD (VAL INT64 A, B)
	.
	.
	.

etc.

(MSDOG compatible files are in the same area if you want to look there)

Jim> When I looked, quite a long time ago, the code
Jim> generated by the occam compiler was a lot better than the code
Jim> generated by the C compiler.

This has always been the case, but probably this will be changing since the
new optimizing compilers both use the same engine, although the occam
compiler can always provide better usage and alias information for it, so
for the cleanest and best code, choose occam.

:-) for the hardened C, C++ and ADA programmers

Dave

