[PowerPC] Exploitate the Vector Integer Average Instructions
authorQingShan Zhang <qshanz@cn.ibm.com>
Wed, 11 Dec 2019 07:25:57 +0000 (07:25 +0000)
committerQingShan Zhang <qshanz@cn.ibm.com>
Wed, 11 Dec 2019 07:25:57 +0000 (07:25 +0000)
commitf99297176cd9507393b69029406080de01ae41c7
treea2955232f6d349a3a5e16749825fd8cced61f242
parentd4345636e678ccab8a87b09cdad9129e54c23100
[PowerPC] Exploitate the Vector Integer Average Instructions

PowerPC has instruction to do the semantics of this piece of code:

vector int foo(vector int m, vector int n) {
  return (m + n + 1) >> 1;
}
This patch is adding the match rule to select it.

Differential Revision: https://reviews.llvm.org/D71002
llvm/lib/Target/PowerPC/PPCInstrAltivec.td
llvm/test/CodeGen/PowerPC/vavg.ll