[PATCH] rs6000: Support doubleword swaps removal in rot64 load store [PR100085]

Segher Boessenkool segher@kernel.crashing.org
Tue Jun 8 20:11:29 GMT 2021


Hi!

On Fri, Jun 04, 2021 at 09:40:58AM +0800, Xionghu Luo wrote:
> >> Combine still fail to merge the two instructions:
> >>
> >> Trying 6 -> 7:
> >>      6: r120:KF#0=r125:KF#0<-<0x40
> >>        REG_DEAD r125:KF
> >>      7: [sfp:DI+r123:DI]=r120:KF#0<-<0x40
> >>        REG_DEAD r120:KF
> >> Successfully matched this instruction:
> >> (set (mem/c:V1TI (plus:DI (reg/f:DI 110 sfp)
> >>              (reg:DI 123)) [1  S16 A128])
> >>      (subreg:V1TI (reg:KF 125) 0))
> >> rejecting combination of insns 6 and 7
> >> original costs 4 + 4 = 8
> >> replacement cost 12
> > 
> > So what instructions were these?  Why did the store cost 4 but the new
> > one costs 12?

The *vsx_le_perm_store_<mode> instruction has the *preferred*
alternative with cost 12, while the other alternative has cost 8.  Why
is that?  That looks like a bug.
   (set_attr "length" "12,8")

> >> By hacking the vsx_le_perm_store_v1ti INSN_COST from 12 to 8,
> > 
> > It should be the same cost as the other store!
> 
> vsx_le_permute_v1ti's cost is defined to 4 in vsx.md:

Yes.  Why is alternative 0 of *vsx_le_perm_store_<mode> said to have a
length of 3 insns?


Segher


More information about the Gcc-patches mailing list