public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Igor Shevlyakov" <igor@microunity.com>
To: <gcc@gcc.gnu.org>, <gcc-help@gcc.gnu.org>
Subject: Advice needed how to avoid generation of extra sign_extends in .md file
Date: Thu, 03 Oct 2002 18:07:00 -0000	[thread overview]
Message-ID: <002001c26b42$ac2589b0$1e0756c0@medusa> (raw)

Hi everybody,

I wonder if somebody know how to make back-end generate better code
under following conditions:

- 32 bit opearations always sign extend their result into whole 64-bit
result registers.
- conditional branches work only on 64-bit registers
- loads are always sign-extending.

now if we have

int64 a, b;
int32 c, d, f;

c = d + f;
a = b + c;


How to avoid sign_extend before second plus since result of 'addsi3' was
already extended?

Even worse:

int16 *pi, j;
int64 a,b;


j = *pi + 3;
a = b + j;

Doesn't really requires any extensions since *pi already sign extended
target register and we could use same instruction to add 16-bits as for
add 32-bits and result will be 64-bit sign extended in that case.
But I couldn't come up with idea how to teach .md file all that.

Thanks a lot
Igor

             reply	other threads:[~2002-10-04  1:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 18:07 Igor Shevlyakov [this message]
2002-10-03 19:14 ` Richard Henderson
2002-10-04  9:51 ` Jim Wilson

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='002001c26b42$ac2589b0$1e0756c0@medusa' \
    --to=igor@microunity.com \
    --cc=gcc-help@gcc.gnu.org \
    --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).