Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!apple!turk From: turk@Apple.COM (Ken "Turk" Turkowski) Newsgroups: comp.lang.c++ Subject: Re: 64 bit architectures and C/C++ Message-ID: <13261@goofy.Apple.COM> Date: 1 May 91 09:21:43 GMT References: <168@shasta.Stanford.EDU> <1991Apr29.050715.22968@ux1.cso.uiuc.edu> Organization: Advanced Technology Graphics, Apple Computer, Cupertino, CA, USA Lines: 32 jac@gandalf.llnl.gov (James A. Crotinger) writes: > Anyone want to comment on experiences with Crays? I believe the C >compilers have sizeof(int) = sizeof(short) = sizeof(long) == 46 or 64 >bits, depending on a compile time flag (Crays can do 46 bit integer >arithmetic using the vectorizing floating point processors, so that is >the default). > Binary communications between Crays and other computers is something >I haven't done, mostly because Cray doesn't support IEEE floating point. Crays are a pain. Structures are padded to 64 bits, so you waste a lot of memory in arrays if your structures only have 16 bits. I thought the number was 48 bits, but you might be right. I seem to recall that logical operations couldn't work with 64 bits, but arithmetic operations could, or vice versa. If you want to write out a number between 8 and 64 bits, you need to break it into bytes. As long as you're doing this, you may as well write the proper endian. It's not too bad to write a cray FP to IEEE converter. One of the basic rules of machine independent I/O, though, is to not write structures out directly, but rather to go through a procedure for each element. Same goes for input. -- Ken Turkowski @ Apple Computer, Inc., Cupertino, CA Internet: turk@apple.com Applelink: TURK UUCP: sun!apple!turk