On Wed, Sep 8, 2021 at 2:55 AM Hongtao Liu via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > On Wed, Sep 8, 2021 at 5:33 PM Jakub Jelinek <ja...@redhat.com> wrote: > > > > On Wed, Sep 08, 2021 at 05:23:40PM +0800, Hongtao Liu wrote: > > > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > > > > > > Patch LGTM. > > > > Thanks, committed. > > > > > PS: > > > I'm curious why we need the post_reload splitter @xorsign<mode>3_1 > > > for scalar mode, can't we just expand them into and/xor operations in > > > the expander, just like vector modes did. > > > Let me do some experiments to see whether it is ok to remove the splitter. > > > > I bet it is the question how should the code look like before RA. > > stv is somewhat related, but as that replaces whole chains, it can do: > > (insn 14 5 6 2 (set (subreg:V2DI (reg:DI 92) 0) > > (vec_concat:V2DI (mem/c:DI (symbol_ref:SI ("c") [flags 0x2] > > <var_decl 0x7f65a131fd80 c>) [1 c+0 S8 A64]) > > (const_int 0 [0]))) "hohohou.c":6:9 -1 > > (nil)) > > on loads of memory. > > But it stv still does use paradoxical subregs: > > (insn 10 16 11 2 (set (subreg:V2DI (reg:DI 91) 0) > > (minus:V2DI (subreg:V2DI (reg:DI 87) 0) > > (subreg:V2DI (reg:DI 94) 0))) "hohohou.c":6:13 5003 {*subv2di3} > > (expr_list:REG_DEAD (reg:DI 87) > > (expr_list:REG_UNUSED (reg:CC 17 flags) > > (nil)))) > > (insn 11 10 0 2 (set (mem/c:DI (symbol_ref:SI ("a") [flags 0x2] <var_decl > > 0x7f65a131fc60 a>) [1 a+0 S8 A64]) > > (reg:DI 91)) "hohohou.c":6:5 76 {*movdi_internal} > > (expr_list:REG_DEAD (reg:DI 91) > > (nil))) > > so perhaps just using paradoxical subregs everywhere would be ok? > Yes, I think so. > And I find paradoxical subreg like (subreg:V4SF (reg:SF)) are not > allowed by validate_subreg until r11-621. > That's why post_reload splitter is needed here.
That is not exactly true. It has been around since before 2005. See https://gcc.gnu.org/PR24436 which is referencing the fixme comment in validate_subreg. Thanks, Andrew Pinski Thanks, Andrew Pinski > > Jakub > > > > > > -- > BR, > Hongtao