This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] combine.c: Optimize a certain field assignment.

> 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:

(define_insn "*insvsi_internal3"
  [(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[4]) & 31)) >= INTVAL (operands[1])"

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 <>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]