This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Use PLUS instead of HIGH/LO_SUM for large constants
- To: law at redhat dot com
- Subject: Re: PATCH: Use PLUS instead of HIGH/LO_SUM for large constants
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Date: Mon, 22 Oct 2001 17:16:37 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org
>
> In message <200110222045.f9MKjk8g025439@hiauly1.hia.nrc.ca>you write:
> > > The one thing that still doesn't make any sense to me is the need for a
> > > HImode addition pattern. Can you figure out why this is needed and expla
> > in
> > > it to me.
> >
> > Here is what happens without the HImode addition pattern:
> Right. But how is this handled in the current code? We certainly
> don't have HImode HIGH/LO_SUM patterns. I suspect we just perform the
Yes, we do. For example,
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
(lo_sum:HI (match_operand:HI 1 "register_operand" "r")
(match_operand 2 "const_int_operand" "")))]
""
"ldo R'%G2(%1),%0"
[(set_attr "type" "move")
(set_attr "length" "4")])
The initial rtl for the HImode load in the little test program is:
(insn 17 15 19 (set (reg:HI 96)
(high:HI (const_int 28275 [0x6e73]))) -1 (nil)
(nil))
(insn 19 17 20 (set (reg:HI 95)
(lo_sum:HI (reg:HI 96)
(const_int 28275 [0x6e73]))) -1 (nil)
(expr_list:REG_EQUAL (const_int 28275 [0x6e73])
(nil)))
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)