This is the mail archive of the
mailing list for the GCC project.
Re: [patch] combine.c: Optimize a certain field assignment.
- From: Eric Christopher <echristo at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 27 Mar 2004 00:15:47 -0800
- Subject: Re: [patch] combine.c: Optimize a certain field assignment.
- References: <firstname.lastname@example.org>
> The reason is that combine suggests
> (set (zero_extract X CST ...)
> (zero_extract Y CST ...))
> but this form is no longer canonical because of my earlier patch
Hmm? It's not? I thought that patch did something else. This is a
pattern in the rs6000 port ("*insvsi_internal4") that should be able to
trigger. Now, admittedly:
[(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
(match_operand:SI 1 "const_int_operand" "i")
(match_operand:SI 2 "const_int_operand" "i"))
(lshiftrt:SI (match_operand:SI 3 "gpc_reg_operand" "r")
(match_operand:SI 4 "const_int_operand" "i")))]
"(32 - (INTVAL (operands) & 31)) >= INTVAL (operands)"
is also a valid pattern on the powerpc which is what you've changed it
> The patch fixes this problem by converting zero_extract in SET_SRC
> into lshiftrt if the widths of the two extractions match.
It's really a port specific optimization, not a problem. Before you make
the transformation you should probably make sure that you can't
recognize the two zero extracts on the architecture.
At least in my opinion. :)
Eric Christopher <email@example.com>