rs6000: Define define_insn_and_split to split unspec sldi+or to rldimi
authorXionghu Luo <luoxhu@linux.ibm.com>
Mon, 13 Jul 2020 01:22:56 +0000 (20:22 -0500)
committerXionghu Luo <luoxhu@linux.ibm.com>
Mon, 13 Jul 2020 01:22:56 +0000 (20:22 -0500)
commit56d78c58c233a358c780571ad6fecbabdcff2407
treefd0a9f62e59f360a0385d50104235e997814a3b7
parent466dd1629c699599050f68d2bfee58be9db40aab
rs6000: Define define_insn_and_split to split unspec sldi+or to rldimi

Combine pass could recognize the pattern defined and split it in split1,
this patch could optimize:

21: r130:DI=r133:DI<<0x20
11: {r129:DI=zero_extend(unspec[[r145:DI]] 87);clobber scratch;}
22: r134:DI=r130:DI|r129:DI

to

21: {r149:DI=zero_extend(unspec[[r145:DI]] 87);clobber scratch;}
22: r134:DI=r149:DI&0xffffffff|r133:DI<<0x20

rldimi is generated instead of sldi+or.

gcc/ChangeLog:

2020-07-13  Xionghu Luo  <luoxhu@linux.ibm.com>

* config/rs6000/rs6000.md (rotl_unspec): New
define_insn_and_split.

gcc/testsuite/ChangeLog:

2020-07-13  Xionghu Luo  <luoxhu@linux.ibm.com>

* gcc.target/powerpc/vector_float.c: New test.
gcc/config/rs6000/rs6000.md
gcc/testsuite/gcc.target/powerpc/vector_float.c [new file with mode: 0644]