Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: "Carl J. Appellof" <cja@zso.dec.com>
Subject: Re: Alpha: sign extend long
Date: 1995/07/24	[thread overview]
Message-ID: <3v0g5o$hl3@ninja.zso.dec.com> (raw)
In-Reply-To: 3usqta$3he@vixen.cso.uiuc.edu


peltz@cerl.uiuc.edu (Steve Peltz) wrote:
>It looks to me as if it would be faster to sign-extend a longword by
>doing a "addl $x, $31, $y" instead of the sequence used in at least
>the "intended sequence for loading and sign-extending a longword from
>unaligned address", which is to do "sll $x, #32, $y", then "sra $y, #32, $y".

The cc compiler on Digital UNIX uses "addl $x, $31, $y" when
you do

    int myint;
    unsigned int myuint;

    myint = (int)myuint;


I've never seen it use sll/sra.

-- 
Carl Appellof
not speaking for
Digital Equipment Corporation





  reply	other threads:[~1995-07-24  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-07-23  4:00 Alpha: sign extend long Steve Peltz
1995-07-24  4:00 ` Carl J. Appellof [this message]
1995-07-25  4:00 ` Peter Sherwood
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