Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ulysses!cjc From: cjc@ulysses.homer.nj.att.com (Chris Calabrese) Newsgroups: comp.lang.c Subject: Re: C compiler with 64-bit ints?? Summary: seems like the compiler would have to be tweeked, but it might be easy in C++ Message-ID: <12376@ulysses.homer.nj.att.com> Date: 9 Nov 89 14:07:56 GMT References: <6405@jpl-devvax.JPL.NASA.GOV> Distribution: usa Organization: AT&T Bell Laboratories, Murray Hill Lines: 37 In article <6405@jpl-devvax.JPL.NASA.GOV>, bruce@pituco.JPL.NASA.GOV (Bruce McLaughlin) writes: > Does anyone know of a C compiler which runs on Sun workstations (68020/30) > running 4.0.3 which supports 64-bit integers in a native-type mode? We have > some users here who would like to use normal math type functions (+-*/) > on 64-bit integers (i.e., nothing fancy like trig) that works FAST. They > have run some preliminary tests using the multiple precision math library > [mp(3X)] and find that it's way too slow. They are trying to port some code > from a Univac computer which supports 64-bit ints. They could write some > specific asm routines and use function calls, but would prefer the code to > look like normal math. (Some people are just picky that way! :-) > > --Bruce McLaughlin > bruce@pituco.jpl.nasa.gov > ...cit-vax!elroy!jpl-devvax!pituco!bruce Hmm, this seems like some thing which be difficult in C because it would require modifying the compiler to use 64 bit ints, and there's no really good hardware support for it anyway. It would also cause problems when linking with modules compiled under the normal compiler (like the shared libraries!) and would break any code which assumes that long==int==32 bits. The problem with the multiple precision library is probably the overhead in making the function calls, etc. This leads me to believe that the way to go is to use C++, which will allow you to define a new data type which has all the normal math operations and expands the code inline, which should be plenty fast if your C compiler generates tight code (gcc would be useful here). I'd ask if anyone cares to comment, but I don't really have to on the net :-). -- Name: Christopher J. Calabrese Brain loaned to: AT&T Bell Laboratories, Murray Hill, NJ att!ulysses!cjc cjc@ulysses.att.com Obligatory Quote: ``Anyone who would tell you that would also try and sell you the Brooklyn Bridge.''