From: "Ulrich Weigand" <Ulrich.Weigand@de.ibm.com>
To: Alexandre Courbot <Alexandre.Courbot@lifl.fr>
Cc: gcc@gcc.gnu.org
Subject: Re: About EXTRA_ADDRESS_CONSTRAINT
Date: Thu, 22 May 2003 16:43:00 -0000 [thread overview]
Message-ID: <OFCB49638A.B264513A-ONC1256D2E.0058E640@de.ibm.com> (raw)
Alexandre Courbot wrote:
>The insn that is generated by the + operator is of the form:
>
>(set (mem (const (plus (symbol_ref "obj") (const_int x))))
> (plus (mem (symbol_ref "var")) (const_int 2)))
>
>During reloading, I designed my EXTRA_ADDRESS_CONSTRAINT marked constraint to
>detect the destination was a member of a struct, and thus it changed this
>insn into:
>
>(set (reg REG) (plus (mem (symbol_ref "var")) (const_int 2)))
>(set (mem (const (plus (symbol_ref "obj") (const_int x))))
> (reg REG))
But this is a simple reload of the value into a register; you shouldn't
need any of the 'special stuff' for that.
>Which was fine! But unfortunately it seems to be risky :( Using
>EXTRA_MEMORY_CONSTRAINT doesn't do what I need (it stores the address of the
>location to store the result into into the register and do a mem on it -
>which I can't reflect in the generated code)
>
>The pattern that matches this is:
>(set (match_operand 0 "nonimmediate_operand" "=Q")
> (plus (match_operand 1 "general_operand" "Q")
> (match_operand 2 "general_operand" "Q")))
>
>(Q is my "doesn't belong to a structure" constraint)
Simply define 'Q' as a normal EXTRA_CONSTRAINT, and rewrite the pattern as
(set (match_operand 0 "nonimmediate_operand" "=Qr")
(plus (match_operand 1 "general_operand" "Qr")
(match_operand 2 "general_operand" "Qr")))
so that reload will know it can reload into a register in case the 'Q'
doesn't match exactly.
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com
next reply other threads:[~2003-05-22 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-22 16:43 Ulrich Weigand [this message]
2003-05-23 8:57 ` Alexandre Courbot
-- strict thread matches above, loose matches on Subject: below --
2003-05-23 11:31 Ulrich Weigand
2003-05-20 17:39 Ulrich Weigand
2003-05-22 14:02 ` Alexandre Courbot
2003-05-20 16:15 Alexandre Courbot
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=OFCB49638A.B264513A-ONC1256D2E.0058E640@de.ibm.com \
--to=ulrich.weigand@de.ibm.com \
--cc=Alexandre.Courbot@lifl.fr \
--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).