public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mircea Namolaru <NAMOLARU@il.ibm.com>
To: gcc@gcc.gnu.org
Cc: Leehod Baruch <LEEHOD@il.ibm.com>
Subject: Exploiting dual mode operation
Date: Wed, 21 Apr 2004 14:33:00 -0000	[thread overview]
Message-ID: <OF9BC33E09.1AB65B8C-ONC2256E7D.003AEFE2-42256E7D.00507B40@il.ibm.com> (raw)

Hello,

For a 64-bit architecture, values defined as 32-bit values in a program 
must
be sign extended (or zero extended, in the case of unsigned values) to 
make 
them 64-bit values.
Some 64-bit architectures support certain operations in both 64-bit and 
32-bit form.
We are working on an optimization for eliminating redundant sign extension
instructions by making use of this duality. Currently this is done only in 
very 
simple cases.

For example in the following code there are explicit sign extension
instructions that could be eliminated :

i2 = extsw i1      //  i1, j1 are 32-bit integers in 64-bits architecture.
j2 = extsw j1
.......
cmpd i2, j2        // This compare is for double word (64-bits).

But, if a half-word compare instruction is available, we could use it and
remove the sign extensions:

cmpw i1, j1        // This compare is for single word (32-bits).

The sign extension instructions are generated after each definition of a
32-bit integer. By examining all the uses of a sign extension instruction
we can decide whether it is redundent or not.

Comments welcome. Thanks,

Leehod and Mircea

             reply	other threads:[~2004-04-21 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-21 14:33 Mircea Namolaru [this message]
2004-04-21 18:42 ` Joern Rennecke
2004-04-22 13:58 Leehod Baruch
2004-04-22 14:59 ` Joern Rennecke
2004-04-26 16:41   ` Mircea Namolaru
2004-04-26 16:57     ` Joern Rennecke
2004-04-29 14:26       ` Mircea Namolaru
2004-06-07 17:17 Mircea Namolaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF9BC33E09.1AB65B8C-ONC2256E7D.003AEFE2-42256E7D.00507B40@il.ibm.com \
    --to=namolaru@il.ibm.com \
    --cc=LEEHOD@il.ibm.com \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).