On Wed, May 13, 2020 at 5:04 AM Uros Bizjak <ubiz...@gmail.com> wrote:
>
> On Wed, May 13, 2020 at 1:05 PM Uros Bizjak <ubiz...@gmail.com> wrote:
> >
> > On Tue, May 12, 2020 at 10:07 PM H.J. Lu <hjl.to...@gmail.com> wrote:
> > >
> > > Update STV pass to properly count cost of XMM register push.  In 32-bit
> > > mode, to convert XMM register push in DImode, we do an XMM store in
> > > DImode, followed by 2 memory pushes in SImode, instead of 2 integer
> > > register pushes in SImode.  To convert XM register push in SImode, we
> > > do an XMM register to integer register move in SImode, followed an
> > > integer register push in SImode, instead of an integer register push in
> > > SImode.  In 64-bit mode, we do an XMM register to integer register move
> > > in SImode or DImode, followed an integer register push in SImode or
> > > DImode, instead of an integer register push SImode or DImode.
> > >
> > > Tested on Linux/x86 and Linux/x86-64.
> >
> > I think it is better to implement XMM register pushes, and split them
> > after reload to a sequence of:
> >
> > (set (reg:P SP_REG) (plus:P SP_REG) (const_int -8)))
> > (set (match_dup 0) (match_dup 1))
> >
> > This is definitely better than trips through memory to stack.
>
> Attached (untested patch) allows fake pushes from XMM registers, so
> STV pass can allow pushes.

The problem isn't STV pass.  The IRA pass won't assign hard register for

(insn 28 27 29 3 (set (mem:DI (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
        (reg/v:DI 85 [ target ])) "x.i":19:5 40 {*pushdi2}
     (expr_list:REG_DEAD (reg/v:DI 85 [ target ])
        (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
            (nil))))

and the reload pass turns into

....
(insn 28 27 29 3 (set (mem:DI (pre_dec:SI (reg/f:SI 7 sp)) [2  S8 A64])
        (mem/c:DI (plus:SI (reg/f:SI 7 sp)
                (const_int 16 [0x10])) [8 %sfp+-8 S8 A64])) "x.i":19:5
40 {*pushdi2}
     (expr_list:REG_ARGS_SIZE (const_int 16 [0x10])
        (nil)))

-- 
H.J.

Reply via email to