[PowerPC] Provide doubleword vector predicate form comparisons on Power7
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Wed, 12 May 2021 17:18:52 +0000 (12:18 -0500)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Thu, 13 May 2021 09:56:56 +0000 (04:56 -0500)
commit39e4676ca798d9aba58823515ac9d48eb64863be
treea738d4d1c798ba56362236777bd923d14ecc06f4
parente2759f110b6e9a33db449ebdf428480f46db67b8
[PowerPC] Provide doubleword vector predicate form comparisons on Power7

There are two reasons this shouldn't be restricted to Power8 and up:
1. For XL compatibility
2. Because clang will expand comparison operators to these intrinsics*

*Without this patch, the following causes a selection error:

int test(vector signed long a, vector signed long b) {
  return a < b;
}

This patch provides the handling for the intrinsics in the back
end and removes the Power8 guards from the predicate functions
(vec_{all|any}_{eq|ne|gt|ge|lt|le}).
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-p8vector.c
clang/test/CodeGen/builtins-ppc-vsx.c
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCInstrVSX.td
llvm/test/CodeGen/PowerPC/vec_cmpd_p7.ll [new file with mode: 0644]