summaryrefslogtreecommitdiffstats
path: root/lib/Headers/altivec.h
Commit message (Collapse)AuthorAgeFilesLines
* Move the builtin headers to use the new license file header.Chandler Carruth2019-04-081-17/+3
| | | | | | | | | | | | | | | | | | Summary: These all had somewhat custom file headers with different text from the ones I searched for previously, and so I missed them. Thanks to Hal and Kristina and others who prompted me to fix this, and sorry it took so long. Reviewers: hfinkel Subscribers: mcrosier, javed.absar, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60406 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357941 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Vector load/store builtins overstate alignment of pointersNemanja Ivanovic2018-11-261-24/+39
| | | | | | | | | | | | | | A number of builtins in altivec.h load/store vectors from pointers to scalar types. Currently they just cast the pointer to a vector pointer, but expressions like that have the alignment of the target type. Of course, the input pointer did not have that alignment so this triggers UBSan (and rightly so). This resolves https://bugs.llvm.org/show_bug.cgi?id=39704 Differential revision: https://reviews.llvm.org/D54787 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347556 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] [Clang] [AltiVec] The second parameter of vec_sr function should ↵Zi Xuan Wu2018-11-091-29/+31
| | | | | | | | | | | | | | | | | | be modulo the number of bits in the element The second parameter of vec_sr function is representing shift bits and it should be modulo the number of bits in the element like what vec_sl does now. This is actually required by the ABI: Each element of the result vector is the result of logically right shifting the corresponding element of ARG1 by the number of bits specified by the value of the corresponding element of ARG2, modulo the number of bits in the element. The bits that are shifted out are replaced by zeros. Differential Revision: https://reviews.llvm.org/D54087 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346471 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Make altivec conversion function macros.Benjamin Kramer2017-05-301-57/+49
| | | | | | | | | | The second argument must be a constant, otherwise instruction selection will fail. always_inline is not enough for isel to always fold everything away at -O0. Sadly the overloading turned this into a big macro mess. Fixes PR33212. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304205 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement vec_xxsldwi builtin.Tony Jiang2017-05-241-0/+1
| | | | | | | | | | The vec_xxsldwi builtin is missing from altivec.h. This has been requested by developers working on libvpx for VP9 support for Google. The patch fixes PR: https://bugs.llvm.org/show_bug.cgi?id=32653 Differential Revision: https://reviews.llvm.org/D33236 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303766 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement vec_xxpermdi builtin.Tony Jiang2017-05-241-0/+4
| | | | | | | | | | The vec_xxpermdi builtin is missing from altivec.h. This has been requested by developers working on libvpx for VP9 support for Google. The patch fixes PR: https://bugs.llvm.org/show_bug.cgi?id=32653 Differential Revision: https://reviews.llvm.org/D33053 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303760 91177308-0d34-0410-b5e6-96231b3b80d8
* [Altivec] Change vec_sl to a << (b % (sizeof(a) * 8))Tim Shen2017-01-201-19/+25
| | | | | | | | | | | | | | | | | For a << b (as original vec_sl does), if b >= sizeof(a) * 8, the behavior is undefined. However, Power instructions do define the behavior, which is equivalent to a << (b % (sizeof(a) * 8)). This patch changes altivec.h to use a << (b % (sizeof(a) * 8)), to ensure the consistent semantic of the instructions. Then it combines the generated multiple instructions back to a single shift. This patch handles left shift only. Right shift, on the other hand, is more complicated, considering arithematic/logical right shift. Differential Revision: https://reviews.llvm.org/D28037 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292659 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Fix the wrong implementation of builtin vec_rlnm.Tony Jiang2017-01-111-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291702 91177308-0d34-0410-b5e6-96231b3b80d8
* Add vec_insert4b and vec_extract4b functions to altivec.hSean Fertile2017-01-051-0/+3
| | | | | | | | | Add builtins for the functions and custom codegen mapping the builtins to their corresponding intrinsics and handling the endian related swapping. https://reviews.llvm.org/D26546 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291179 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-241-1/+176
| | | | | | | | | | | | | | | | | | | | | | (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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287872 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] revert r287795Ehsan Amiri2016-11-231-176/+1
| | | | | | | A test that passed locally is failing on one of the build bots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287796 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-231-1/+176
| | | | | | | | | | | | | | | | | | | | | (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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287795 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Reverting r287772Ehsan Amiri2016-11-231-175/+1
| | | | | | | Due to buildbot failure, I revert. Will recommit after investigation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287775 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] support for arithmetic builtins in the FEEhsan Amiri2016-11-231-1/+175
| | | | | | | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287772 91177308-0d34-0410-b5e6-96231b3b80d8
* vector load store with length (left justified) clang portionZaara Syeda2016-11-151-0/+159
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286994 91177308-0d34-0410-b5e6-96231b3b80d8
* test commmitZaara Syeda2016-11-151-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286977 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement BE VSX load/store builtins - clang portion.Tony Jiang2016-11-151-0/+168
| | | | | | | | | | | | This patch implements all the overloads for vec_xl_be and vec_xst_be. On BE, they behaves exactly the same with vec_xl and vec_xst, therefore they are simply implemented by defining a matching macro. On LE, they are implemented by defining new builtins and intrinsics. For int/float/long long/double, it is just a load (lxvw4x/lxvd2x) or store(stxvw4x/stxvd2x). For char/char/short, we also need some extra shuffling before or after call the builtins to get the desired BE order. For int128, simply call vec_xl or vec_xst. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286971 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] altivec.h functions for converting half precision to single precision.Sean Fertile2016-11-141-0/+21
| | | | | | | | | | Adds 2 vector functions for converting from a vector of unsigned short to a vector of float. One converts the low 4 halfwords and one converts the high 4 halfwords. Differential Revision: https://reviews.llvm.org/D26534 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286863 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] add extract sig/exp test data class for vec float and vec double.Sean Fertile2016-11-141-1/+59
| | | | | | | | | | Add vector extract exponent/significand functions to altivec.h, as well as functions (and related constants) to test the data class of vector float and vector double. Differential Revision: https://reviews.llvm.org/D26271 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286830 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement remaining permute builtins in altivec.h - Clang portionNemanja Ivanovic2016-11-111-0/+129
| | | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D26479 It adds the remaining vector permute/rotate builtins to altivec.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286650 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Add vector conversion builtins to altivec.h - clang portionNemanja Ivanovic2016-11-111-1/+265
| | | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D26308 It adds a number of vector type conversion builtins to altivec.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286627 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement plain VSX load/store builtins.Tony Jiang2016-11-101-0/+144
| | | | | | Implement all the different 24 overloads for vec_xl and vec_xst. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286455 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement remaining vector comparison builtins.Tony Jiang2016-11-081-24/+53
| | | | | | | | | vector bool char vec_cmpeq (vector bool char, vector bool char); vector bool int vec_cmpeq (vector bool int, vector bool int); vector bool long long vec_cmpeq (vector bool long long, vector bool long lon vector bool short vec_cmpeq (vector bool short, vector bool short); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286205 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement vector shift builtins - clang portionNemanja Ivanovic2016-11-011-0/+219
| | | | | | | | This patch corresponds to review https://reviews.llvm.org/D26092. Committing on behalf of Tony Jiang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285694 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Add vec_absd functions to altivec.hNemanja Ivanovic2016-11-011-0/+20
| | | | | | | | This patch corresponds to review https://reviews.llvm.org/D26073. Committing on behalf of Sean Fertile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285679 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] add float and double overloads for vec_orc and vec_nand in altivec.hNemanja Ivanovic2016-10-281-0/+32
| | | | | | | | This patch corresponds to review https://reviews.llvm.org/D25950. Committing on behalf of Sean Fertile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285439 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement vector count leading/trailing bytes with zero lsb and vector parityNemanja Ivanovic2016-10-281-0/+66
| | | | | | | | | | builtins - clang portion This patch corresponds to review: https://reviews.llvm.org/D26002 Committing on behalf of Zaara Syeda. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285436 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] add vector byte reverse functions to altivec.hNemanja Ivanovic2016-10-271-0/+115
| | | | | | | | This patch corresponds to review https://reviews.llvm.org/D25915. Committing on behalf of Sean Fertile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285268 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement vector_insert_exp builtins - clang portionNemanja Ivanovic2016-10-261-0/+20
| | | | | | | | This patch corresponds to review https://reviews.llvm.org/D25956. Committing on behalf of Zaara Syeda. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285229 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Implement vector reverse elements builtins (vec_reve)Nemanja Ivanovic2016-10-261-0/+71
| | | | | | | | | This patch corresponds to review https://reviews.llvm.org/D25906. Committing on behalf of Tony Jiang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285218 91177308-0d34-0410-b5e6-96231b3b80d8
* [Power9] Builtins for ELF v.2 ABI conformance - front end portionNemanja Ivanovic2016-09-271-0/+581
| | | | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D24397 It adds the __POWER9_VECTOR__ macro and the -mpower9-vector option along with a number of altivec.h functions (refer to the code review for a list). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282481 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the altivec intrinsics that require immediate constant propagationEric Christopher2016-05-241-20/+12
| | | | | | | | | macros rather than functions. Unfortunately couldn't come up with a simple testcase that didn't need code generation to verify what was going on. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270625 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st ↵Chuang-Yu Cheng2016-04-131-14/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | intrinsics and fix incorrect testcases with minor refactoring New added data types: vector double vec_vsx_ld (int, const double *); vector float vec_vsx_ld (int, const float *); vector bool short vec_vsx_ld (int, const vector bool short *); vector bool int vec_vsx_ld (int, const vector bool int *); vector signed int vec_vsx_ld (int, const signed int *); vector unsigned int vec_vsx_ld (int, const unsigned int *); void vec_vsx_st (vector double, int, double *); void vec_vsx_st (vector float, int, float *); void vec_vsx_st (vector bool short, int, vector bool short *); void vec_vsx_st (vector bool short, int, signed short *); void vec_vsx_st (vector bool short, int, unsigned short *); void vec_vsx_st (vector bool int, int, vector bool int *); void vec_vsx_st (vector bool int, int, signed int *); void vec_vsx_st (vector bool int, int, unsigned int *); Also fix testcases which use non-vector argument version of vec_vsx_ld or vec_vsx_st, but pass incorrect parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266166 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a couple of missing vsx load and store intrinsics.Eric Christopher2016-04-121-0/+10
| | | | | | Patch by Jing Yu! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266122 91177308-0d34-0410-b5e6-96231b3b80d8
* Make functions in altivec.h be __inline__. As they are all also markedDaniel Jasper2016-03-111-4034/+4370
| | | | | | | | __always_inline__, this has likely been meant from the start. Review: http://reviews.llvm.org/D18015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263302 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] FE support for generating VSX [negated] absolute value instructionsKit Barton2016-03-091-3/+5
| | | | | | | | | | | Includes new built-in, conversion of built-in to target-independent intrinsic and update in the header file. Tests are also updated. There is a second part in the backend for which I will post a separate code-review. BACKEND PART SHOULD BE COMMITTED FIRST. Phabricator: http://reviews.llvm.org/D17816 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263051 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and ↵Kit Barton2016-03-011-0/+110
| | | | | | | | | | | | | | | | | | | | | vec_vsx_st intrinsics Issue: https://llvm.org/bugs/show_bug.cgi?id=26720 Fix compile error when building ffmpeg for PowerPC64LE because of some vec_vsx_ld/vec_vsx_st intrinsics are not supported by current clang. New added intrinsics: (vector) {signed|unsigned} {short|char} vec_vsx_ld: (total: 8) bool vec_vsx_ld: (total: 1) (vector) {signed|unsigned} {short|char} vec_vsx_st: (total: 8) bool vec_vsx_st: (total: 1) Total: 18 intrinsics Phabricator: http://reviews.llvm.org/D17637 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262359 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC] Add long long/double support for vec_cts, vec_ctu and vec_ctfKyle Butt2016-01-081-4/+34
| | | | | | | | | | | Add long long/double support for vec_cts, vec_ctu and vec_ctf. Similar to this change in GCC: https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02653.html Patch by Tim Shen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257135 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up comment in header.Eric Christopher2015-12-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256508 91177308-0d34-0410-b5e6-96231b3b80d8
* Forgot to remove a FIXME that has been fixed. NFC.Nemanja Ivanovic2015-09-291-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248815 91177308-0d34-0410-b5e6-96231b3b80d8
* Addition of interfaces the FE to conform to Table A-2 of ELF V2 ABI V1.1Nemanja Ivanovic2015-09-291-170/+564
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D13190 Implemented the following interfaces to conform to ELF V2 ABI version 1.1. vector signed __int128 vec_adde (vector signed __int128, vector signed __int128, vector signed __int128); vector unsigned __int128 vec_adde (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128); vector signed __int128 vec_addec (vector signed __int128, vector signed __int128, vector signed __int128); vector unsigned __int128 vec_addec (vector unsigned __int128, vector unsigned __int128, vector unsigned __int128); vector signed int vec_addc(vector signed int __a, vector signed int __b); vector bool char vec_cmpge (vector signed char __a, vector signed char __b); vector bool char vec_cmpge (vector unsigned char __a, vector unsigned char __b); vector bool short vec_cmpge (vector signed short __a, vector signed short __b); vector bool short vec_cmpge (vector unsigned short __a, vector unsigned short __b); vector bool int vec_cmpge (vector signed int __a, vector signed int __b); vector bool int vec_cmpge (vector unsigned int __a, vector unsigned int __b); vector bool char vec_cmple (vector signed char __a, vector signed char __b); vector bool char vec_cmple (vector unsigned char __a, vector unsigned char __b); vector bool short vec_cmple (vector signed short __a, vector signed short __b); vector bool short vec_cmple (vector unsigned short __a, vector unsigned short __b); vector bool int vec_cmple (vector signed int __a, vector signed int __b); vector bool int vec_cmple (vector unsigned int __a, vector unsigned int __b); vector double vec_double (vector signed long long __a); vector double vec_double (vector unsigned long long __a); vector bool char vec_eqv(vector bool char __a, vector bool char __b); vector bool short vec_eqv(vector bool short __a, vector bool short __b); vector bool int vec_eqv(vector bool int __a, vector bool int __b); vector bool long long vec_eqv(vector bool long long __a, vector bool long long __b); vector signed short vec_madd(vector signed short __a, vector signed short __b, vector signed short __c); vector signed short vec_madd(vector signed short __a, vector unsigned short __b, vector unsigned short __c); vector signed short vec_madd(vector unsigned short __a, vector signed short __b, vector signed short __c); vector unsigned short vec_madd(vector unsigned short __a, vector unsigned short __b, vector unsigned short __c); vector bool long long vec_mergeh(vector bool long long __a, vector bool long long __b); vector bool long long vec_mergel(vector bool long long __a, vector bool long long __b); vector bool char vec_nand(vector bool char __a, vector bool char __b); vector bool short vec_nand(vector bool short __a, vector bool short __b); vector bool int vec_nand(vector bool int __a, vector bool int __b); vector bool long long vec_nand(vector bool long long __a, vector bool long long __b); vector bool char vec_orc(vector bool char __a, vector bool char __b); vector bool short vec_orc(vector bool short __a, vector bool short __b); vector bool int vec_orc(vector bool int __a, vector bool int __b); vector bool long long vec_orc(vector bool long long __a, vector bool long long __b); vector signed long long vec_sub(vector signed long long __a, vector signed long long __b); vector signed long long vec_sub(vector bool long long __a, vector signed long long __b); vector signed long long vec_sub(vector signed long long __a, vector bool long long __b); vector unsigned long long vec_sub(vector unsigned long long __a, vector unsigned long long __b); vector unsigned long long vec_sub(vector bool long long __a, vector unsigned long long __b); vector unsigned long long vec_sub(vector unsigned long long __V2 ABI V1.1 http://ror float vec_sub(vector float __a, vector float __b); unsigned char vec_extract(vector bool char __a, int __b); signed short vec_extract(vector signed short __a, int __b); unsigned short vec_extract(vector bool short __a, int __b); signed int vec_extract(vector signed int __a, int __b); unsigned int vec_extract(vector bool int __a, int __b); signed long long vec_extract(vector signed long long __a, int __b); unsigned long long vec_extract(vector unsigned long long __a, int __b); unsigned long long vec_extract(vector bool long long __a, int __b); double vec_extract(vector double __a, int __b); vector bool char vec_insert(unsigned char __a, vector bool char __b, int __c); vector signed short vec_insert(signed short __a, vector signed short __b, int __c); vector bool short vec_insert(unsigned short __a, vector bool short __b, int __c); vector signed int vec_insert(signed int __a, vector signed int __b, int __c); vector bool int vec_insert(unsigned int __a, vector bool int __b, int __c); vector signed long long vec_insert(signed long long __a, vector signed long long __b, int __c); vector unsigned long long vec_insert(unsigned long long __a, vector unsigned long long __b, int __c); vector bool long long vec_insert(unsigned long long __a, vector bool long long __b, int __c); vector double vec_insert(double __a, vector double __b, int __c); vector signed long long vec_splats(signed long long __a); vector unsigned long long vec_splats(unsigned long long __a); vector signed __int128 vec_splats(signed __int128 __a); vector unsigned __int128 vec_splats(unsigned __int128 __a); vector double vec_splats(double __a); int vec_all_eq(vector double __a, vector double __b); int vec_all_ge(vector double __a, vector double __b); int vec_all_gt(vector double __a, vector double __b); int vec_all_le(vector double __a, vector double __b); int vec_all_lt(vector double __a, vector double __b); int vec_all_nan(vector double __a); int vec_all_ne(vector double __a, vector double __b); int vec_all_nge(vector double __a, vector double __b); int vec_all_ngt(vector double __a, vector double __b); int vec_any_eq(vector double __a, vector double __b); int vec_any_ge(vector double __a, vector double __b); int vec_any_gt(vector double __a, vector double __b); int vec_any_le(vector double __a, vector double __b); int vec_any_lt(vector double __a, vector double __b); int vec_any_ne(vector double __a, vector double __b); vector unsigned char vec_sbox_be (vector unsigned char); vector unsigned char vec_cipher_be (vector unsigned char, vector unsigned char); vector unsigned char vec_cipherlast_be (vector unsigned char, vector unsigned char); vector unsigned char vec_ncipher_be (vector unsigned char, vector unsigned char); vector unsigned char vec_ncipherlast_be (vector unsigned char, vector unsigned char); vector unsigned int vec_shasigma_be (vector unsigned int, const int, const int); vector unsigned long long vec_shasigma_be (vector unsigned long long, const int, const int); vector unsigned short vec_pmsum_be (vector unsigned char, vector unsigned char); vector unsigned int vec_pmsum_be (vector unsigned short, vector unsigned short); vector unsigned long long vec_pmsum_be (vector unsigned int, vector unsigned int); vector unsigned __int128 vec_pmsum_be (vector unsigned long long, vector unsigned long long); vector unsigned char vec_gb (vector unsigned char); vector unsigned long long vec_bperm (vector unsigned __int128 __a, vector unsigned char __b); Removed the folowing interfaces either because their signatures have changed in version 1.1 of the ABI or because they were implemented for ELF V2 ABI but have actually been deprecated in version 1.1. vector signed char vec_eqv(vector bool char __a, vector signed char __b); vector signed char vec_eqv(vector signed char __a, vector bool char __b); vector unsigned char vec_eqv(vector bool char __a, vector unsigned char __b); vector unsigned char vec_eqv(vector unsigned char __a, vector bool char __b); vector signed short vec_eqv(vector bool short __a, vector signed short __b); vector signed short vec_eqv(vector signed short __a, vector bool short __b); vector unsigned short vec_eqv(vector bool short __a, vector unsigned short __b); vector unsigned short vec_eqv(vector unsigned short __a, vector bool short __b); vector signed int vec_eqv(vector bool int __a, vector signed int __b); vector signed int vec_eqv(vector signed int __a, vector bool int __b); vector unsigned int vec_eqv(vector bool int __a, vector unsigned int __b); vector unsigned int vec_eqv(vector unsigned int __a, vector bool int __b); vector signed long long vec_eqv(vector bool long long __a, vector signed long long __b); vector signed long long vec_eqv(vector signed long long __a, vector bool long long __b); vector unsigned long long vec_eqv(vector bool long long __a, vector unsigned long long __b); vector unsigned long long vec_eqv(vector unsigned long long __a, vector bool long long __b); vector float vec_eqv(vector bool int __a, vector float __b); vector float vec_eqv(vector float __a, vector bool int __b); vector double vec_eqv(vector bool long long __a, vector double __b); vector double vec_eqv(vector double __a, vector bool long long __b); vector unsigned short vec_nand(vector bool short __a, vector unsigned short __b); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248813 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up trailing whitespace in the builtin headersSean Silva2015-09-121-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247498 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Fix vec_sld semantics for little endianBill Schmidt2015-07-151-24/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The vec_sld interface provides access to the vsldoi instruction. Unlike most of the vec_* interfaces, we do not attempt to change the generated code for vec_sld based on the endian mode. It is too difficult to correctly infer the desired semantics because of different element types, and the corrected instruction sequence is expensive, involving loading a permute control vector and performing a generalized permute. For GCC, this was implemented as "Don't touch the vec_sld" implementation. When it came time for the LLVM implementation, I did the same thing. However, this was hasty and incorrect. In LLVM's version of altivec.h, vec_sld was previously defined in terms of the vec_perm interface. Because vec_perm semantics are adjusted for little endian, this means that leaving vec_sld untouched causes it to generate something different for LE than for BE. Not good. This patch adjusts the form of vec_perm that is used for vec_sld and vec_vsldoi, effectively undoing the modifications so that the same vsldoi instruction will be generated for both BE and LE. There is an accompanying back-end patch to take care of some small ripple effects caused by these changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242297 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing builtins to altivec.h for ABI compliance (vol. 4)Nemanja Ivanovic2015-07-141-11/+617
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D11184 A number of new interfaces for altivec.h (as mandated by the ABI): vector float vec_cpsgn(vector float, vector float) vector double vec_cpsgn(vector double, vector double) vector double vec_or(vector bool long long, vector double) vector double vec_or(vector double, vector bool long long) vector double vec_re(vector double) vector signed char vec_cntlz(vector signed char) vector unsigned char vec_cntlz(vector unsigned char) vector short vec_cntlz(vector short) vector unsigned short vec_cntlz(vector unsigned short) vector int vec_cntlz(vector int) vector unsigned int vec_cntlz(vector unsigned int) vector signed long long vec_cntlz(vector signed long long) vector unsigned long long vec_cntlz(vector unsigned long long) vector signed char vec_nand(vector bool signed char, vector signed char) vector signed char vec_nand(vector signed char, vector bool signed char) vector signed char vec_nand(vector signed char, vector signed char) vector unsigned char vec_nand(vector bool unsigned char, vector unsigned char) vector unsigned char vec_nand(vector unsigned char, vector bool unsigned char) vector unsigned char vec_nand(vector unsigned char, vector unsigned char) vector short vec_nand(vector bool short, vector short) vector short vec_nand(vector short, vector bool short) vector short vec_nand(vector short, vector short) vector unsigned short vec_nand(vector bool unsigned short, vector unsigned short) vector unsigned short vec_nand(vector unsigned short, vector bool unsigned short) vector unsigned short vec_nand(vector unsigned short, vector unsigned short) vector int vec_nand(vector bool int, vector int) vector int vec_nand(vector int, vector bool int) vector int vec_nand(vector int, vector int) vector unsigned int vec_nand(vector bool unsigned int, vector unsigned int) vector unsigned int vec_nand(vector unsigned int, vector bool unsigned int) vector unsigned int vec_nand(vector unsigned int, vector unsigned int) vector signed long long vec_nand(vector bool long long, vector signed long long) vector signed long long vec_nand(vector signed long long, vector bool long long) vector signed long long vec_nand(vector signed long long, vector signed long long) vector unsigned long long vec_nand(vector bool long long, vector unsigned long long) vector unsigned long long vec_nand(vector unsigned long long, vector bool long long) vector unsigned long long vec_nand(vector unsigned long long, vector unsigned long long) vector signed char vec_orc(vector bool signed char, vector signed char) vector signed char vec_orc(vector signed char, vector bool signed char) vector signed char vec_orc(vector signed char, vector signed char) vector unsigned char vec_orc(vector bool unsigned char, vector unsigned char) vector unsigned char vec_orc(vector unsigned char, vector bool unsigned char) vector unsigned char vec_orc(vector unsigned char, vector unsigned char) vector short vec_orc(vector bool short, vector short) vector short vec_orc(vector short, vector bool short) vector short vec_orc(vector short, vector short) vector unsigned short vec_orc(vector bool unsigned short, vector unsigned short) vector unsigned short vec_orc(vector unsigned short, vector bool unsigned short) vector unsigned short vec_orc(vector unsigned short, vector unsigned short) vector int vec_orc(vector bool int, vector int) vector int vec_orc(vector int, vector bool int) vector int vec_orc(vector int, vector int) vector unsigned int vec_orc(vector bool unsigned int, vector unsigned int) vector unsigned int vec_orc(vector unsigned int, vector bool unsigned int) vector unsigned int vec_orc(vector unsigned int, vector unsigned int) vector signed long long vec_orc(vector bool long long, vector signed long long) vector signed long long vec_orc(vector signed long long, vector bool long long) vector signed long long vec_orc(vector signed long long, vector signed long long) vector unsigned long long vec_orc(vector bool long long, vector unsigned long long) vector unsigned long long vec_orc(vector unsigned long long, vector bool long long) vector unsigned long long vec_orc(vector unsigned long long, vector unsigned long long) vector signed char vec_div(vector signed char, vector signed char) vector unsigned char vec_div(vector unsigned char, vector unsigned char) vector signed short vec_div(vector signed short, vector signed short) vector unsigned short vec_div(vector unsigned short, vector unsigned short) vector signed int vec_div(vector signed int, vector signed int) vector unsigned int vec_div(vector unsigned int, vector unsigned int) vector signed long long vec_div(vector signed long long, vector signed long long) vector unsigned long long vec_div(vector unsigned long long, vector unsigned long long) vector unsigned char vec_mul(vector unsigned char, vector unsigned char) vector unsigned int vec_mul(vector unsigned int, vector unsigned int) vector unsigned long long vec_mul(vector unsigned long long, vector unsigned long long) vector unsigned short vec_mul(vector unsigned short, vector unsigned short) vector signed char vec_mul(vector signed char, vector signed char) vector signed int vec_mul(vector signed int, vector signed int) vector signed long long vec_mul(vector signed long long, vector signed long long) vector signed short vec_mul(vector signed short, vector signed short) vector signed long long vec_mergeh(vector signed long long, vector signed long long) vector signed long long vec_mergeh(vector signed long long, vector bool long long) vector signed long long vec_mergeh(vector bool long long, vector signed long long) vector unsigned long long vec_mergeh(vector unsigned long long, vector unsigned long long) vector unsigned long long vec_mergeh(vector unsigned long long, vector bool long long) vector unsigned long long vec_mergeh(vector bool long long, vector unsigned long long) vector double vec_mergeh(vector double, vector double) vector double vec_mergeh(vector double, vector bool long long) vector double vec_mergeh(vector bool long long, vector double) vector signed long long vec_mergel(vector signed long long, vector signed long long) vector signed long long vec_mergel(vector signed long long, vector bool long long) vector signed long long vec_mergel(vector bool long long, vector signed long long) vector unsigned long long vec_mergel(vector unsigned long long, vector unsigned long long) vector unsigned long long vec_mergel(vector unsigned long long, vector bool long long) vector unsigned long long vec_mergel(vector bool long long, vector unsigned long long) vector double vec_mergel(vector double, vector double) vector double vec_mergel(vector double, vector bool long long) vector double vec_mergel(vector bool long long, vector double) vector signed int vec_pack(vector signed long long, vector signed long long) vector unsigned int vec_pack(vector unsigned long long, vector unsigned long long) vector bool int vec_pack(vector bool long long, vector bool long long) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242171 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing builtins to altivec.h for ABI compliance (vol. 3)Nemanja Ivanovic2015-07-101-97/+398
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D10972 Fix for the handling of dependent features that are enabled by default on some CPU's (such as -mvsx, -mpower8-vector). Also provides a number of new interfaces or fixes existing ones in altivec.h. Changed signatures to conform to ABI: vector short vec_perm(vector signed short, vector signed short, vector unsigned char) vector int vec_perm(vector signed int, vector signed int, vector unsigned char) vector long long vec_perm(vector signed long long, vector signed long long, vector unsigned char) vector signed char vec_sld(vector signed char, vector signed char, const int) vector unsigned char vec_sld(vector unsigned char, vector unsigned char, const int) vector bool char vec_sld(vector bool char, vector bool char, const int) vector unsigned short vec_sld(vector unsigned short, vector unsigned short, const int) vector signed short vec_sld(vector signed short, vector signed short, const int) vector signed int vec_sld(vector signed int, vector signed int, const int) vector unsigned int vec_sld(vector unsigned int, vector unsigned int, const int) vector float vec_sld(vector float, vector float, const int) vector signed char vec_splat(vector signed char, const int) vector unsigned char vec_splat(vector unsigned char, const int) vector bool char vec_splat(vector bool char, const int) vector signed short vec_splat(vector signed short, const int) vector unsigned short vec_splat(vector unsigned short, const int) vector bool short vec_splat(vector bool short, const int) vector pixel vec_splat(vector pixel, const int) vector signed int vec_splat(vector signed int, const int) vector unsigned int vec_splat(vector unsigned int, const int) vector bool int vec_splat(vector bool int, const int) vector float vec_splat(vector float, const int) Added a VSX path to: vector float vec_round(vector float) Added interfaces: vector signed char vec_eqv(vector signed char, vector signed char) vector signed char vec_eqv(vector bool char, vector signed char) vector signed char vec_eqv(vector signed char, vector bool char) vector unsigned char vec_eqv(vector unsigned char, vector unsigned char) vector unsigned char vec_eqv(vector bool char, vector unsigned char) vector unsigned char vec_eqv(vector unsigned char, vector bool char) vector signed short vec_eqv(vector signed short, vector signed short) vector signed short vec_eqv(vector bool short, vector signed short) vector signed short vec_eqv(vector signed short, vector bool short) vector unsigned short vec_eqv(vector unsigned short, vector unsigned short) vector unsigned short vec_eqv(vector bool short, vector unsigned short) vector unsigned short vec_eqv(vector unsigned short, vector bool short) vector signed int vec_eqv(vector signed int, vector signed int) vector signed int vec_eqv(vector bool int, vector signed int) vector signed int vec_eqv(vector signed int, vector bool int) vector unsigned int vec_eqv(vector unsigned int, vector unsigned int) vector unsigned int vec_eqv(vector bool int, vector unsigned int) vector unsigned int vec_eqv(vector unsigned int, vector bool int) vector signed long long vec_eqv(vector signed long long, vector signed long long) vector signed long long vec_eqv(vector bool long long, vector signed long long) vector signed long long vec_eqv(vector signed long long, vector bool long long) vector unsigned long long vec_eqv(vector unsigned long long, vector unsigned long long) vector unsigned long long vec_eqv(vector bool long long, vector unsigned long long) vector unsigned long long vec_eqv(vector unsigned long long, vector bool long long) vector float vec_eqv(vector float, vector float) vector float vec_eqv(vector bool int, vector float) vector float vec_eqv(vector float, vector bool int) vector double vec_eqv(vector double, vector double) vector double vec_eqv(vector bool long long, vector double) vector double vec_eqv(vector double, vector bool long long) vector bool long long vec_perm(vector bool long long, vector bool long long, vector unsigned char) vector double vec_round(vector double) vector double vec_splat(vector double, const int) vector bool long long vec_splat(vector bool long long, const int) vector signed long long vec_splat(vector signed long long, const int) vector unsigned long long vec_splat(vector unsigned long long, vector bool int vec_sld(vector bool int, vector bool int, const int) vector bool short vec_sld(vector bool short, vector bool short, const int) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241904 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the missing return statements from revision 241399.Nemanja Ivanovic2015-07-051-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241405 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing builtins to altivec.h for ABI compliance (vol. 2)Nemanja Ivanovic2015-07-051-6/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D10875 The bulk of the second round of additions to altivec.h. The following interfaces were added: vector double vec_floor(vector double) vector double vec_madd(vector double, vector double, vector double) vector float vec_msub(vector float, vector float, vector float) vector double vec_msub(vector double, vector double, vector double) vector float vec_mul(vector float, vector float) vector double vec_mul(vector double, vector double) vector float vec_nmadd(vector float, vector float, vector float) vector double vec_nmadd(vector double, vector double, vector double) vector double vec_nmsub(vector double, vector double, vector double) vector double vec_nor(vector double, vector double) vector double vec_or(vector double, vector double) vector float vec_rint(vector float) vector double vec_rint(vector double) vector float vec_nearbyint(vector float) vector double vec_nearbyint(vector double) vector float vec_sqrt(vector float) vector double vec_sqrt(vector double) vector double vec_rsqrte(vector double) vector double vec_sel(vector double, vector double, vector unsigned long long) vector double vec_sel(vector double, vector double, vector unsigned long long) vector double vec_sub(vector double, vector double) vector double vec_trunc(vector double) vector double vec_xor(vector double, vector double) vector double vec_xor(vector double, vector bool long long) vector double vec_xor(vector bool long long, vector double) New VSX paths for the following interfaces: vector float vec_madd(vector float, vector float, vector float) vector float vec_nmsub(vector float, vector float, vector float) vector float vec_rsqrte(vector float) vector float vec_trunc(vector float) vector float vec_floor(vector float) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241399 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch adds support for the vector merge even word and vector merge odd wordKit Barton2015-07-021-0/+50
| | | | | | | | | | | | | instructions introduced in POWER8. These are the Clang-related changes for http://reviews.llvm.org/D10704 All builtins are added in altivec.h and guarded with the POWER8_VECTOR macro. Phabricator review: http://reviews.llvm.org/D10736 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241293 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing builtins to altivec.h for ABI compliance (vol. 1)Nemanja Ivanovic2015-06-261-13/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D10637 This is the first round of additions of missing builtins listed in the ABI document. More to come (this builds onto what seurer already addes). This patch adds: vector signed long long vec_abs(vector signed long long) vector double vec_abs(vector double) vector signed long long vec_add(vector signed long long, vector signed long long) vector unsigned long long vec_add(vector unsigned long long, vector unsigned long long) vector double vec_add(vector double, vector double) vector double vec_and(vector bool long long, vector double) vector double vec_and(vector double, vector bool long long) vector double vec_and(vector double, vector double) vector signed long long vec_and(vector signed long long, vector signed long long) vector double vec_andc(vector bool long long, vector double) vector double vec_andc(vector double, vector bool long long) vector double vec_andc(vector double, vector double) vector signed long long vec_andc(vector signed long long, vector signed long long) vector double vec_ceil(vector double) vector bool long long vec_cmpeq(vector double, vector double) vector bool long long vec_cmpge(vector double, vector double) vector bool long long vec_cmpge(vector signed long long, vector signed long long) vector bool long long vec_cmpge(vector unsigned long long, vector unsigned long long) vector bool long long vec_cmpgt(vector double, vector double) vector bool long long vec_cmple(vector double, vector double) vector bool long long vec_cmple(vector signed long long, vector signed long long) vector bool long long vec_cmple(vector unsigned long long, vector unsigned long long) vector bool long long vec_cmplt(vector double, vector double) vector bool long long vec_cmplt(vector signed long long, vector signed long long) vector bool long long vec_cmplt(vector unsigned long long, vector unsigned long long) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240821 91177308-0d34-0410-b5e6-96231b3b80d8
* Clang support for vector quad bit permute and gather instructions through ↵Nemanja Ivanovic2015-06-111-0/+23
| | | | | | | | | | | | | | builtins This patch corresponds to review: http://reviews.llvm.org/D10095 This is for just two instructions and related builtins: vbpermq vgbbd git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239506 91177308-0d34-0410-b5e6-96231b3b80d8