public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: "Krzysztof Matula" <K.Matula@adb.pl>
Cc: gcc@gcc.gnu.org, Richard.Earnshaw@arm.com
Subject: Re: porting GCC
Date: Fri, 02 Feb 2001 04:00:00 -0000	[thread overview]
Message-ID: <200102021200.MAA10437@cam-mail2.cambridge.arm.com> (raw)
In-Reply-To: <009601c08d0d$23fc9160$3704a4c3@adb.pl>

> It worked :)

Good.
> But soon I reached another problem...
> 
> I am generating several insn-s inside define_expand. The meaning of the code
> is not exactly the same, as the rtl matched. The problem is that GCC always
> notes the last insn I generate with REG_EQUAL expression, corresponding to
> the ORIGINAL code... I don't know how to avoid this...

Why is this a problem?  Gcc annotates the end of the sequence with a note 
of the equivalent it collapses to.  If you think of (symbol_ref 
("__clz_tab")) as the final address that will be dereferenced then the 
expression

	(unspec [(symbol_ref ("__clz_tab"))] 3)
should be thought of as being equivalent to

	(minus (symbol_ref ("__clz_tab")) (reg:SI base_reg))

[we don't express it this way since then the compiler might try to 
simplify the expression in a way that would be incorrect, but 
mathematically when the base_reg value is added back on we end up with the 
address we really want.]

> 
> (insn 9 8 11 (set (reg:SI 15)
>         (plus:SI (reg:SI 14)
> 
> spec:SI[ 
>                     (symbol_ref/v:SI ("__clz_tab"))
>                 ]  3))) -1 (nil)
>     (nil))
> 
> (insn 11 9 12 (set (reg:SI 16)
>         (mem:SI (reg:SI 9))) -1 (nil)
>     (nil))
> 
> (insn 12 11 14 (set (reg:SI 13)
>         (plus:SI (reg:SI 16)
>             (reg:SI 15))) -1 (nil)
>     (nil))
> 
> (insn 14 12 16 (set (reg:SI 13)
>         (reg:SI 13)) -1 (nil)
>     (expr_list:REG_EQUAL (plus:SI (mem:SI (reg:SI 9))
>             (symbol_ref/v:SI ("__clz_tab")))
>         (nil)))
> 
> KM
> 
> 
> 


  reply	other threads:[~2001-02-02  4:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-01  2:37 Krzysztof Matula
2001-02-01  3:10 ` Richard Earnshaw
2001-02-02  3:43   ` Krzysztof Matula
2001-02-02  4:00     ` Richard Earnshaw [this message]
2001-02-02  6:07       ` Krzysztof Matula
2001-02-02  7:08         ` Richard Earnshaw
2001-02-15  8:41 porting gcc Filippo Basso
2001-02-15  9:50 ` Fergus Henderson
2002-10-22  9:53 Grégoire Dooms
2002-10-22  9:56 ` Grégoire Dooms
2002-10-22 14:40 ` Mike Stump
2002-10-22 14:43 ` Andrew Haley
2002-10-22 15:16   ` Michael Matz
2002-10-22 15:27   ` Svein E. Seldal
2002-10-22 18:02   ` Mike Stump
2002-10-23 10:05     ` Andrew Haley
2002-10-22 15:50 ` Denis Chertykov
2003-08-13 11:15 Porting gcc Petar Penchev
2003-08-13 16:07 ` Ben Elliston
2004-05-21 13:09 Mile Davidovic
2004-05-21 13:43 ` Dave Korn
2004-06-02 16:49 Porting GCC Gyle Yearsley
2004-06-03 15:38 ` Richard Sandiford
2004-06-04 15:24 Gyle Yearsley
2008-03-12  6:11 Porting gcc Schmave
2008-03-12  6:15 ` Ben Elliston
2008-10-20 10:20 porting gcc Aurélien Buhrig
2008-10-20 19:34 ` Ian Lance Taylor

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=200102021200.MAA10437@cam-mail2.cambridge.arm.com \
    --to=rearnsha@arm.com \
    --cc=K.Matula@adb.pl \
    --cc=Richard.Earnshaw@arm.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).