[Bug target/90822] New: Remove PowerPC lfiwax and lfiwzx patterns

meissner at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 10 21:51:00 GMT 2019


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

            Bug ID: 90822
           Summary: Remove PowerPC lfiwax and lfiwzx patterns
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: meissner at gcc dot gnu.org
  Target Milestone: ---

When I first added the patterns for LFIWAX and LFIWZX instructions (back in
2010), I wanted to add support for these instructions, but at the time we
didn't have automatic sign/zero extension from SImode to DImode, and I was
worried about allowing SImode in the floating point and vector registers.

The initial pattern that is generated is:
(insn 6 5 7 (parallel [
            (set (reg:DF 120)
                (float:DF (mem:SI (reg/v/f:DI 119 [ p ]) [1 *p_3(D)+0 S4
A32])))
            (clobber (scratch:DI))
        ]) "foo50.c":1:30 -1
     (nil))

After the split1 pass we generate:
(insn 15 6 16 2 (set (reg:DI 122)
        (unspec:DI [
                (mem:SI (reg:DI 121) [1 *p_3(D)+0 S4 A32])
            ] UNSPEC_LFIWAX)) "foo50.c":1:1 -1
     (nil))

(insn 16 15 12 2 (set (reg/i:DF 33 1)
        (float:DF (reg:DI 122))) "foo50.c":1:1 -1
     (nil))

Instead, we should generate in the split1 pass:
(insn 15 6 16 2 (set (reg:DI 122)
         (sign_extend:DI (mem:SI (reg:DI 121))))


(insn 16 15 12 2 (set (reg/i:DF 33 1)
        (float:DF (reg:DI 122))) "foo50.c":1:1 -1
     (nil))

And delete the lfiwax (and similar lfiwzx) patterns.

Obviously, we want to make sure we don't affect code generation for the power7
targets (for lfiwax/lfiwzx) and power6 targets (for just lfiwax).


More information about the Gcc-bugs mailing list