From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199706152348.BAA22101@nostromo.ens.fr> Date: Mon, 16 Jun 1997 01:48:50 +0200 From: Thomas Pornin Subject: Re: Compiling 64 bit code In-Reply-To: <01BC77F9.83016500@pengwin.qantel.com> In article <01BC77F9.83016500@pengwin.qantel.com> you write: >What I'm looking for is a compiler that will use 64 bit integral promotion >when expressions are evaluated. The Alpha is a native 64 bit machine >and the C language is supposed to have an int size which is optimized >to the target machine so that the most efficient code can be generated. >Unfortunately too much C code has been written which uses 32 bit >int's, so rather that fix the C programs the Alpha compilers were made to >generate extra code which does all of the conversions and testing to make >the int's look like they are 32 bits. I think it is great that a >compatibility mode exists so that older programs can be supported, but >it's not a compatibility mode, IT'S THE ONLY MODE. Actually, I believe using 32 bits operands is better than 64 bits ones on an alpha when only the first 32 bits are used. You may use less opcodes to fill a register, and the memory accesses are faster (as long as the 32 bits words are aligned on doublewords boundaries). Assembly instructions handle well the 32 bits case. 64 bits give you speed only if your calculations really need more than 32 bits; but, in this case, you may just use "long" instead of "int" (this must have been known during the coding, and, as 64 bits portable types are rare in C, it is unlikely that a program from 32 bits architectures may include algorithms for 64 bits variables). That's why trying to replace "int" by "long" may not give, in my opinion, any remarkable speedup. Coding again, with "long" variables, may give the speedup wanted (but portability goes away). --Thomas Pornin -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com