[PPC] support for arithmetic builtins in the FE
authorEhsan Amiri <amehsan@ca.ibm.com>
Thu, 24 Nov 2016 12:40:04 +0000 (12:40 +0000)
committerEhsan Amiri <amehsan@ca.ibm.com>
Thu, 24 Nov 2016 12:40:04 +0000 (12:40 +0000)
commit85f5bfcf0d2e93c17a3cb3308561930adc0021a3
treeae9ab6a573cc44b138ae144918cea98cca098296
parentc2de8e8ec3eec5e93dd44eec419e5312f3bef759
[PPC] support for arithmetic builtins in the FE

(commit again after fixing the buildbot failures)
This adds various overloads of the following builtins to altivec.h:

    vec_neg
    vec_nabs
    vec_adde
    vec_addec
    vec_sube
    vec_subec
    vec_subc

Note that for vec_sub builtins on 32 bit integers, the semantics is similar to
what ISA describes for instructions like vsubecuq that work on quadwords: the
first operand is added to the one's complement of the second operand. (As
opposed to two's complement which I expected).

llvm-svn: 287872
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-altivec.c
clang/test/CodeGen/builtins-ppc-p8vector.c
clang/test/CodeGen/builtins-ppc-quadword.c
clang/test/CodeGen/builtins-ppc-vsx.c