]> git.ipfire.org Git - thirdparty/gcc.git/commit
s390: Recognize further vpdi and vmr{l,h} pattern
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Thu, 9 Nov 2023 08:32:58 +0000 (09:32 +0100)
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Thu, 9 Nov 2023 08:32:58 +0000 (09:32 +0100)
commit27381fb617b299768624a8e11c431a155cd81bba
tree77c3d1d8c7adc8b7ae10e0904572c0b123594d21
parentfa4dde85af5f08baed60bbb3f8455733edae6afb
s390: Recognize further vpdi and vmr{l,h} pattern

Deal with cases where vpdi and vmr{l,h} are still applicable if the
operands of those instructions are swapped.  For example, currently for

V2DI foo (V2DI x)
{
  return (V2DI) {x[1], x[0]};
}

the assembler sequence

vlgvg   %r1,%v24,1
vzero   %v0
vlvgg   %v0,%r1,0
vmrhg   %v24,%v0,%v24

is emitted.  With this patch a single vpdi is emitted.

Extensive tests are included in a subsequent patch of this series where
more cases are covered.

gcc/ChangeLog:

* config/s390/s390.cc (expand_perm_with_merge): Deal with cases
where vmr{l,h} are still applicable if the operands are swapped.
(expand_perm_with_vpdi): Likewise for vpdi.
gcc/config/s390/s390.cc