https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108016

--- Comment #5 from Alexey Merzlyakov <alexey.merzlyakov at samsung dot com> ---
For "Item3" (extra sign extension): it seem that a slightly more elegant
solution was found - generate sign_extend(plus) + subreg chain during
expand-rtx.

Currently expanding code snippet for umulv<mode>4:

  (insn 9 8 10 (set (reg:SI 141)
        (plus:SI (subreg/s/u:SI (reg/v:DI 139 [ a ]) 0)
            (subreg/s/u:SI (reg/v:DI 140 [ b ]) 0)))
  (insn 10 9 0 (set (reg:DI 143)
        (sign_extend:DI (reg:SI 141)))

... might be replaced to:

  (insn 9 8 10 (set (reg:DI 143)
        (sign_extend:DI (plus:SI (subreg/s/u:SI (reg/v:DI 139 [ a ]) 0)
                (subreg/s/u:SI (reg/v:DI 140 [ b ]) 0))))
  (insn 10 9 0 (set (reg:SI 141)
        (subreg:SI (reg:DI 143) 0))

The point here is that sign_extend(plus(...)) to be emitted as "addw"
instruction while subreg:SI(DI) will be optimized out. Thus, there is no cross
data dependencies between insn 9 and 10, and no "sext.w" in the end.

I've applied the solution locally, and now testing it.
If there no objections on this tune, there is also should be checked other
similar instructions (like "umulv<mode>4", etc...)

Reply via email to