Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Thomas Pornin <bip@nostromo.ens.fr>
Subject: Re: Compiling 64 bit code
Date: Mon, 16 Jun 1997 01:48:50 +0200	[thread overview]
Message-ID: <199706152348.BAA22101@nostromo.ens.fr> (raw)
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

       reply	other threads:[~1997-06-15 23:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01BC77F9.83016500@pengwin.qantel.com>
1997-06-15 23:48 ` Thomas Pornin [this message]
1997-06-16  4:23 Compiling 64 bit code Jim Paradis
  -- strict thread matches above, loose matches on Subject: below --
1997-06-14  3:12 Jim Paradis
1997-06-14  2:51 Jim Paradis
     [not found] <9706131527.AA17307@cadosf.hlo.dec.com>
1997-06-13 21:14 ` Ross A. Knepper
1997-06-13 19:58 Kelvin Lunsford
     [not found] <33A0AFE4.3973144C@jrp.tiac.net>
1997-06-13  3:54 ` Michal Jaegermann
1997-06-13  2:26 Jim Paradis
1997-06-12 21:06 Kelvin Lunsford
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox