public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: daniel tian <daniel.xntian@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Address mode offset spill
Date: Fri, 26 Jun 2009 03:34:00 -0000	[thread overview]
Message-ID: <121fadb80906252028s25ac7b7am16d3d0f8490677b9@mail.gmail.com> (raw)
In-Reply-To: <4A43DF1E.80302@redhat.com>

> But not terribly uncommon.
>
> Do you need to synthesize large constants?  ie, what code would you generate
> to load the value 0x12345 into a register?
>
> If you need to synthesize large constants, do you need any additional
> scratch registers, or can you do so using just r0?
>
Only do using R0.  Like the following with loading 0x12345:

MOVI   0x2345  -L           //To load the lower 16bit data
MOVI   0x1       -H          //Load the up 16bit data

The destination register must only be R0 register, which is determined
by the hardware. R0 is also general register which can be used in all
operation instructions like ADD, Subtract, Multiply and LOAD/STORE.

Now my approach is to define the Macro PREFERRED_RELOAD_CLASS(X,
CLASS), and make sure if the X is const int and larger than 512, it
will return the R0_REG register class.
PS: I think that if I don't define the macro LEGITIMIZE_RELOAD_ADDRESS
which will push reload the larger const int, the
PREFERRED_RELOAD_CLASS won't be called. is  it right?


Thanks.
-- 
Best Regards
daniel tian
Mavrix Technology, Inc.
Address:200 Zhangheng Road, #3501, Building 3, Zhangjiang Hi-tech
Park, Shanghai, P.R.China (201204)
Tel:86(21)51095958 - 8125
Fax:86(21)50277658
Email:daniel.tian@mavrixtech.com.cn
www.mavrixtech.com

  reply	other threads:[~2009-06-26  3:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-14 14:33 daniel tian
2009-06-15 11:52 ` Alexandre Oliva
2009-06-15 17:57 ` Ian Lance Taylor
2009-06-15 21:05   ` Jeff Law
2009-06-15 22:12     ` Ian Lance Taylor
2009-06-15 22:14       ` Jeff Law
2009-06-16 10:25         ` daniel tian
2009-06-16 14:04           ` Ian Lance Taylor
2009-06-17  1:38             ` daniel tian
2009-06-17 10:24             ` daniel tian
2009-06-17 13:19               ` Ian Lance Taylor
2009-06-25 20:32                 ` Jeff Law
2009-06-25 20:36           ` Jeff Law
2009-06-26  3:34             ` daniel tian [this message]
2009-07-01  1:44               ` Jeff Law
2009-06-17 10:03     ` daniel tian
2009-06-25 20:17       ` Jeff Law
2009-06-26  6:33         ` daniel tian
2009-07-01  1:45           ` Jeff Law

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=121fadb80906252028s25ac7b7am16d3d0f8490677b9@mail.gmail.com \
    --to=daniel.xntian@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=law@redhat.com \
    /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).