Path: blob/master/tools/android-sdk/renderscript/clang-include/altivec.h
496 views
/*===---- altivec.h - Standard header for type generic math ---------------===*\1*2* Permission is hereby granted, free of charge, to any person obtaining a copy3* of this software and associated documentation files (the "Software"), to deal4* in the Software without restriction, including without limitation the rights5* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6* copies of the Software, and to permit persons to whom the Software is7* furnished to do so, subject to the following conditions:8*9* The above copyright notice and this permission notice shall be included in10* all copies or substantial portions of the Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN18* THE SOFTWARE.19*20\*===----------------------------------------------------------------------===*/2122#ifndef __ALTIVEC_H23#define __ALTIVEC_H2425#ifndef __ALTIVEC__26#error "AltiVec support not enabled"27#endif2829/* Constants for mapping CR6 bits to predicate result. */3031#define __CR6_EQ 032#define __CR6_EQ_REV 133#define __CR6_LT 234#define __CR6_LT_REV 33536#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))3738static __inline__ vector signed char __ATTRS_o_ai vec_perm(39vector signed char __a, vector signed char __b, vector unsigned char __c);4041static __inline__ vector unsigned char __ATTRS_o_ai42vec_perm(vector unsigned char __a, vector unsigned char __b,43vector unsigned char __c);4445static __inline__ vector bool char __ATTRS_o_ai46vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);4748static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,49vector signed short __b,50vector unsigned char __c);5152static __inline__ vector unsigned short __ATTRS_o_ai53vec_perm(vector unsigned short __a, vector unsigned short __b,54vector unsigned char __c);5556static __inline__ vector bool short __ATTRS_o_ai vec_perm(57vector bool short __a, vector bool short __b, vector unsigned char __c);5859static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,60vector pixel __b,61vector unsigned char __c);6263static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,64vector signed int __b,65vector unsigned char __c);6667static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(68vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);6970static __inline__ vector bool int __ATTRS_o_ai71vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);7273static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,74vector float __b,75vector unsigned char __c);7677#ifdef __VSX__78static __inline__ vector long long __ATTRS_o_ai79vec_perm(vector signed long long __a, vector signed long long __b,80vector unsigned char __c);8182static __inline__ vector unsigned long long __ATTRS_o_ai83vec_perm(vector unsigned long long __a, vector unsigned long long __b,84vector unsigned char __c);8586static __inline__ vector bool long long __ATTRS_o_ai87vec_perm(vector bool long long __a, vector bool long long __b,88vector unsigned char __c);8990static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,91vector double __b,92vector unsigned char __c);93#endif9495static __inline__ vector unsigned char __ATTRS_o_ai96vec_xor(vector unsigned char __a, vector unsigned char __b);9798/* vec_abs */99100#define __builtin_altivec_abs_v16qi vec_abs101#define __builtin_altivec_abs_v8hi vec_abs102#define __builtin_altivec_abs_v4si vec_abs103104static __inline__ vector signed char __ATTRS_o_ai105vec_abs(vector signed char __a) {106return __builtin_altivec_vmaxsb(__a, -__a);107}108109static __inline__ vector signed short __ATTRS_o_ai110vec_abs(vector signed short __a) {111return __builtin_altivec_vmaxsh(__a, -__a);112}113114static __inline__ vector signed int __ATTRS_o_ai115vec_abs(vector signed int __a) {116return __builtin_altivec_vmaxsw(__a, -__a);117}118119#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)120static __inline__ vector signed long long __ATTRS_o_ai121vec_abs(vector signed long long __a) {122return __builtin_altivec_vmaxsd(__a, -__a);123}124#endif125126static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {127#ifdef __VSX__128return __builtin_vsx_xvabssp(__a);129#else130vector unsigned int __res =131(vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);132return (vector float)__res;133#endif134}135136#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)137static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {138return __builtin_vsx_xvabsdp(__a);139}140#endif141142/* vec_abss */143#define __builtin_altivec_abss_v16qi vec_abss144#define __builtin_altivec_abss_v8hi vec_abss145#define __builtin_altivec_abss_v4si vec_abss146147static __inline__ vector signed char __ATTRS_o_ai148vec_abss(vector signed char __a) {149return __builtin_altivec_vmaxsb(150__a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));151}152153static __inline__ vector signed short __ATTRS_o_ai154vec_abss(vector signed short __a) {155return __builtin_altivec_vmaxsh(156__a, __builtin_altivec_vsubshs((vector signed short)(0), __a));157}158159static __inline__ vector signed int __ATTRS_o_ai160vec_abss(vector signed int __a) {161return __builtin_altivec_vmaxsw(162__a, __builtin_altivec_vsubsws((vector signed int)(0), __a));163}164165/* vec_add */166167static __inline__ vector signed char __ATTRS_o_ai168vec_add(vector signed char __a, vector signed char __b) {169return __a + __b;170}171172static __inline__ vector signed char __ATTRS_o_ai173vec_add(vector bool char __a, vector signed char __b) {174return (vector signed char)__a + __b;175}176177static __inline__ vector signed char __ATTRS_o_ai178vec_add(vector signed char __a, vector bool char __b) {179return __a + (vector signed char)__b;180}181182static __inline__ vector unsigned char __ATTRS_o_ai183vec_add(vector unsigned char __a, vector unsigned char __b) {184return __a + __b;185}186187static __inline__ vector unsigned char __ATTRS_o_ai188vec_add(vector bool char __a, vector unsigned char __b) {189return (vector unsigned char)__a + __b;190}191192static __inline__ vector unsigned char __ATTRS_o_ai193vec_add(vector unsigned char __a, vector bool char __b) {194return __a + (vector unsigned char)__b;195}196197static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,198vector short __b) {199return __a + __b;200}201202static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,203vector short __b) {204return (vector short)__a + __b;205}206207static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,208vector bool short __b) {209return __a + (vector short)__b;210}211212static __inline__ vector unsigned short __ATTRS_o_ai213vec_add(vector unsigned short __a, vector unsigned short __b) {214return __a + __b;215}216217static __inline__ vector unsigned short __ATTRS_o_ai218vec_add(vector bool short __a, vector unsigned short __b) {219return (vector unsigned short)__a + __b;220}221222static __inline__ vector unsigned short __ATTRS_o_ai223vec_add(vector unsigned short __a, vector bool short __b) {224return __a + (vector unsigned short)__b;225}226227static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,228vector int __b) {229return __a + __b;230}231232static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,233vector int __b) {234return (vector int)__a + __b;235}236237static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,238vector bool int __b) {239return __a + (vector int)__b;240}241242static __inline__ vector unsigned int __ATTRS_o_ai243vec_add(vector unsigned int __a, vector unsigned int __b) {244return __a + __b;245}246247static __inline__ vector unsigned int __ATTRS_o_ai248vec_add(vector bool int __a, vector unsigned int __b) {249return (vector unsigned int)__a + __b;250}251252static __inline__ vector unsigned int __ATTRS_o_ai253vec_add(vector unsigned int __a, vector bool int __b) {254return __a + (vector unsigned int)__b;255}256257#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)258static __inline__ vector signed long long __ATTRS_o_ai259vec_add(vector signed long long __a, vector signed long long __b) {260return __a + __b;261}262263static __inline__ vector unsigned long long __ATTRS_o_ai264vec_add(vector unsigned long long __a, vector unsigned long long __b) {265return __a + __b;266}267268static __inline__ vector signed __int128 __ATTRS_o_ai269vec_add(vector signed __int128 __a, vector signed __int128 __b) {270return __a + __b;271}272273static __inline__ vector unsigned __int128 __ATTRS_o_ai274vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {275return __a + __b;276}277#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)278279static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,280vector float __b) {281return __a + __b;282}283284#ifdef __VSX__285static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,286vector double __b) {287return __a + __b;288}289#endif // __VSX__290291/* vec_adde */292293#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)294static __inline__ vector signed __int128 __ATTRS_o_ai295vec_adde(vector signed __int128 __a, vector signed __int128 __b,296vector signed __int128 __c) {297return __builtin_altivec_vaddeuqm(__a, __b, __c);298}299300static __inline__ vector unsigned __int128 __ATTRS_o_ai301vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,302vector unsigned __int128 __c) {303return __builtin_altivec_vaddeuqm(__a, __b, __c);304}305#endif306307/* vec_addec */308309#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)310static __inline__ vector signed __int128 __ATTRS_o_ai311vec_addec(vector signed __int128 __a, vector signed __int128 __b,312vector signed __int128 __c) {313return __builtin_altivec_vaddecuq(__a, __b, __c);314}315316static __inline__ vector unsigned __int128 __ATTRS_o_ai317vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,318vector unsigned __int128 __c) {319return __builtin_altivec_vaddecuq(__a, __b, __c);320}321#endif322323/* vec_vaddubm */324325#define __builtin_altivec_vaddubm vec_vaddubm326327static __inline__ vector signed char __ATTRS_o_ai328vec_vaddubm(vector signed char __a, vector signed char __b) {329return __a + __b;330}331332static __inline__ vector signed char __ATTRS_o_ai333vec_vaddubm(vector bool char __a, vector signed char __b) {334return (vector signed char)__a + __b;335}336337static __inline__ vector signed char __ATTRS_o_ai338vec_vaddubm(vector signed char __a, vector bool char __b) {339return __a + (vector signed char)__b;340}341342static __inline__ vector unsigned char __ATTRS_o_ai343vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {344return __a + __b;345}346347static __inline__ vector unsigned char __ATTRS_o_ai348vec_vaddubm(vector bool char __a, vector unsigned char __b) {349return (vector unsigned char)__a + __b;350}351352static __inline__ vector unsigned char __ATTRS_o_ai353vec_vaddubm(vector unsigned char __a, vector bool char __b) {354return __a + (vector unsigned char)__b;355}356357/* vec_vadduhm */358359#define __builtin_altivec_vadduhm vec_vadduhm360361static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,362vector short __b) {363return __a + __b;364}365366static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,367vector short __b) {368return (vector short)__a + __b;369}370371static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,372vector bool short __b) {373return __a + (vector short)__b;374}375376static __inline__ vector unsigned short __ATTRS_o_ai377vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {378return __a + __b;379}380381static __inline__ vector unsigned short __ATTRS_o_ai382vec_vadduhm(vector bool short __a, vector unsigned short __b) {383return (vector unsigned short)__a + __b;384}385386static __inline__ vector unsigned short __ATTRS_o_ai387vec_vadduhm(vector unsigned short __a, vector bool short __b) {388return __a + (vector unsigned short)__b;389}390391/* vec_vadduwm */392393#define __builtin_altivec_vadduwm vec_vadduwm394395static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,396vector int __b) {397return __a + __b;398}399400static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,401vector int __b) {402return (vector int)__a + __b;403}404405static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,406vector bool int __b) {407return __a + (vector int)__b;408}409410static __inline__ vector unsigned int __ATTRS_o_ai411vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {412return __a + __b;413}414415static __inline__ vector unsigned int __ATTRS_o_ai416vec_vadduwm(vector bool int __a, vector unsigned int __b) {417return (vector unsigned int)__a + __b;418}419420static __inline__ vector unsigned int __ATTRS_o_ai421vec_vadduwm(vector unsigned int __a, vector bool int __b) {422return __a + (vector unsigned int)__b;423}424425/* vec_vaddfp */426427#define __builtin_altivec_vaddfp vec_vaddfp428429static __inline__ vector float __attribute__((__always_inline__))430vec_vaddfp(vector float __a, vector float __b) {431return __a + __b;432}433434/* vec_addc */435436static __inline__ vector signed int __ATTRS_o_ai437vec_addc(vector signed int __a, vector signed int __b) {438return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,439(vector unsigned int)__b);440}441442static __inline__ vector unsigned int __ATTRS_o_ai443vec_addc(vector unsigned int __a, vector unsigned int __b) {444return __builtin_altivec_vaddcuw(__a, __b);445}446447#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)448static __inline__ vector signed __int128 __ATTRS_o_ai449vec_addc(vector signed __int128 __a, vector signed __int128 __b) {450return (vector signed __int128)__builtin_altivec_vaddcuq(451(vector unsigned __int128)__a, (vector unsigned __int128)__b);452}453454static __inline__ vector unsigned __int128 __ATTRS_o_ai455vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {456return __builtin_altivec_vaddcuq(__a, __b);457}458#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)459460/* vec_vaddcuw */461462static __inline__ vector unsigned int __attribute__((__always_inline__))463vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {464return __builtin_altivec_vaddcuw(__a, __b);465}466467/* vec_adds */468469static __inline__ vector signed char __ATTRS_o_ai470vec_adds(vector signed char __a, vector signed char __b) {471return __builtin_altivec_vaddsbs(__a, __b);472}473474static __inline__ vector signed char __ATTRS_o_ai475vec_adds(vector bool char __a, vector signed char __b) {476return __builtin_altivec_vaddsbs((vector signed char)__a, __b);477}478479static __inline__ vector signed char __ATTRS_o_ai480vec_adds(vector signed char __a, vector bool char __b) {481return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);482}483484static __inline__ vector unsigned char __ATTRS_o_ai485vec_adds(vector unsigned char __a, vector unsigned char __b) {486return __builtin_altivec_vaddubs(__a, __b);487}488489static __inline__ vector unsigned char __ATTRS_o_ai490vec_adds(vector bool char __a, vector unsigned char __b) {491return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);492}493494static __inline__ vector unsigned char __ATTRS_o_ai495vec_adds(vector unsigned char __a, vector bool char __b) {496return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);497}498499static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,500vector short __b) {501return __builtin_altivec_vaddshs(__a, __b);502}503504static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,505vector short __b) {506return __builtin_altivec_vaddshs((vector short)__a, __b);507}508509static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,510vector bool short __b) {511return __builtin_altivec_vaddshs(__a, (vector short)__b);512}513514static __inline__ vector unsigned short __ATTRS_o_ai515vec_adds(vector unsigned short __a, vector unsigned short __b) {516return __builtin_altivec_vadduhs(__a, __b);517}518519static __inline__ vector unsigned short __ATTRS_o_ai520vec_adds(vector bool short __a, vector unsigned short __b) {521return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);522}523524static __inline__ vector unsigned short __ATTRS_o_ai525vec_adds(vector unsigned short __a, vector bool short __b) {526return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);527}528529static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,530vector int __b) {531return __builtin_altivec_vaddsws(__a, __b);532}533534static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,535vector int __b) {536return __builtin_altivec_vaddsws((vector int)__a, __b);537}538539static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,540vector bool int __b) {541return __builtin_altivec_vaddsws(__a, (vector int)__b);542}543544static __inline__ vector unsigned int __ATTRS_o_ai545vec_adds(vector unsigned int __a, vector unsigned int __b) {546return __builtin_altivec_vadduws(__a, __b);547}548549static __inline__ vector unsigned int __ATTRS_o_ai550vec_adds(vector bool int __a, vector unsigned int __b) {551return __builtin_altivec_vadduws((vector unsigned int)__a, __b);552}553554static __inline__ vector unsigned int __ATTRS_o_ai555vec_adds(vector unsigned int __a, vector bool int __b) {556return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);557}558559/* vec_vaddsbs */560561static __inline__ vector signed char __ATTRS_o_ai562vec_vaddsbs(vector signed char __a, vector signed char __b) {563return __builtin_altivec_vaddsbs(__a, __b);564}565566static __inline__ vector signed char __ATTRS_o_ai567vec_vaddsbs(vector bool char __a, vector signed char __b) {568return __builtin_altivec_vaddsbs((vector signed char)__a, __b);569}570571static __inline__ vector signed char __ATTRS_o_ai572vec_vaddsbs(vector signed char __a, vector bool char __b) {573return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);574}575576/* vec_vaddubs */577578static __inline__ vector unsigned char __ATTRS_o_ai579vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {580return __builtin_altivec_vaddubs(__a, __b);581}582583static __inline__ vector unsigned char __ATTRS_o_ai584vec_vaddubs(vector bool char __a, vector unsigned char __b) {585return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);586}587588static __inline__ vector unsigned char __ATTRS_o_ai589vec_vaddubs(vector unsigned char __a, vector bool char __b) {590return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);591}592593/* vec_vaddshs */594595static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,596vector short __b) {597return __builtin_altivec_vaddshs(__a, __b);598}599600static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,601vector short __b) {602return __builtin_altivec_vaddshs((vector short)__a, __b);603}604605static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,606vector bool short __b) {607return __builtin_altivec_vaddshs(__a, (vector short)__b);608}609610/* vec_vadduhs */611612static __inline__ vector unsigned short __ATTRS_o_ai613vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {614return __builtin_altivec_vadduhs(__a, __b);615}616617static __inline__ vector unsigned short __ATTRS_o_ai618vec_vadduhs(vector bool short __a, vector unsigned short __b) {619return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);620}621622static __inline__ vector unsigned short __ATTRS_o_ai623vec_vadduhs(vector unsigned short __a, vector bool short __b) {624return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);625}626627/* vec_vaddsws */628629static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,630vector int __b) {631return __builtin_altivec_vaddsws(__a, __b);632}633634static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,635vector int __b) {636return __builtin_altivec_vaddsws((vector int)__a, __b);637}638639static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,640vector bool int __b) {641return __builtin_altivec_vaddsws(__a, (vector int)__b);642}643644/* vec_vadduws */645646static __inline__ vector unsigned int __ATTRS_o_ai647vec_vadduws(vector unsigned int __a, vector unsigned int __b) {648return __builtin_altivec_vadduws(__a, __b);649}650651static __inline__ vector unsigned int __ATTRS_o_ai652vec_vadduws(vector bool int __a, vector unsigned int __b) {653return __builtin_altivec_vadduws((vector unsigned int)__a, __b);654}655656static __inline__ vector unsigned int __ATTRS_o_ai657vec_vadduws(vector unsigned int __a, vector bool int __b) {658return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);659}660661#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)662/* vec_vadduqm */663664static __inline__ vector signed __int128 __ATTRS_o_ai665vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {666return __a + __b;667}668669static __inline__ vector unsigned __int128 __ATTRS_o_ai670vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {671return __a + __b;672}673674/* vec_vaddeuqm */675676static __inline__ vector signed __int128 __ATTRS_o_ai677vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,678vector signed __int128 __c) {679return __builtin_altivec_vaddeuqm(__a, __b, __c);680}681682static __inline__ vector unsigned __int128 __ATTRS_o_ai683vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,684vector unsigned __int128 __c) {685return __builtin_altivec_vaddeuqm(__a, __b, __c);686}687688/* vec_vaddcuq */689690static __inline__ vector signed __int128 __ATTRS_o_ai691vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {692return __builtin_altivec_vaddcuq(__a, __b);693}694695static __inline__ vector unsigned __int128 __ATTRS_o_ai696vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {697return __builtin_altivec_vaddcuq(__a, __b);698}699700/* vec_vaddecuq */701702static __inline__ vector signed __int128 __ATTRS_o_ai703vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,704vector signed __int128 __c) {705return __builtin_altivec_vaddecuq(__a, __b, __c);706}707708static __inline__ vector unsigned __int128 __ATTRS_o_ai709vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,710vector unsigned __int128 __c) {711return __builtin_altivec_vaddecuq(__a, __b, __c);712}713#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)714715/* vec_and */716717#define __builtin_altivec_vand vec_and718719static __inline__ vector signed char __ATTRS_o_ai720vec_and(vector signed char __a, vector signed char __b) {721return __a & __b;722}723724static __inline__ vector signed char __ATTRS_o_ai725vec_and(vector bool char __a, vector signed char __b) {726return (vector signed char)__a & __b;727}728729static __inline__ vector signed char __ATTRS_o_ai730vec_and(vector signed char __a, vector bool char __b) {731return __a & (vector signed char)__b;732}733734static __inline__ vector unsigned char __ATTRS_o_ai735vec_and(vector unsigned char __a, vector unsigned char __b) {736return __a & __b;737}738739static __inline__ vector unsigned char __ATTRS_o_ai740vec_and(vector bool char __a, vector unsigned char __b) {741return (vector unsigned char)__a & __b;742}743744static __inline__ vector unsigned char __ATTRS_o_ai745vec_and(vector unsigned char __a, vector bool char __b) {746return __a & (vector unsigned char)__b;747}748749static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,750vector bool char __b) {751return __a & __b;752}753754static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,755vector short __b) {756return __a & __b;757}758759static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,760vector short __b) {761return (vector short)__a & __b;762}763764static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,765vector bool short __b) {766return __a & (vector short)__b;767}768769static __inline__ vector unsigned short __ATTRS_o_ai770vec_and(vector unsigned short __a, vector unsigned short __b) {771return __a & __b;772}773774static __inline__ vector unsigned short __ATTRS_o_ai775vec_and(vector bool short __a, vector unsigned short __b) {776return (vector unsigned short)__a & __b;777}778779static __inline__ vector unsigned short __ATTRS_o_ai780vec_and(vector unsigned short __a, vector bool short __b) {781return __a & (vector unsigned short)__b;782}783784static __inline__ vector bool short __ATTRS_o_ai785vec_and(vector bool short __a, vector bool short __b) {786return __a & __b;787}788789static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,790vector int __b) {791return __a & __b;792}793794static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,795vector int __b) {796return (vector int)__a & __b;797}798799static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,800vector bool int __b) {801return __a & (vector int)__b;802}803804static __inline__ vector unsigned int __ATTRS_o_ai805vec_and(vector unsigned int __a, vector unsigned int __b) {806return __a & __b;807}808809static __inline__ vector unsigned int __ATTRS_o_ai810vec_and(vector bool int __a, vector unsigned int __b) {811return (vector unsigned int)__a & __b;812}813814static __inline__ vector unsigned int __ATTRS_o_ai815vec_and(vector unsigned int __a, vector bool int __b) {816return __a & (vector unsigned int)__b;817}818819static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,820vector bool int __b) {821return __a & __b;822}823824static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,825vector float __b) {826vector unsigned int __res =827(vector unsigned int)__a & (vector unsigned int)__b;828return (vector float)__res;829}830831static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,832vector float __b) {833vector unsigned int __res =834(vector unsigned int)__a & (vector unsigned int)__b;835return (vector float)__res;836}837838static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,839vector bool int __b) {840vector unsigned int __res =841(vector unsigned int)__a & (vector unsigned int)__b;842return (vector float)__res;843}844845#ifdef __VSX__846static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,847vector double __b) {848vector unsigned long long __res =849(vector unsigned long long)__a & (vector unsigned long long)__b;850return (vector double)__res;851}852853static __inline__ vector double __ATTRS_o_ai854vec_and(vector double __a, vector bool long long __b) {855vector unsigned long long __res =856(vector unsigned long long)__a & (vector unsigned long long)__b;857return (vector double)__res;858}859860static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,861vector double __b) {862vector unsigned long long __res =863(vector unsigned long long)__a & (vector unsigned long long)__b;864return (vector double)__res;865}866867static __inline__ vector signed long long __ATTRS_o_ai868vec_and(vector signed long long __a, vector signed long long __b) {869return __a & __b;870}871872static __inline__ vector signed long long __ATTRS_o_ai873vec_and(vector bool long long __a, vector signed long long __b) {874return (vector signed long long)__a & __b;875}876877static __inline__ vector signed long long __ATTRS_o_ai878vec_and(vector signed long long __a, vector bool long long __b) {879return __a & (vector signed long long)__b;880}881882static __inline__ vector unsigned long long __ATTRS_o_ai883vec_and(vector unsigned long long __a, vector unsigned long long __b) {884return __a & __b;885}886887static __inline__ vector unsigned long long __ATTRS_o_ai888vec_and(vector bool long long __a, vector unsigned long long __b) {889return (vector unsigned long long)__a & __b;890}891892static __inline__ vector unsigned long long __ATTRS_o_ai893vec_and(vector unsigned long long __a, vector bool long long __b) {894return __a & (vector unsigned long long)__b;895}896897static __inline__ vector bool long long __ATTRS_o_ai898vec_and(vector bool long long __a, vector bool long long __b) {899return __a & __b;900}901#endif902903/* vec_vand */904905static __inline__ vector signed char __ATTRS_o_ai906vec_vand(vector signed char __a, vector signed char __b) {907return __a & __b;908}909910static __inline__ vector signed char __ATTRS_o_ai911vec_vand(vector bool char __a, vector signed char __b) {912return (vector signed char)__a & __b;913}914915static __inline__ vector signed char __ATTRS_o_ai916vec_vand(vector signed char __a, vector bool char __b) {917return __a & (vector signed char)__b;918}919920static __inline__ vector unsigned char __ATTRS_o_ai921vec_vand(vector unsigned char __a, vector unsigned char __b) {922return __a & __b;923}924925static __inline__ vector unsigned char __ATTRS_o_ai926vec_vand(vector bool char __a, vector unsigned char __b) {927return (vector unsigned char)__a & __b;928}929930static __inline__ vector unsigned char __ATTRS_o_ai931vec_vand(vector unsigned char __a, vector bool char __b) {932return __a & (vector unsigned char)__b;933}934935static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,936vector bool char __b) {937return __a & __b;938}939940static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,941vector short __b) {942return __a & __b;943}944945static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,946vector short __b) {947return (vector short)__a & __b;948}949950static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,951vector bool short __b) {952return __a & (vector short)__b;953}954955static __inline__ vector unsigned short __ATTRS_o_ai956vec_vand(vector unsigned short __a, vector unsigned short __b) {957return __a & __b;958}959960static __inline__ vector unsigned short __ATTRS_o_ai961vec_vand(vector bool short __a, vector unsigned short __b) {962return (vector unsigned short)__a & __b;963}964965static __inline__ vector unsigned short __ATTRS_o_ai966vec_vand(vector unsigned short __a, vector bool short __b) {967return __a & (vector unsigned short)__b;968}969970static __inline__ vector bool short __ATTRS_o_ai971vec_vand(vector bool short __a, vector bool short __b) {972return __a & __b;973}974975static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,976vector int __b) {977return __a & __b;978}979980static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,981vector int __b) {982return (vector int)__a & __b;983}984985static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,986vector bool int __b) {987return __a & (vector int)__b;988}989990static __inline__ vector unsigned int __ATTRS_o_ai991vec_vand(vector unsigned int __a, vector unsigned int __b) {992return __a & __b;993}994995static __inline__ vector unsigned int __ATTRS_o_ai996vec_vand(vector bool int __a, vector unsigned int __b) {997return (vector unsigned int)__a & __b;998}9991000static __inline__ vector unsigned int __ATTRS_o_ai1001vec_vand(vector unsigned int __a, vector bool int __b) {1002return __a & (vector unsigned int)__b;1003}10041005static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,1006vector bool int __b) {1007return __a & __b;1008}10091010static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,1011vector float __b) {1012vector unsigned int __res =1013(vector unsigned int)__a & (vector unsigned int)__b;1014return (vector float)__res;1015}10161017static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,1018vector float __b) {1019vector unsigned int __res =1020(vector unsigned int)__a & (vector unsigned int)__b;1021return (vector float)__res;1022}10231024static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,1025vector bool int __b) {1026vector unsigned int __res =1027(vector unsigned int)__a & (vector unsigned int)__b;1028return (vector float)__res;1029}10301031#ifdef __VSX__1032static __inline__ vector signed long long __ATTRS_o_ai1033vec_vand(vector signed long long __a, vector signed long long __b) {1034return __a & __b;1035}10361037static __inline__ vector signed long long __ATTRS_o_ai1038vec_vand(vector bool long long __a, vector signed long long __b) {1039return (vector signed long long)__a & __b;1040}10411042static __inline__ vector signed long long __ATTRS_o_ai1043vec_vand(vector signed long long __a, vector bool long long __b) {1044return __a & (vector signed long long)__b;1045}10461047static __inline__ vector unsigned long long __ATTRS_o_ai1048vec_vand(vector unsigned long long __a, vector unsigned long long __b) {1049return __a & __b;1050}10511052static __inline__ vector unsigned long long __ATTRS_o_ai1053vec_vand(vector bool long long __a, vector unsigned long long __b) {1054return (vector unsigned long long)__a & __b;1055}10561057static __inline__ vector unsigned long long __ATTRS_o_ai1058vec_vand(vector unsigned long long __a, vector bool long long __b) {1059return __a & (vector unsigned long long)__b;1060}10611062static __inline__ vector bool long long __ATTRS_o_ai1063vec_vand(vector bool long long __a, vector bool long long __b) {1064return __a & __b;1065}1066#endif10671068/* vec_andc */10691070#define __builtin_altivec_vandc vec_andc10711072static __inline__ vector signed char __ATTRS_o_ai1073vec_andc(vector signed char __a, vector signed char __b) {1074return __a & ~__b;1075}10761077static __inline__ vector signed char __ATTRS_o_ai1078vec_andc(vector bool char __a, vector signed char __b) {1079return (vector signed char)__a & ~__b;1080}10811082static __inline__ vector signed char __ATTRS_o_ai1083vec_andc(vector signed char __a, vector bool char __b) {1084return __a & ~(vector signed char)__b;1085}10861087static __inline__ vector unsigned char __ATTRS_o_ai1088vec_andc(vector unsigned char __a, vector unsigned char __b) {1089return __a & ~__b;1090}10911092static __inline__ vector unsigned char __ATTRS_o_ai1093vec_andc(vector bool char __a, vector unsigned char __b) {1094return (vector unsigned char)__a & ~__b;1095}10961097static __inline__ vector unsigned char __ATTRS_o_ai1098vec_andc(vector unsigned char __a, vector bool char __b) {1099return __a & ~(vector unsigned char)__b;1100}11011102static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,1103vector bool char __b) {1104return __a & ~__b;1105}11061107static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,1108vector short __b) {1109return __a & ~__b;1110}11111112static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,1113vector short __b) {1114return (vector short)__a & ~__b;1115}11161117static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,1118vector bool short __b) {1119return __a & ~(vector short)__b;1120}11211122static __inline__ vector unsigned short __ATTRS_o_ai1123vec_andc(vector unsigned short __a, vector unsigned short __b) {1124return __a & ~__b;1125}11261127static __inline__ vector unsigned short __ATTRS_o_ai1128vec_andc(vector bool short __a, vector unsigned short __b) {1129return (vector unsigned short)__a & ~__b;1130}11311132static __inline__ vector unsigned short __ATTRS_o_ai1133vec_andc(vector unsigned short __a, vector bool short __b) {1134return __a & ~(vector unsigned short)__b;1135}11361137static __inline__ vector bool short __ATTRS_o_ai1138vec_andc(vector bool short __a, vector bool short __b) {1139return __a & ~__b;1140}11411142static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,1143vector int __b) {1144return __a & ~__b;1145}11461147static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,1148vector int __b) {1149return (vector int)__a & ~__b;1150}11511152static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,1153vector bool int __b) {1154return __a & ~(vector int)__b;1155}11561157static __inline__ vector unsigned int __ATTRS_o_ai1158vec_andc(vector unsigned int __a, vector unsigned int __b) {1159return __a & ~__b;1160}11611162static __inline__ vector unsigned int __ATTRS_o_ai1163vec_andc(vector bool int __a, vector unsigned int __b) {1164return (vector unsigned int)__a & ~__b;1165}11661167static __inline__ vector unsigned int __ATTRS_o_ai1168vec_andc(vector unsigned int __a, vector bool int __b) {1169return __a & ~(vector unsigned int)__b;1170}11711172static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,1173vector bool int __b) {1174return __a & ~__b;1175}11761177static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,1178vector float __b) {1179vector unsigned int __res =1180(vector unsigned int)__a & ~(vector unsigned int)__b;1181return (vector float)__res;1182}11831184static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,1185vector float __b) {1186vector unsigned int __res =1187(vector unsigned int)__a & ~(vector unsigned int)__b;1188return (vector float)__res;1189}11901191static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,1192vector bool int __b) {1193vector unsigned int __res =1194(vector unsigned int)__a & ~(vector unsigned int)__b;1195return (vector float)__res;1196}11971198#ifdef __VSX__1199static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,1200vector double __b) {1201vector unsigned long long __res =1202(vector unsigned long long)__a & ~(vector unsigned long long)__b;1203return (vector double)__res;1204}12051206static __inline__ vector double __ATTRS_o_ai1207vec_andc(vector double __a, vector bool long long __b) {1208vector unsigned long long __res =1209(vector unsigned long long)__a & ~(vector unsigned long long)__b;1210return (vector double)__res;1211}12121213static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,1214vector double __b) {1215vector unsigned long long __res =1216(vector unsigned long long)__a & ~(vector unsigned long long)__b;1217return (vector double)__res;1218}12191220static __inline__ vector signed long long __ATTRS_o_ai1221vec_andc(vector signed long long __a, vector signed long long __b) {1222return __a & ~__b;1223}12241225static __inline__ vector signed long long __ATTRS_o_ai1226vec_andc(vector bool long long __a, vector signed long long __b) {1227return (vector signed long long)__a & ~__b;1228}12291230static __inline__ vector signed long long __ATTRS_o_ai1231vec_andc(vector signed long long __a, vector bool long long __b) {1232return __a & ~(vector signed long long)__b;1233}12341235static __inline__ vector unsigned long long __ATTRS_o_ai1236vec_andc(vector unsigned long long __a, vector unsigned long long __b) {1237return __a & ~__b;1238}12391240static __inline__ vector unsigned long long __ATTRS_o_ai1241vec_andc(vector bool long long __a, vector unsigned long long __b) {1242return (vector unsigned long long)__a & ~__b;1243}12441245static __inline__ vector unsigned long long __ATTRS_o_ai1246vec_andc(vector unsigned long long __a, vector bool long long __b) {1247return __a & ~(vector unsigned long long)__b;1248}12491250static __inline__ vector bool long long __ATTRS_o_ai1251vec_andc(vector bool long long __a, vector bool long long __b) {1252return __a & ~__b;1253}1254#endif12551256/* vec_vandc */12571258static __inline__ vector signed char __ATTRS_o_ai1259vec_vandc(vector signed char __a, vector signed char __b) {1260return __a & ~__b;1261}12621263static __inline__ vector signed char __ATTRS_o_ai1264vec_vandc(vector bool char __a, vector signed char __b) {1265return (vector signed char)__a & ~__b;1266}12671268static __inline__ vector signed char __ATTRS_o_ai1269vec_vandc(vector signed char __a, vector bool char __b) {1270return __a & ~(vector signed char)__b;1271}12721273static __inline__ vector unsigned char __ATTRS_o_ai1274vec_vandc(vector unsigned char __a, vector unsigned char __b) {1275return __a & ~__b;1276}12771278static __inline__ vector unsigned char __ATTRS_o_ai1279vec_vandc(vector bool char __a, vector unsigned char __b) {1280return (vector unsigned char)__a & ~__b;1281}12821283static __inline__ vector unsigned char __ATTRS_o_ai1284vec_vandc(vector unsigned char __a, vector bool char __b) {1285return __a & ~(vector unsigned char)__b;1286}12871288static __inline__ vector bool char __ATTRS_o_ai1289vec_vandc(vector bool char __a, vector bool char __b) {1290return __a & ~__b;1291}12921293static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,1294vector short __b) {1295return __a & ~__b;1296}12971298static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,1299vector short __b) {1300return (vector short)__a & ~__b;1301}13021303static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,1304vector bool short __b) {1305return __a & ~(vector short)__b;1306}13071308static __inline__ vector unsigned short __ATTRS_o_ai1309vec_vandc(vector unsigned short __a, vector unsigned short __b) {1310return __a & ~__b;1311}13121313static __inline__ vector unsigned short __ATTRS_o_ai1314vec_vandc(vector bool short __a, vector unsigned short __b) {1315return (vector unsigned short)__a & ~__b;1316}13171318static __inline__ vector unsigned short __ATTRS_o_ai1319vec_vandc(vector unsigned short __a, vector bool short __b) {1320return __a & ~(vector unsigned short)__b;1321}13221323static __inline__ vector bool short __ATTRS_o_ai1324vec_vandc(vector bool short __a, vector bool short __b) {1325return __a & ~__b;1326}13271328static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,1329vector int __b) {1330return __a & ~__b;1331}13321333static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,1334vector int __b) {1335return (vector int)__a & ~__b;1336}13371338static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,1339vector bool int __b) {1340return __a & ~(vector int)__b;1341}13421343static __inline__ vector unsigned int __ATTRS_o_ai1344vec_vandc(vector unsigned int __a, vector unsigned int __b) {1345return __a & ~__b;1346}13471348static __inline__ vector unsigned int __ATTRS_o_ai1349vec_vandc(vector bool int __a, vector unsigned int __b) {1350return (vector unsigned int)__a & ~__b;1351}13521353static __inline__ vector unsigned int __ATTRS_o_ai1354vec_vandc(vector unsigned int __a, vector bool int __b) {1355return __a & ~(vector unsigned int)__b;1356}13571358static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,1359vector bool int __b) {1360return __a & ~__b;1361}13621363static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,1364vector float __b) {1365vector unsigned int __res =1366(vector unsigned int)__a & ~(vector unsigned int)__b;1367return (vector float)__res;1368}13691370static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,1371vector float __b) {1372vector unsigned int __res =1373(vector unsigned int)__a & ~(vector unsigned int)__b;1374return (vector float)__res;1375}13761377static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,1378vector bool int __b) {1379vector unsigned int __res =1380(vector unsigned int)__a & ~(vector unsigned int)__b;1381return (vector float)__res;1382}13831384#ifdef __VSX__1385static __inline__ vector signed long long __ATTRS_o_ai1386vec_vandc(vector signed long long __a, vector signed long long __b) {1387return __a & ~__b;1388}13891390static __inline__ vector signed long long __ATTRS_o_ai1391vec_vandc(vector bool long long __a, vector signed long long __b) {1392return (vector signed long long)__a & ~__b;1393}13941395static __inline__ vector signed long long __ATTRS_o_ai1396vec_vandc(vector signed long long __a, vector bool long long __b) {1397return __a & ~(vector signed long long)__b;1398}13991400static __inline__ vector unsigned long long __ATTRS_o_ai1401vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {1402return __a & ~__b;1403}14041405static __inline__ vector unsigned long long __ATTRS_o_ai1406vec_vandc(vector bool long long __a, vector unsigned long long __b) {1407return (vector unsigned long long)__a & ~__b;1408}14091410static __inline__ vector unsigned long long __ATTRS_o_ai1411vec_vandc(vector unsigned long long __a, vector bool long long __b) {1412return __a & ~(vector unsigned long long)__b;1413}14141415static __inline__ vector bool long long __ATTRS_o_ai1416vec_vandc(vector bool long long __a, vector bool long long __b) {1417return __a & ~__b;1418}1419#endif14201421/* vec_avg */14221423static __inline__ vector signed char __ATTRS_o_ai1424vec_avg(vector signed char __a, vector signed char __b) {1425return __builtin_altivec_vavgsb(__a, __b);1426}14271428static __inline__ vector unsigned char __ATTRS_o_ai1429vec_avg(vector unsigned char __a, vector unsigned char __b) {1430return __builtin_altivec_vavgub(__a, __b);1431}14321433static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,1434vector short __b) {1435return __builtin_altivec_vavgsh(__a, __b);1436}14371438static __inline__ vector unsigned short __ATTRS_o_ai1439vec_avg(vector unsigned short __a, vector unsigned short __b) {1440return __builtin_altivec_vavguh(__a, __b);1441}14421443static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,1444vector int __b) {1445return __builtin_altivec_vavgsw(__a, __b);1446}14471448static __inline__ vector unsigned int __ATTRS_o_ai1449vec_avg(vector unsigned int __a, vector unsigned int __b) {1450return __builtin_altivec_vavguw(__a, __b);1451}14521453/* vec_vavgsb */14541455static __inline__ vector signed char __attribute__((__always_inline__))1456vec_vavgsb(vector signed char __a, vector signed char __b) {1457return __builtin_altivec_vavgsb(__a, __b);1458}14591460/* vec_vavgub */14611462static __inline__ vector unsigned char __attribute__((__always_inline__))1463vec_vavgub(vector unsigned char __a, vector unsigned char __b) {1464return __builtin_altivec_vavgub(__a, __b);1465}14661467/* vec_vavgsh */14681469static __inline__ vector short __attribute__((__always_inline__))1470vec_vavgsh(vector short __a, vector short __b) {1471return __builtin_altivec_vavgsh(__a, __b);1472}14731474/* vec_vavguh */14751476static __inline__ vector unsigned short __attribute__((__always_inline__))1477vec_vavguh(vector unsigned short __a, vector unsigned short __b) {1478return __builtin_altivec_vavguh(__a, __b);1479}14801481/* vec_vavgsw */14821483static __inline__ vector int __attribute__((__always_inline__))1484vec_vavgsw(vector int __a, vector int __b) {1485return __builtin_altivec_vavgsw(__a, __b);1486}14871488/* vec_vavguw */14891490static __inline__ vector unsigned int __attribute__((__always_inline__))1491vec_vavguw(vector unsigned int __a, vector unsigned int __b) {1492return __builtin_altivec_vavguw(__a, __b);1493}14941495/* vec_ceil */14961497static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {1498#ifdef __VSX__1499return __builtin_vsx_xvrspip(__a);1500#else1501return __builtin_altivec_vrfip(__a);1502#endif1503}15041505#ifdef __VSX__1506static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {1507return __builtin_vsx_xvrdpip(__a);1508}1509#endif15101511/* vec_vrfip */15121513static __inline__ vector float __attribute__((__always_inline__))1514vec_vrfip(vector float __a) {1515return __builtin_altivec_vrfip(__a);1516}15171518/* vec_cmpb */15191520static __inline__ vector int __attribute__((__always_inline__))1521vec_cmpb(vector float __a, vector float __b) {1522return __builtin_altivec_vcmpbfp(__a, __b);1523}15241525/* vec_vcmpbfp */15261527static __inline__ vector int __attribute__((__always_inline__))1528vec_vcmpbfp(vector float __a, vector float __b) {1529return __builtin_altivec_vcmpbfp(__a, __b);1530}15311532/* vec_cmpeq */15331534static __inline__ vector bool char __ATTRS_o_ai1535vec_cmpeq(vector signed char __a, vector signed char __b) {1536return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,1537(vector char)__b);1538}15391540static __inline__ vector bool char __ATTRS_o_ai1541vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {1542return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,1543(vector char)__b);1544}15451546static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,1547vector short __b) {1548return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);1549}15501551static __inline__ vector bool short __ATTRS_o_ai1552vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {1553return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,1554(vector short)__b);1555}15561557static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,1558vector int __b) {1559return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);1560}15611562static __inline__ vector bool int __ATTRS_o_ai1563vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {1564return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,1565(vector int)__b);1566}15671568#ifdef __POWER8_VECTOR__1569static __inline__ vector bool long long __ATTRS_o_ai1570vec_cmpeq(vector signed long long __a, vector signed long long __b) {1571return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);1572}15731574static __inline__ vector bool long long __ATTRS_o_ai1575vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {1576return (vector bool long long)__builtin_altivec_vcmpequd(1577(vector long long)__a, (vector long long)__b);1578}1579#endif15801581static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,1582vector float __b) {1583#ifdef __VSX__1584return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);1585#else1586return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);1587#endif1588}15891590#ifdef __VSX__1591static __inline__ vector bool long long __ATTRS_o_ai1592vec_cmpeq(vector double __a, vector double __b) {1593return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);1594}1595#endif15961597/* vec_cmpgt */15981599static __inline__ vector bool char __ATTRS_o_ai1600vec_cmpgt(vector signed char __a, vector signed char __b) {1601return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);1602}16031604static __inline__ vector bool char __ATTRS_o_ai1605vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {1606return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);1607}16081609static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,1610vector short __b) {1611return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);1612}16131614static __inline__ vector bool short __ATTRS_o_ai1615vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {1616return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);1617}16181619static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,1620vector int __b) {1621return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);1622}16231624static __inline__ vector bool int __ATTRS_o_ai1625vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {1626return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);1627}16281629#ifdef __POWER8_VECTOR__1630static __inline__ vector bool long long __ATTRS_o_ai1631vec_cmpgt(vector signed long long __a, vector signed long long __b) {1632return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);1633}16341635static __inline__ vector bool long long __ATTRS_o_ai1636vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {1637return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);1638}1639#endif16401641static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,1642vector float __b) {1643#ifdef __VSX__1644return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);1645#else1646return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);1647#endif1648}16491650#ifdef __VSX__1651static __inline__ vector bool long long __ATTRS_o_ai1652vec_cmpgt(vector double __a, vector double __b) {1653return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);1654}1655#endif16561657/* vec_cmpge */16581659static __inline__ vector bool char __ATTRS_o_ai1660vec_cmpge(vector signed char __a, vector signed char __b) {1661return ~(vec_cmpgt(__b, __a));1662}16631664static __inline__ vector bool char __ATTRS_o_ai1665vec_cmpge(vector unsigned char __a, vector unsigned char __b) {1666return ~(vec_cmpgt(__b, __a));1667}16681669static __inline__ vector bool short __ATTRS_o_ai1670vec_cmpge(vector signed short __a, vector signed short __b) {1671return ~(vec_cmpgt(__b, __a));1672}16731674static __inline__ vector bool short __ATTRS_o_ai1675vec_cmpge(vector unsigned short __a, vector unsigned short __b) {1676return ~(vec_cmpgt(__b, __a));1677}16781679static __inline__ vector bool int __ATTRS_o_ai1680vec_cmpge(vector signed int __a, vector signed int __b) {1681return ~(vec_cmpgt(__b, __a));1682}16831684static __inline__ vector bool int __ATTRS_o_ai1685vec_cmpge(vector unsigned int __a, vector unsigned int __b) {1686return ~(vec_cmpgt(__b, __a));1687}16881689static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,1690vector float __b) {1691#ifdef __VSX__1692return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);1693#else1694return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);1695#endif1696}16971698#ifdef __VSX__1699static __inline__ vector bool long long __ATTRS_o_ai1700vec_cmpge(vector double __a, vector double __b) {1701return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);1702}1703#endif17041705#ifdef __POWER8_VECTOR__1706static __inline__ vector bool long long __ATTRS_o_ai1707vec_cmpge(vector signed long long __a, vector signed long long __b) {1708return ~(vec_cmpgt(__b, __a));1709}17101711static __inline__ vector bool long long __ATTRS_o_ai1712vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {1713return ~(vec_cmpgt(__b, __a));1714}1715#endif17161717/* vec_vcmpgefp */17181719static __inline__ vector bool int __attribute__((__always_inline__))1720vec_vcmpgefp(vector float __a, vector float __b) {1721return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);1722}17231724/* vec_vcmpgtsb */17251726static __inline__ vector bool char __attribute__((__always_inline__))1727vec_vcmpgtsb(vector signed char __a, vector signed char __b) {1728return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);1729}17301731/* vec_vcmpgtub */17321733static __inline__ vector bool char __attribute__((__always_inline__))1734vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {1735return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);1736}17371738/* vec_vcmpgtsh */17391740static __inline__ vector bool short __attribute__((__always_inline__))1741vec_vcmpgtsh(vector short __a, vector short __b) {1742return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);1743}17441745/* vec_vcmpgtuh */17461747static __inline__ vector bool short __attribute__((__always_inline__))1748vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {1749return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);1750}17511752/* vec_vcmpgtsw */17531754static __inline__ vector bool int __attribute__((__always_inline__))1755vec_vcmpgtsw(vector int __a, vector int __b) {1756return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);1757}17581759/* vec_vcmpgtuw */17601761static __inline__ vector bool int __attribute__((__always_inline__))1762vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {1763return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);1764}17651766/* vec_vcmpgtfp */17671768static __inline__ vector bool int __attribute__((__always_inline__))1769vec_vcmpgtfp(vector float __a, vector float __b) {1770return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);1771}17721773/* vec_cmple */17741775static __inline__ vector bool char __ATTRS_o_ai1776vec_cmple(vector signed char __a, vector signed char __b) {1777return vec_cmpge(__b, __a);1778}17791780static __inline__ vector bool char __ATTRS_o_ai1781vec_cmple(vector unsigned char __a, vector unsigned char __b) {1782return vec_cmpge(__b, __a);1783}17841785static __inline__ vector bool short __ATTRS_o_ai1786vec_cmple(vector signed short __a, vector signed short __b) {1787return vec_cmpge(__b, __a);1788}17891790static __inline__ vector bool short __ATTRS_o_ai1791vec_cmple(vector unsigned short __a, vector unsigned short __b) {1792return vec_cmpge(__b, __a);1793}17941795static __inline__ vector bool int __ATTRS_o_ai1796vec_cmple(vector signed int __a, vector signed int __b) {1797return vec_cmpge(__b, __a);1798}17991800static __inline__ vector bool int __ATTRS_o_ai1801vec_cmple(vector unsigned int __a, vector unsigned int __b) {1802return vec_cmpge(__b, __a);1803}18041805static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,1806vector float __b) {1807return vec_cmpge(__b, __a);1808}18091810#ifdef __VSX__1811static __inline__ vector bool long long __ATTRS_o_ai1812vec_cmple(vector double __a, vector double __b) {1813return vec_cmpge(__b, __a);1814}1815#endif18161817#ifdef __POWER8_VECTOR__1818static __inline__ vector bool long long __ATTRS_o_ai1819vec_cmple(vector signed long long __a, vector signed long long __b) {1820return vec_cmpge(__b, __a);1821}18221823static __inline__ vector bool long long __ATTRS_o_ai1824vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {1825return vec_cmpge(__b, __a);1826}1827#endif18281829/* vec_cmplt */18301831static __inline__ vector bool char __ATTRS_o_ai1832vec_cmplt(vector signed char __a, vector signed char __b) {1833return vec_cmpgt(__b, __a);1834}18351836static __inline__ vector bool char __ATTRS_o_ai1837vec_cmplt(vector unsigned char __a, vector unsigned char __b) {1838return vec_cmpgt(__b, __a);1839}18401841static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,1842vector short __b) {1843return vec_cmpgt(__b, __a);1844}18451846static __inline__ vector bool short __ATTRS_o_ai1847vec_cmplt(vector unsigned short __a, vector unsigned short __b) {1848return vec_cmpgt(__b, __a);1849}18501851static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,1852vector int __b) {1853return vec_cmpgt(__b, __a);1854}18551856static __inline__ vector bool int __ATTRS_o_ai1857vec_cmplt(vector unsigned int __a, vector unsigned int __b) {1858return vec_cmpgt(__b, __a);1859}18601861static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,1862vector float __b) {1863return vec_cmpgt(__b, __a);1864}18651866#ifdef __VSX__1867static __inline__ vector bool long long __ATTRS_o_ai1868vec_cmplt(vector double __a, vector double __b) {1869return vec_cmpgt(__b, __a);1870}1871#endif18721873#ifdef __POWER8_VECTOR__1874static __inline__ vector bool long long __ATTRS_o_ai1875vec_cmplt(vector signed long long __a, vector signed long long __b) {1876return vec_cmpgt(__b, __a);1877}18781879static __inline__ vector bool long long __ATTRS_o_ai1880vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {1881return vec_cmpgt(__b, __a);1882}18831884/* vec_cntlz */18851886static __inline__ vector signed char __ATTRS_o_ai1887vec_cntlz(vector signed char __a) {1888return __builtin_altivec_vclzb(__a);1889}1890static __inline__ vector unsigned char __ATTRS_o_ai1891vec_cntlz(vector unsigned char __a) {1892return __builtin_altivec_vclzb(__a);1893}1894static __inline__ vector signed short __ATTRS_o_ai1895vec_cntlz(vector signed short __a) {1896return __builtin_altivec_vclzh(__a);1897}1898static __inline__ vector unsigned short __ATTRS_o_ai1899vec_cntlz(vector unsigned short __a) {1900return __builtin_altivec_vclzh(__a);1901}1902static __inline__ vector signed int __ATTRS_o_ai1903vec_cntlz(vector signed int __a) {1904return __builtin_altivec_vclzw(__a);1905}1906static __inline__ vector unsigned int __ATTRS_o_ai1907vec_cntlz(vector unsigned int __a) {1908return __builtin_altivec_vclzw(__a);1909}1910static __inline__ vector signed long long __ATTRS_o_ai1911vec_cntlz(vector signed long long __a) {1912return __builtin_altivec_vclzd(__a);1913}1914static __inline__ vector unsigned long long __ATTRS_o_ai1915vec_cntlz(vector unsigned long long __a) {1916return __builtin_altivec_vclzd(__a);1917}1918#endif19191920/* vec_cpsgn */19211922#ifdef __VSX__1923static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,1924vector float __b) {1925return __builtin_vsx_xvcpsgnsp(__a, __b);1926}19271928static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,1929vector double __b) {1930return __builtin_vsx_xvcpsgndp(__a, __b);1931}1932#endif19331934/* vec_ctf */19351936static __inline__ vector float __ATTRS_o_ai vec_ctf(vector int __a, int __b) {1937return __builtin_altivec_vcfsx(__a, __b);1938}19391940static __inline__ vector float __ATTRS_o_ai vec_ctf(vector unsigned int __a,1941int __b) {1942return __builtin_altivec_vcfux((vector int)__a, __b);1943}19441945#ifdef __VSX__1946static __inline__ vector double __ATTRS_o_ai1947vec_ctf(vector unsigned long long __a, int __b) {1948vector double __ret = __builtin_convertvector(__a, vector double);1949__ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);1950return __ret;1951}19521953static __inline__ vector double __ATTRS_o_ai1954vec_ctf(vector signed long long __a, int __b) {1955vector double __ret = __builtin_convertvector(__a, vector double);1956__ret *= (vector double)(vector unsigned long long)((0x3ffULL - __b) << 52);1957return __ret;1958}1959#endif19601961/* vec_vcfsx */19621963static __inline__ vector float __attribute__((__always_inline__))1964vec_vcfsx(vector int __a, int __b) {1965return __builtin_altivec_vcfsx(__a, __b);1966}19671968/* vec_vcfux */19691970static __inline__ vector float __attribute__((__always_inline__))1971vec_vcfux(vector unsigned int __a, int __b) {1972return __builtin_altivec_vcfux((vector int)__a, __b);1973}19741975/* vec_cts */19761977static __inline__ vector int __ATTRS_o_ai vec_cts(vector float __a, int __b) {1978return __builtin_altivec_vctsxs(__a, __b);1979}19801981#ifdef __VSX__1982static __inline__ vector signed long long __ATTRS_o_ai1983vec_cts(vector double __a, int __b) {1984__a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);1985return __builtin_convertvector(__a, vector signed long long);1986}1987#endif19881989/* vec_vctsxs */19901991static __inline__ vector int __attribute__((__always_inline__))1992vec_vctsxs(vector float __a, int __b) {1993return __builtin_altivec_vctsxs(__a, __b);1994}19951996/* vec_ctu */19971998static __inline__ vector unsigned int __ATTRS_o_ai vec_ctu(vector float __a,1999int __b) {2000return __builtin_altivec_vctuxs(__a, __b);2001}20022003#ifdef __VSX__2004static __inline__ vector unsigned long long __ATTRS_o_ai2005vec_ctu(vector double __a, int __b) {2006__a *= (vector double)(vector unsigned long long)((0x3ffULL + __b) << 52);2007return __builtin_convertvector(__a, vector unsigned long long);2008}2009#endif20102011/* vec_vctuxs */20122013static __inline__ vector unsigned int __attribute__((__always_inline__))2014vec_vctuxs(vector float __a, int __b) {2015return __builtin_altivec_vctuxs(__a, __b);2016}20172018/* vec_double */20192020#ifdef __VSX__2021static __inline__ vector double __ATTRS_o_ai2022vec_double(vector signed long long __a) {2023vector double __ret = {__a[0], __a[1]};2024return __ret;2025}20262027static __inline__ vector double __ATTRS_o_ai2028vec_double(vector unsigned long long __a) {2029vector double __ret = {__a[0], __a[1]};2030return __ret;2031}2032#endif20332034/* vec_div */20352036/* Integer vector divides (vectors are scalarized, elements divided2037and the vectors reassembled).2038*/2039static __inline__ vector signed char __ATTRS_o_ai2040vec_div(vector signed char __a, vector signed char __b) {2041return __a / __b;2042}20432044static __inline__ vector unsigned char __ATTRS_o_ai2045vec_div(vector unsigned char __a, vector unsigned char __b) {2046return __a / __b;2047}20482049static __inline__ vector signed short __ATTRS_o_ai2050vec_div(vector signed short __a, vector signed short __b) {2051return __a / __b;2052}20532054static __inline__ vector unsigned short __ATTRS_o_ai2055vec_div(vector unsigned short __a, vector unsigned short __b) {2056return __a / __b;2057}20582059static __inline__ vector signed int __ATTRS_o_ai2060vec_div(vector signed int __a, vector signed int __b) {2061return __a / __b;2062}20632064static __inline__ vector unsigned int __ATTRS_o_ai2065vec_div(vector unsigned int __a, vector unsigned int __b) {2066return __a / __b;2067}20682069#ifdef __VSX__2070static __inline__ vector signed long long __ATTRS_o_ai2071vec_div(vector signed long long __a, vector signed long long __b) {2072return __a / __b;2073}20742075static __inline__ vector unsigned long long __ATTRS_o_ai2076vec_div(vector unsigned long long __a, vector unsigned long long __b) {2077return __a / __b;2078}20792080static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,2081vector float __b) {2082return __a / __b;2083}20842085static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,2086vector double __b) {2087return __a / __b;2088}2089#endif20902091/* vec_dss */20922093static __inline__ void __attribute__((__always_inline__)) vec_dss(int __a) {2094__builtin_altivec_dss(__a);2095}20962097/* vec_dssall */20982099static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {2100__builtin_altivec_dssall();2101}21022103/* vec_dst */2104#define vec_dst(__PTR, __CW, __STR) \2105__extension__( \2106{ __builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR)); })21072108/* vec_dstst */2109#define vec_dstst(__PTR, __CW, __STR) \2110__extension__( \2111{ __builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR)); })21122113/* vec_dststt */2114#define vec_dststt(__PTR, __CW, __STR) \2115__extension__( \2116{ __builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR)); })21172118/* vec_dstt */2119#define vec_dstt(__PTR, __CW, __STR) \2120__extension__( \2121{ __builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR)); })21222123/* vec_eqv */21242125#ifdef __POWER8_VECTOR__2126static __inline__ vector signed char __ATTRS_o_ai2127vec_eqv(vector signed char __a, vector signed char __b) {2128return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,2129(vector unsigned int)__b);2130}21312132static __inline__ vector unsigned char __ATTRS_o_ai2133vec_eqv(vector unsigned char __a, vector unsigned char __b) {2134return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,2135(vector unsigned int)__b);2136}21372138static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,2139vector bool char __b) {2140return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,2141(vector unsigned int)__b);2142}21432144static __inline__ vector signed short __ATTRS_o_ai2145vec_eqv(vector signed short __a, vector signed short __b) {2146return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,2147(vector unsigned int)__b);2148}21492150static __inline__ vector unsigned short __ATTRS_o_ai2151vec_eqv(vector unsigned short __a, vector unsigned short __b) {2152return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,2153(vector unsigned int)__b);2154}21552156static __inline__ vector bool short __ATTRS_o_ai2157vec_eqv(vector bool short __a, vector bool short __b) {2158return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,2159(vector unsigned int)__b);2160}21612162static __inline__ vector signed int __ATTRS_o_ai2163vec_eqv(vector signed int __a, vector signed int __b) {2164return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,2165(vector unsigned int)__b);2166}21672168static __inline__ vector unsigned int __ATTRS_o_ai2169vec_eqv(vector unsigned int __a, vector unsigned int __b) {2170return __builtin_vsx_xxleqv(__a, __b);2171}21722173static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,2174vector bool int __b) {2175return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,2176(vector unsigned int)__b);2177}21782179static __inline__ vector signed long long __ATTRS_o_ai2180vec_eqv(vector signed long long __a, vector signed long long __b) {2181return (vector signed long long)__builtin_vsx_xxleqv(2182(vector unsigned int)__a, (vector unsigned int)__b);2183}21842185static __inline__ vector unsigned long long __ATTRS_o_ai2186vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {2187return (vector unsigned long long)__builtin_vsx_xxleqv(2188(vector unsigned int)__a, (vector unsigned int)__b);2189}21902191static __inline__ vector bool long long __ATTRS_o_ai2192vec_eqv(vector bool long long __a, vector bool long long __b) {2193return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,2194(vector unsigned int)__b);2195}21962197static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,2198vector float __b) {2199return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,2200(vector unsigned int)__b);2201}22022203static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,2204vector double __b) {2205return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,2206(vector unsigned int)__b);2207}2208#endif22092210/* vec_expte */22112212static __inline__ vector float __attribute__((__always_inline__))2213vec_expte(vector float __a) {2214return __builtin_altivec_vexptefp(__a);2215}22162217/* vec_vexptefp */22182219static __inline__ vector float __attribute__((__always_inline__))2220vec_vexptefp(vector float __a) {2221return __builtin_altivec_vexptefp(__a);2222}22232224/* vec_floor */22252226static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {2227#ifdef __VSX__2228return __builtin_vsx_xvrspim(__a);2229#else2230return __builtin_altivec_vrfim(__a);2231#endif2232}22332234#ifdef __VSX__2235static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {2236return __builtin_vsx_xvrdpim(__a);2237}2238#endif22392240/* vec_vrfim */22412242static __inline__ vector float __attribute__((__always_inline__))2243vec_vrfim(vector float __a) {2244return __builtin_altivec_vrfim(__a);2245}22462247/* vec_ld */22482249static __inline__ vector signed char __ATTRS_o_ai2250vec_ld(int __a, const vector signed char *__b) {2251return (vector signed char)__builtin_altivec_lvx(__a, __b);2252}22532254static __inline__ vector signed char __ATTRS_o_ai2255vec_ld(int __a, const signed char *__b) {2256return (vector signed char)__builtin_altivec_lvx(__a, __b);2257}22582259static __inline__ vector unsigned char __ATTRS_o_ai2260vec_ld(int __a, const vector unsigned char *__b) {2261return (vector unsigned char)__builtin_altivec_lvx(__a, __b);2262}22632264static __inline__ vector unsigned char __ATTRS_o_ai2265vec_ld(int __a, const unsigned char *__b) {2266return (vector unsigned char)__builtin_altivec_lvx(__a, __b);2267}22682269static __inline__ vector bool char __ATTRS_o_ai2270vec_ld(int __a, const vector bool char *__b) {2271return (vector bool char)__builtin_altivec_lvx(__a, __b);2272}22732274static __inline__ vector short __ATTRS_o_ai vec_ld(int __a,2275const vector short *__b) {2276return (vector short)__builtin_altivec_lvx(__a, __b);2277}22782279static __inline__ vector short __ATTRS_o_ai vec_ld(int __a, const short *__b) {2280return (vector short)__builtin_altivec_lvx(__a, __b);2281}22822283static __inline__ vector unsigned short __ATTRS_o_ai2284vec_ld(int __a, const vector unsigned short *__b) {2285return (vector unsigned short)__builtin_altivec_lvx(__a, __b);2286}22872288static __inline__ vector unsigned short __ATTRS_o_ai2289vec_ld(int __a, const unsigned short *__b) {2290return (vector unsigned short)__builtin_altivec_lvx(__a, __b);2291}22922293static __inline__ vector bool short __ATTRS_o_ai2294vec_ld(int __a, const vector bool short *__b) {2295return (vector bool short)__builtin_altivec_lvx(__a, __b);2296}22972298static __inline__ vector pixel __ATTRS_o_ai vec_ld(int __a,2299const vector pixel *__b) {2300return (vector pixel)__builtin_altivec_lvx(__a, __b);2301}23022303static __inline__ vector int __ATTRS_o_ai vec_ld(int __a,2304const vector int *__b) {2305return (vector int)__builtin_altivec_lvx(__a, __b);2306}23072308static __inline__ vector int __ATTRS_o_ai vec_ld(int __a, const int *__b) {2309return (vector int)__builtin_altivec_lvx(__a, __b);2310}23112312static __inline__ vector unsigned int __ATTRS_o_ai2313vec_ld(int __a, const vector unsigned int *__b) {2314return (vector unsigned int)__builtin_altivec_lvx(__a, __b);2315}23162317static __inline__ vector unsigned int __ATTRS_o_ai2318vec_ld(int __a, const unsigned int *__b) {2319return (vector unsigned int)__builtin_altivec_lvx(__a, __b);2320}23212322static __inline__ vector bool int __ATTRS_o_ai2323vec_ld(int __a, const vector bool int *__b) {2324return (vector bool int)__builtin_altivec_lvx(__a, __b);2325}23262327static __inline__ vector float __ATTRS_o_ai vec_ld(int __a,2328const vector float *__b) {2329return (vector float)__builtin_altivec_lvx(__a, __b);2330}23312332static __inline__ vector float __ATTRS_o_ai vec_ld(int __a, const float *__b) {2333return (vector float)__builtin_altivec_lvx(__a, __b);2334}23352336/* vec_lvx */23372338static __inline__ vector signed char __ATTRS_o_ai2339vec_lvx(int __a, const vector signed char *__b) {2340return (vector signed char)__builtin_altivec_lvx(__a, __b);2341}23422343static __inline__ vector signed char __ATTRS_o_ai2344vec_lvx(int __a, const signed char *__b) {2345return (vector signed char)__builtin_altivec_lvx(__a, __b);2346}23472348static __inline__ vector unsigned char __ATTRS_o_ai2349vec_lvx(int __a, const vector unsigned char *__b) {2350return (vector unsigned char)__builtin_altivec_lvx(__a, __b);2351}23522353static __inline__ vector unsigned char __ATTRS_o_ai2354vec_lvx(int __a, const unsigned char *__b) {2355return (vector unsigned char)__builtin_altivec_lvx(__a, __b);2356}23572358static __inline__ vector bool char __ATTRS_o_ai2359vec_lvx(int __a, const vector bool char *__b) {2360return (vector bool char)__builtin_altivec_lvx(__a, __b);2361}23622363static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a,2364const vector short *__b) {2365return (vector short)__builtin_altivec_lvx(__a, __b);2366}23672368static __inline__ vector short __ATTRS_o_ai vec_lvx(int __a, const short *__b) {2369return (vector short)__builtin_altivec_lvx(__a, __b);2370}23712372static __inline__ vector unsigned short __ATTRS_o_ai2373vec_lvx(int __a, const vector unsigned short *__b) {2374return (vector unsigned short)__builtin_altivec_lvx(__a, __b);2375}23762377static __inline__ vector unsigned short __ATTRS_o_ai2378vec_lvx(int __a, const unsigned short *__b) {2379return (vector unsigned short)__builtin_altivec_lvx(__a, __b);2380}23812382static __inline__ vector bool short __ATTRS_o_ai2383vec_lvx(int __a, const vector bool short *__b) {2384return (vector bool short)__builtin_altivec_lvx(__a, __b);2385}23862387static __inline__ vector pixel __ATTRS_o_ai vec_lvx(int __a,2388const vector pixel *__b) {2389return (vector pixel)__builtin_altivec_lvx(__a, __b);2390}23912392static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a,2393const vector int *__b) {2394return (vector int)__builtin_altivec_lvx(__a, __b);2395}23962397static __inline__ vector int __ATTRS_o_ai vec_lvx(int __a, const int *__b) {2398return (vector int)__builtin_altivec_lvx(__a, __b);2399}24002401static __inline__ vector unsigned int __ATTRS_o_ai2402vec_lvx(int __a, const vector unsigned int *__b) {2403return (vector unsigned int)__builtin_altivec_lvx(__a, __b);2404}24052406static __inline__ vector unsigned int __ATTRS_o_ai2407vec_lvx(int __a, const unsigned int *__b) {2408return (vector unsigned int)__builtin_altivec_lvx(__a, __b);2409}24102411static __inline__ vector bool int __ATTRS_o_ai2412vec_lvx(int __a, const vector bool int *__b) {2413return (vector bool int)__builtin_altivec_lvx(__a, __b);2414}24152416static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a,2417const vector float *__b) {2418return (vector float)__builtin_altivec_lvx(__a, __b);2419}24202421static __inline__ vector float __ATTRS_o_ai vec_lvx(int __a, const float *__b) {2422return (vector float)__builtin_altivec_lvx(__a, __b);2423}24242425/* vec_lde */24262427static __inline__ vector signed char __ATTRS_o_ai2428vec_lde(int __a, const signed char *__b) {2429return (vector signed char)__builtin_altivec_lvebx(__a, __b);2430}24312432static __inline__ vector unsigned char __ATTRS_o_ai2433vec_lde(int __a, const unsigned char *__b) {2434return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);2435}24362437static __inline__ vector short __ATTRS_o_ai vec_lde(int __a, const short *__b) {2438return (vector short)__builtin_altivec_lvehx(__a, __b);2439}24402441static __inline__ vector unsigned short __ATTRS_o_ai2442vec_lde(int __a, const unsigned short *__b) {2443return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);2444}24452446static __inline__ vector int __ATTRS_o_ai vec_lde(int __a, const int *__b) {2447return (vector int)__builtin_altivec_lvewx(__a, __b);2448}24492450static __inline__ vector unsigned int __ATTRS_o_ai2451vec_lde(int __a, const unsigned int *__b) {2452return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);2453}24542455static __inline__ vector float __ATTRS_o_ai vec_lde(int __a, const float *__b) {2456return (vector float)__builtin_altivec_lvewx(__a, __b);2457}24582459/* vec_lvebx */24602461static __inline__ vector signed char __ATTRS_o_ai2462vec_lvebx(int __a, const signed char *__b) {2463return (vector signed char)__builtin_altivec_lvebx(__a, __b);2464}24652466static __inline__ vector unsigned char __ATTRS_o_ai2467vec_lvebx(int __a, const unsigned char *__b) {2468return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);2469}24702471/* vec_lvehx */24722473static __inline__ vector short __ATTRS_o_ai vec_lvehx(int __a,2474const short *__b) {2475return (vector short)__builtin_altivec_lvehx(__a, __b);2476}24772478static __inline__ vector unsigned short __ATTRS_o_ai2479vec_lvehx(int __a, const unsigned short *__b) {2480return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);2481}24822483/* vec_lvewx */24842485static __inline__ vector int __ATTRS_o_ai vec_lvewx(int __a, const int *__b) {2486return (vector int)__builtin_altivec_lvewx(__a, __b);2487}24882489static __inline__ vector unsigned int __ATTRS_o_ai2490vec_lvewx(int __a, const unsigned int *__b) {2491return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);2492}24932494static __inline__ vector float __ATTRS_o_ai vec_lvewx(int __a,2495const float *__b) {2496return (vector float)__builtin_altivec_lvewx(__a, __b);2497}24982499/* vec_ldl */25002501static __inline__ vector signed char __ATTRS_o_ai2502vec_ldl(int __a, const vector signed char *__b) {2503return (vector signed char)__builtin_altivec_lvxl(__a, __b);2504}25052506static __inline__ vector signed char __ATTRS_o_ai2507vec_ldl(int __a, const signed char *__b) {2508return (vector signed char)__builtin_altivec_lvxl(__a, __b);2509}25102511static __inline__ vector unsigned char __ATTRS_o_ai2512vec_ldl(int __a, const vector unsigned char *__b) {2513return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);2514}25152516static __inline__ vector unsigned char __ATTRS_o_ai2517vec_ldl(int __a, const unsigned char *__b) {2518return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);2519}25202521static __inline__ vector bool char __ATTRS_o_ai2522vec_ldl(int __a, const vector bool char *__b) {2523return (vector bool char)__builtin_altivec_lvxl(__a, __b);2524}25252526static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a,2527const vector short *__b) {2528return (vector short)__builtin_altivec_lvxl(__a, __b);2529}25302531static __inline__ vector short __ATTRS_o_ai vec_ldl(int __a, const short *__b) {2532return (vector short)__builtin_altivec_lvxl(__a, __b);2533}25342535static __inline__ vector unsigned short __ATTRS_o_ai2536vec_ldl(int __a, const vector unsigned short *__b) {2537return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);2538}25392540static __inline__ vector unsigned short __ATTRS_o_ai2541vec_ldl(int __a, const unsigned short *__b) {2542return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);2543}25442545static __inline__ vector bool short __ATTRS_o_ai2546vec_ldl(int __a, const vector bool short *__b) {2547return (vector bool short)__builtin_altivec_lvxl(__a, __b);2548}25492550static __inline__ vector pixel __ATTRS_o_ai vec_ldl(int __a,2551const vector pixel *__b) {2552return (vector pixel short)__builtin_altivec_lvxl(__a, __b);2553}25542555static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a,2556const vector int *__b) {2557return (vector int)__builtin_altivec_lvxl(__a, __b);2558}25592560static __inline__ vector int __ATTRS_o_ai vec_ldl(int __a, const int *__b) {2561return (vector int)__builtin_altivec_lvxl(__a, __b);2562}25632564static __inline__ vector unsigned int __ATTRS_o_ai2565vec_ldl(int __a, const vector unsigned int *__b) {2566return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);2567}25682569static __inline__ vector unsigned int __ATTRS_o_ai2570vec_ldl(int __a, const unsigned int *__b) {2571return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);2572}25732574static __inline__ vector bool int __ATTRS_o_ai2575vec_ldl(int __a, const vector bool int *__b) {2576return (vector bool int)__builtin_altivec_lvxl(__a, __b);2577}25782579static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a,2580const vector float *__b) {2581return (vector float)__builtin_altivec_lvxl(__a, __b);2582}25832584static __inline__ vector float __ATTRS_o_ai vec_ldl(int __a, const float *__b) {2585return (vector float)__builtin_altivec_lvxl(__a, __b);2586}25872588/* vec_lvxl */25892590static __inline__ vector signed char __ATTRS_o_ai2591vec_lvxl(int __a, const vector signed char *__b) {2592return (vector signed char)__builtin_altivec_lvxl(__a, __b);2593}25942595static __inline__ vector signed char __ATTRS_o_ai2596vec_lvxl(int __a, const signed char *__b) {2597return (vector signed char)__builtin_altivec_lvxl(__a, __b);2598}25992600static __inline__ vector unsigned char __ATTRS_o_ai2601vec_lvxl(int __a, const vector unsigned char *__b) {2602return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);2603}26042605static __inline__ vector unsigned char __ATTRS_o_ai2606vec_lvxl(int __a, const unsigned char *__b) {2607return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);2608}26092610static __inline__ vector bool char __ATTRS_o_ai2611vec_lvxl(int __a, const vector bool char *__b) {2612return (vector bool char)__builtin_altivec_lvxl(__a, __b);2613}26142615static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,2616const vector short *__b) {2617return (vector short)__builtin_altivec_lvxl(__a, __b);2618}26192620static __inline__ vector short __ATTRS_o_ai vec_lvxl(int __a,2621const short *__b) {2622return (vector short)__builtin_altivec_lvxl(__a, __b);2623}26242625static __inline__ vector unsigned short __ATTRS_o_ai2626vec_lvxl(int __a, const vector unsigned short *__b) {2627return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);2628}26292630static __inline__ vector unsigned short __ATTRS_o_ai2631vec_lvxl(int __a, const unsigned short *__b) {2632return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);2633}26342635static __inline__ vector bool short __ATTRS_o_ai2636vec_lvxl(int __a, const vector bool short *__b) {2637return (vector bool short)__builtin_altivec_lvxl(__a, __b);2638}26392640static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(int __a,2641const vector pixel *__b) {2642return (vector pixel)__builtin_altivec_lvxl(__a, __b);2643}26442645static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a,2646const vector int *__b) {2647return (vector int)__builtin_altivec_lvxl(__a, __b);2648}26492650static __inline__ vector int __ATTRS_o_ai vec_lvxl(int __a, const int *__b) {2651return (vector int)__builtin_altivec_lvxl(__a, __b);2652}26532654static __inline__ vector unsigned int __ATTRS_o_ai2655vec_lvxl(int __a, const vector unsigned int *__b) {2656return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);2657}26582659static __inline__ vector unsigned int __ATTRS_o_ai2660vec_lvxl(int __a, const unsigned int *__b) {2661return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);2662}26632664static __inline__ vector bool int __ATTRS_o_ai2665vec_lvxl(int __a, const vector bool int *__b) {2666return (vector bool int)__builtin_altivec_lvxl(__a, __b);2667}26682669static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,2670const vector float *__b) {2671return (vector float)__builtin_altivec_lvxl(__a, __b);2672}26732674static __inline__ vector float __ATTRS_o_ai vec_lvxl(int __a,2675const float *__b) {2676return (vector float)__builtin_altivec_lvxl(__a, __b);2677}26782679/* vec_loge */26802681static __inline__ vector float __attribute__((__always_inline__))2682vec_loge(vector float __a) {2683return __builtin_altivec_vlogefp(__a);2684}26852686/* vec_vlogefp */26872688static __inline__ vector float __attribute__((__always_inline__))2689vec_vlogefp(vector float __a) {2690return __builtin_altivec_vlogefp(__a);2691}26922693/* vec_lvsl */26942695#ifdef __LITTLE_ENDIAN__2696static __inline__ vector unsigned char __ATTRS_o_ai2697__attribute__((__deprecated__("use assignment for unaligned little endian \2698loads/stores"))) vec_lvsl(int __a, const signed char *__b) {2699vector unsigned char mask =2700(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2701vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27027, 6, 5, 4, 3, 2, 1, 0};2703return vec_perm(mask, mask, reverse);2704}2705#else2706static __inline__ vector unsigned char __ATTRS_o_ai2707vec_lvsl(int __a, const signed char *__b) {2708return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2709}2710#endif27112712#ifdef __LITTLE_ENDIAN__2713static __inline__ vector unsigned char __ATTRS_o_ai2714__attribute__((__deprecated__("use assignment for unaligned little endian \2715loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {2716vector unsigned char mask =2717(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2718vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27197, 6, 5, 4, 3, 2, 1, 0};2720return vec_perm(mask, mask, reverse);2721}2722#else2723static __inline__ vector unsigned char __ATTRS_o_ai2724vec_lvsl(int __a, const unsigned char *__b) {2725return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2726}2727#endif27282729#ifdef __LITTLE_ENDIAN__2730static __inline__ vector unsigned char __ATTRS_o_ai2731__attribute__((__deprecated__("use assignment for unaligned little endian \2732loads/stores"))) vec_lvsl(int __a, const short *__b) {2733vector unsigned char mask =2734(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2735vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27367, 6, 5, 4, 3, 2, 1, 0};2737return vec_perm(mask, mask, reverse);2738}2739#else2740static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,2741const short *__b) {2742return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2743}2744#endif27452746#ifdef __LITTLE_ENDIAN__2747static __inline__ vector unsigned char __ATTRS_o_ai2748__attribute__((__deprecated__("use assignment for unaligned little endian \2749loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {2750vector unsigned char mask =2751(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2752vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27537, 6, 5, 4, 3, 2, 1, 0};2754return vec_perm(mask, mask, reverse);2755}2756#else2757static __inline__ vector unsigned char __ATTRS_o_ai2758vec_lvsl(int __a, const unsigned short *__b) {2759return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2760}2761#endif27622763#ifdef __LITTLE_ENDIAN__2764static __inline__ vector unsigned char __ATTRS_o_ai2765__attribute__((__deprecated__("use assignment for unaligned little endian \2766loads/stores"))) vec_lvsl(int __a, const int *__b) {2767vector unsigned char mask =2768(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2769vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27707, 6, 5, 4, 3, 2, 1, 0};2771return vec_perm(mask, mask, reverse);2772}2773#else2774static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,2775const int *__b) {2776return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2777}2778#endif27792780#ifdef __LITTLE_ENDIAN__2781static __inline__ vector unsigned char __ATTRS_o_ai2782__attribute__((__deprecated__("use assignment for unaligned little endian \2783loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {2784vector unsigned char mask =2785(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2786vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,27877, 6, 5, 4, 3, 2, 1, 0};2788return vec_perm(mask, mask, reverse);2789}2790#else2791static __inline__ vector unsigned char __ATTRS_o_ai2792vec_lvsl(int __a, const unsigned int *__b) {2793return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2794}2795#endif27962797#ifdef __LITTLE_ENDIAN__2798static __inline__ vector unsigned char __ATTRS_o_ai2799__attribute__((__deprecated__("use assignment for unaligned little endian \2800loads/stores"))) vec_lvsl(int __a, const float *__b) {2801vector unsigned char mask =2802(vector unsigned char)__builtin_altivec_lvsl(__a, __b);2803vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28047, 6, 5, 4, 3, 2, 1, 0};2805return vec_perm(mask, mask, reverse);2806}2807#else2808static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,2809const float *__b) {2810return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);2811}2812#endif28132814/* vec_lvsr */28152816#ifdef __LITTLE_ENDIAN__2817static __inline__ vector unsigned char __ATTRS_o_ai2818__attribute__((__deprecated__("use assignment for unaligned little endian \2819loads/stores"))) vec_lvsr(int __a, const signed char *__b) {2820vector unsigned char mask =2821(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2822vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28237, 6, 5, 4, 3, 2, 1, 0};2824return vec_perm(mask, mask, reverse);2825}2826#else2827static __inline__ vector unsigned char __ATTRS_o_ai2828vec_lvsr(int __a, const signed char *__b) {2829return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2830}2831#endif28322833#ifdef __LITTLE_ENDIAN__2834static __inline__ vector unsigned char __ATTRS_o_ai2835__attribute__((__deprecated__("use assignment for unaligned little endian \2836loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {2837vector unsigned char mask =2838(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2839vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28407, 6, 5, 4, 3, 2, 1, 0};2841return vec_perm(mask, mask, reverse);2842}2843#else2844static __inline__ vector unsigned char __ATTRS_o_ai2845vec_lvsr(int __a, const unsigned char *__b) {2846return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2847}2848#endif28492850#ifdef __LITTLE_ENDIAN__2851static __inline__ vector unsigned char __ATTRS_o_ai2852__attribute__((__deprecated__("use assignment for unaligned little endian \2853loads/stores"))) vec_lvsr(int __a, const short *__b) {2854vector unsigned char mask =2855(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2856vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28577, 6, 5, 4, 3, 2, 1, 0};2858return vec_perm(mask, mask, reverse);2859}2860#else2861static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,2862const short *__b) {2863return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2864}2865#endif28662867#ifdef __LITTLE_ENDIAN__2868static __inline__ vector unsigned char __ATTRS_o_ai2869__attribute__((__deprecated__("use assignment for unaligned little endian \2870loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {2871vector unsigned char mask =2872(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2873vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28747, 6, 5, 4, 3, 2, 1, 0};2875return vec_perm(mask, mask, reverse);2876}2877#else2878static __inline__ vector unsigned char __ATTRS_o_ai2879vec_lvsr(int __a, const unsigned short *__b) {2880return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2881}2882#endif28832884#ifdef __LITTLE_ENDIAN__2885static __inline__ vector unsigned char __ATTRS_o_ai2886__attribute__((__deprecated__("use assignment for unaligned little endian \2887loads/stores"))) vec_lvsr(int __a, const int *__b) {2888vector unsigned char mask =2889(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2890vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,28917, 6, 5, 4, 3, 2, 1, 0};2892return vec_perm(mask, mask, reverse);2893}2894#else2895static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,2896const int *__b) {2897return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2898}2899#endif29002901#ifdef __LITTLE_ENDIAN__2902static __inline__ vector unsigned char __ATTRS_o_ai2903__attribute__((__deprecated__("use assignment for unaligned little endian \2904loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {2905vector unsigned char mask =2906(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2907vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,29087, 6, 5, 4, 3, 2, 1, 0};2909return vec_perm(mask, mask, reverse);2910}2911#else2912static __inline__ vector unsigned char __ATTRS_o_ai2913vec_lvsr(int __a, const unsigned int *__b) {2914return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2915}2916#endif29172918#ifdef __LITTLE_ENDIAN__2919static __inline__ vector unsigned char __ATTRS_o_ai2920__attribute__((__deprecated__("use assignment for unaligned little endian \2921loads/stores"))) vec_lvsr(int __a, const float *__b) {2922vector unsigned char mask =2923(vector unsigned char)__builtin_altivec_lvsr(__a, __b);2924vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,29257, 6, 5, 4, 3, 2, 1, 0};2926return vec_perm(mask, mask, reverse);2927}2928#else2929static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,2930const float *__b) {2931return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);2932}2933#endif29342935/* vec_madd */2936static __inline__ vector signed short __ATTRS_o_ai2937vec_mladd(vector signed short, vector signed short, vector signed short);2938static __inline__ vector signed short __ATTRS_o_ai2939vec_mladd(vector signed short, vector unsigned short, vector unsigned short);2940static __inline__ vector signed short __ATTRS_o_ai2941vec_mladd(vector unsigned short, vector signed short, vector signed short);2942static __inline__ vector unsigned short __ATTRS_o_ai2943vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);29442945static __inline__ vector signed short __ATTRS_o_ai vec_madd(2946vector signed short __a, vector signed short __b, vector signed short __c) {2947return vec_mladd(__a, __b, __c);2948}29492950static __inline__ vector signed short __ATTRS_o_ai2951vec_madd(vector signed short __a, vector unsigned short __b,2952vector unsigned short __c) {2953return vec_mladd(__a, __b, __c);2954}29552956static __inline__ vector signed short __ATTRS_o_ai2957vec_madd(vector unsigned short __a, vector signed short __b,2958vector signed short __c) {2959return vec_mladd(__a, __b, __c);2960}29612962static __inline__ vector unsigned short __ATTRS_o_ai2963vec_madd(vector unsigned short __a, vector unsigned short __b,2964vector unsigned short __c) {2965return vec_mladd(__a, __b, __c);2966}29672968static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,2969vector float __b,2970vector float __c) {2971#ifdef __VSX__2972return __builtin_vsx_xvmaddasp(__a, __b, __c);2973#else2974return __builtin_altivec_vmaddfp(__a, __b, __c);2975#endif2976}29772978#ifdef __VSX__2979static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,2980vector double __b,2981vector double __c) {2982return __builtin_vsx_xvmaddadp(__a, __b, __c);2983}2984#endif29852986/* vec_vmaddfp */29872988static __inline__ vector float __attribute__((__always_inline__))2989vec_vmaddfp(vector float __a, vector float __b, vector float __c) {2990return __builtin_altivec_vmaddfp(__a, __b, __c);2991}29922993/* vec_madds */29942995static __inline__ vector signed short __attribute__((__always_inline__))2996vec_madds(vector signed short __a, vector signed short __b,2997vector signed short __c) {2998return __builtin_altivec_vmhaddshs(__a, __b, __c);2999}30003001/* vec_vmhaddshs */3002static __inline__ vector signed short __attribute__((__always_inline__))3003vec_vmhaddshs(vector signed short __a, vector signed short __b,3004vector signed short __c) {3005return __builtin_altivec_vmhaddshs(__a, __b, __c);3006}30073008/* vec_msub */30093010#ifdef __VSX__3011static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,3012vector float __b,3013vector float __c) {3014return __builtin_vsx_xvmsubasp(__a, __b, __c);3015}30163017static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,3018vector double __b,3019vector double __c) {3020return __builtin_vsx_xvmsubadp(__a, __b, __c);3021}3022#endif30233024/* vec_max */30253026static __inline__ vector signed char __ATTRS_o_ai3027vec_max(vector signed char __a, vector signed char __b) {3028return __builtin_altivec_vmaxsb(__a, __b);3029}30303031static __inline__ vector signed char __ATTRS_o_ai3032vec_max(vector bool char __a, vector signed char __b) {3033return __builtin_altivec_vmaxsb((vector signed char)__a, __b);3034}30353036static __inline__ vector signed char __ATTRS_o_ai3037vec_max(vector signed char __a, vector bool char __b) {3038return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);3039}30403041static __inline__ vector unsigned char __ATTRS_o_ai3042vec_max(vector unsigned char __a, vector unsigned char __b) {3043return __builtin_altivec_vmaxub(__a, __b);3044}30453046static __inline__ vector unsigned char __ATTRS_o_ai3047vec_max(vector bool char __a, vector unsigned char __b) {3048return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);3049}30503051static __inline__ vector unsigned char __ATTRS_o_ai3052vec_max(vector unsigned char __a, vector bool char __b) {3053return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);3054}30553056static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,3057vector short __b) {3058return __builtin_altivec_vmaxsh(__a, __b);3059}30603061static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,3062vector short __b) {3063return __builtin_altivec_vmaxsh((vector short)__a, __b);3064}30653066static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,3067vector bool short __b) {3068return __builtin_altivec_vmaxsh(__a, (vector short)__b);3069}30703071static __inline__ vector unsigned short __ATTRS_o_ai3072vec_max(vector unsigned short __a, vector unsigned short __b) {3073return __builtin_altivec_vmaxuh(__a, __b);3074}30753076static __inline__ vector unsigned short __ATTRS_o_ai3077vec_max(vector bool short __a, vector unsigned short __b) {3078return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);3079}30803081static __inline__ vector unsigned short __ATTRS_o_ai3082vec_max(vector unsigned short __a, vector bool short __b) {3083return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);3084}30853086static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,3087vector int __b) {3088return __builtin_altivec_vmaxsw(__a, __b);3089}30903091static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,3092vector int __b) {3093return __builtin_altivec_vmaxsw((vector int)__a, __b);3094}30953096static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,3097vector bool int __b) {3098return __builtin_altivec_vmaxsw(__a, (vector int)__b);3099}31003101static __inline__ vector unsigned int __ATTRS_o_ai3102vec_max(vector unsigned int __a, vector unsigned int __b) {3103return __builtin_altivec_vmaxuw(__a, __b);3104}31053106static __inline__ vector unsigned int __ATTRS_o_ai3107vec_max(vector bool int __a, vector unsigned int __b) {3108return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);3109}31103111static __inline__ vector unsigned int __ATTRS_o_ai3112vec_max(vector unsigned int __a, vector bool int __b) {3113return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);3114}31153116#ifdef __POWER8_VECTOR__3117static __inline__ vector signed long long __ATTRS_o_ai3118vec_max(vector signed long long __a, vector signed long long __b) {3119return __builtin_altivec_vmaxsd(__a, __b);3120}31213122static __inline__ vector signed long long __ATTRS_o_ai3123vec_max(vector bool long long __a, vector signed long long __b) {3124return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);3125}31263127static __inline__ vector signed long long __ATTRS_o_ai3128vec_max(vector signed long long __a, vector bool long long __b) {3129return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);3130}31313132static __inline__ vector unsigned long long __ATTRS_o_ai3133vec_max(vector unsigned long long __a, vector unsigned long long __b) {3134return __builtin_altivec_vmaxud(__a, __b);3135}31363137static __inline__ vector unsigned long long __ATTRS_o_ai3138vec_max(vector bool long long __a, vector unsigned long long __b) {3139return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);3140}31413142static __inline__ vector unsigned long long __ATTRS_o_ai3143vec_max(vector unsigned long long __a, vector bool long long __b) {3144return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);3145}3146#endif31473148static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,3149vector float __b) {3150#ifdef __VSX__3151return __builtin_vsx_xvmaxsp(__a, __b);3152#else3153return __builtin_altivec_vmaxfp(__a, __b);3154#endif3155}31563157#ifdef __VSX__3158static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,3159vector double __b) {3160return __builtin_vsx_xvmaxdp(__a, __b);3161}3162#endif31633164/* vec_vmaxsb */31653166static __inline__ vector signed char __ATTRS_o_ai3167vec_vmaxsb(vector signed char __a, vector signed char __b) {3168return __builtin_altivec_vmaxsb(__a, __b);3169}31703171static __inline__ vector signed char __ATTRS_o_ai3172vec_vmaxsb(vector bool char __a, vector signed char __b) {3173return __builtin_altivec_vmaxsb((vector signed char)__a, __b);3174}31753176static __inline__ vector signed char __ATTRS_o_ai3177vec_vmaxsb(vector signed char __a, vector bool char __b) {3178return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);3179}31803181/* vec_vmaxub */31823183static __inline__ vector unsigned char __ATTRS_o_ai3184vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {3185return __builtin_altivec_vmaxub(__a, __b);3186}31873188static __inline__ vector unsigned char __ATTRS_o_ai3189vec_vmaxub(vector bool char __a, vector unsigned char __b) {3190return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);3191}31923193static __inline__ vector unsigned char __ATTRS_o_ai3194vec_vmaxub(vector unsigned char __a, vector bool char __b) {3195return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);3196}31973198/* vec_vmaxsh */31993200static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,3201vector short __b) {3202return __builtin_altivec_vmaxsh(__a, __b);3203}32043205static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,3206vector short __b) {3207return __builtin_altivec_vmaxsh((vector short)__a, __b);3208}32093210static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,3211vector bool short __b) {3212return __builtin_altivec_vmaxsh(__a, (vector short)__b);3213}32143215/* vec_vmaxuh */32163217static __inline__ vector unsigned short __ATTRS_o_ai3218vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {3219return __builtin_altivec_vmaxuh(__a, __b);3220}32213222static __inline__ vector unsigned short __ATTRS_o_ai3223vec_vmaxuh(vector bool short __a, vector unsigned short __b) {3224return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);3225}32263227static __inline__ vector unsigned short __ATTRS_o_ai3228vec_vmaxuh(vector unsigned short __a, vector bool short __b) {3229return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);3230}32313232/* vec_vmaxsw */32333234static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,3235vector int __b) {3236return __builtin_altivec_vmaxsw(__a, __b);3237}32383239static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,3240vector int __b) {3241return __builtin_altivec_vmaxsw((vector int)__a, __b);3242}32433244static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,3245vector bool int __b) {3246return __builtin_altivec_vmaxsw(__a, (vector int)__b);3247}32483249/* vec_vmaxuw */32503251static __inline__ vector unsigned int __ATTRS_o_ai3252vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {3253return __builtin_altivec_vmaxuw(__a, __b);3254}32553256static __inline__ vector unsigned int __ATTRS_o_ai3257vec_vmaxuw(vector bool int __a, vector unsigned int __b) {3258return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);3259}32603261static __inline__ vector unsigned int __ATTRS_o_ai3262vec_vmaxuw(vector unsigned int __a, vector bool int __b) {3263return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);3264}32653266/* vec_vmaxfp */32673268static __inline__ vector float __attribute__((__always_inline__))3269vec_vmaxfp(vector float __a, vector float __b) {3270#ifdef __VSX__3271return __builtin_vsx_xvmaxsp(__a, __b);3272#else3273return __builtin_altivec_vmaxfp(__a, __b);3274#endif3275}32763277/* vec_mergeh */32783279static __inline__ vector signed char __ATTRS_o_ai3280vec_mergeh(vector signed char __a, vector signed char __b) {3281return vec_perm(__a, __b,3282(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,32830x03, 0x13, 0x04, 0x14, 0x05, 0x15,32840x06, 0x16, 0x07, 0x17));3285}32863287static __inline__ vector unsigned char __ATTRS_o_ai3288vec_mergeh(vector unsigned char __a, vector unsigned char __b) {3289return vec_perm(__a, __b,3290(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,32910x03, 0x13, 0x04, 0x14, 0x05, 0x15,32920x06, 0x16, 0x07, 0x17));3293}32943295static __inline__ vector bool char __ATTRS_o_ai3296vec_mergeh(vector bool char __a, vector bool char __b) {3297return vec_perm(__a, __b,3298(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,32990x03, 0x13, 0x04, 0x14, 0x05, 0x15,33000x06, 0x16, 0x07, 0x17));3301}33023303static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,3304vector short __b) {3305return vec_perm(__a, __b,3306(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,33070x12, 0x13, 0x04, 0x05, 0x14, 0x15,33080x06, 0x07, 0x16, 0x17));3309}33103311static __inline__ vector unsigned short __ATTRS_o_ai3312vec_mergeh(vector unsigned short __a, vector unsigned short __b) {3313return vec_perm(__a, __b,3314(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,33150x12, 0x13, 0x04, 0x05, 0x14, 0x15,33160x06, 0x07, 0x16, 0x17));3317}33183319static __inline__ vector bool short __ATTRS_o_ai3320vec_mergeh(vector bool short __a, vector bool short __b) {3321return vec_perm(__a, __b,3322(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,33230x12, 0x13, 0x04, 0x05, 0x14, 0x15,33240x06, 0x07, 0x16, 0x17));3325}33263327static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,3328vector pixel __b) {3329return vec_perm(__a, __b,3330(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,33310x12, 0x13, 0x04, 0x05, 0x14, 0x15,33320x06, 0x07, 0x16, 0x17));3333}33343335static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,3336vector int __b) {3337return vec_perm(__a, __b,3338(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,33390x12, 0x13, 0x04, 0x05, 0x06, 0x07,33400x14, 0x15, 0x16, 0x17));3341}33423343static __inline__ vector unsigned int __ATTRS_o_ai3344vec_mergeh(vector unsigned int __a, vector unsigned int __b) {3345return vec_perm(__a, __b,3346(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,33470x12, 0x13, 0x04, 0x05, 0x06, 0x07,33480x14, 0x15, 0x16, 0x17));3349}33503351static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,3352vector bool int __b) {3353return vec_perm(__a, __b,3354(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,33550x12, 0x13, 0x04, 0x05, 0x06, 0x07,33560x14, 0x15, 0x16, 0x17));3357}33583359static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,3360vector float __b) {3361return vec_perm(__a, __b,3362(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,33630x12, 0x13, 0x04, 0x05, 0x06, 0x07,33640x14, 0x15, 0x16, 0x17));3365}33663367#ifdef __VSX__3368static __inline__ vector signed long long __ATTRS_o_ai3369vec_mergeh(vector signed long long __a, vector signed long long __b) {3370return vec_perm(__a, __b,3371(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,33720x06, 0x07, 0x10, 0x11, 0x12, 0x13,33730x14, 0x15, 0x16, 0x17));3374}33753376static __inline__ vector signed long long __ATTRS_o_ai3377vec_mergeh(vector signed long long __a, vector bool long long __b) {3378return vec_perm(__a, (vector signed long long)__b,3379(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,33800x06, 0x07, 0x10, 0x11, 0x12, 0x13,33810x14, 0x15, 0x16, 0x17));3382}33833384static __inline__ vector signed long long __ATTRS_o_ai3385vec_mergeh(vector bool long long __a, vector signed long long __b) {3386return vec_perm((vector signed long long)__a, __b,3387(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,33880x06, 0x07, 0x10, 0x11, 0x12, 0x13,33890x14, 0x15, 0x16, 0x17));3390}33913392static __inline__ vector unsigned long long __ATTRS_o_ai3393vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {3394return vec_perm(__a, __b,3395(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,33960x06, 0x07, 0x10, 0x11, 0x12, 0x13,33970x14, 0x15, 0x16, 0x17));3398}33993400static __inline__ vector unsigned long long __ATTRS_o_ai3401vec_mergeh(vector unsigned long long __a, vector bool long long __b) {3402return vec_perm(__a, (vector unsigned long long)__b,3403(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34040x06, 0x07, 0x10, 0x11, 0x12, 0x13,34050x14, 0x15, 0x16, 0x17));3406}34073408static __inline__ vector unsigned long long __ATTRS_o_ai3409vec_mergeh(vector bool long long __a, vector unsigned long long __b) {3410return vec_perm((vector unsigned long long)__a, __b,3411(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34120x06, 0x07, 0x10, 0x11, 0x12, 0x13,34130x14, 0x15, 0x16, 0x17));3414}34153416static __inline__ vector bool long long __ATTRS_o_ai3417vec_mergeh(vector bool long long __a, vector bool long long __b) {3418return vec_perm(__a, __b,3419(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34200x06, 0x07, 0x10, 0x11, 0x12, 0x13,34210x14, 0x15, 0x16, 0x17));3422}34233424static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,3425vector double __b) {3426return vec_perm(__a, __b,3427(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34280x06, 0x07, 0x10, 0x11, 0x12, 0x13,34290x14, 0x15, 0x16, 0x17));3430}3431static __inline__ vector double __ATTRS_o_ai3432vec_mergeh(vector double __a, vector bool long long __b) {3433return vec_perm(__a, (vector double)__b,3434(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34350x06, 0x07, 0x10, 0x11, 0x12, 0x13,34360x14, 0x15, 0x16, 0x17));3437}3438static __inline__ vector double __ATTRS_o_ai3439vec_mergeh(vector bool long long __a, vector double __b) {3440return vec_perm((vector double)__a, __b,3441(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,34420x06, 0x07, 0x10, 0x11, 0x12, 0x13,34430x14, 0x15, 0x16, 0x17));3444}3445#endif34463447/* vec_vmrghb */34483449#define __builtin_altivec_vmrghb vec_vmrghb34503451static __inline__ vector signed char __ATTRS_o_ai3452vec_vmrghb(vector signed char __a, vector signed char __b) {3453return vec_perm(__a, __b,3454(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,34550x03, 0x13, 0x04, 0x14, 0x05, 0x15,34560x06, 0x16, 0x07, 0x17));3457}34583459static __inline__ vector unsigned char __ATTRS_o_ai3460vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {3461return vec_perm(__a, __b,3462(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,34630x03, 0x13, 0x04, 0x14, 0x05, 0x15,34640x06, 0x16, 0x07, 0x17));3465}34663467static __inline__ vector bool char __ATTRS_o_ai3468vec_vmrghb(vector bool char __a, vector bool char __b) {3469return vec_perm(__a, __b,3470(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,34710x03, 0x13, 0x04, 0x14, 0x05, 0x15,34720x06, 0x16, 0x07, 0x17));3473}34743475/* vec_vmrghh */34763477#define __builtin_altivec_vmrghh vec_vmrghh34783479static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,3480vector short __b) {3481return vec_perm(__a, __b,3482(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,34830x12, 0x13, 0x04, 0x05, 0x14, 0x15,34840x06, 0x07, 0x16, 0x17));3485}34863487static __inline__ vector unsigned short __ATTRS_o_ai3488vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {3489return vec_perm(__a, __b,3490(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,34910x12, 0x13, 0x04, 0x05, 0x14, 0x15,34920x06, 0x07, 0x16, 0x17));3493}34943495static __inline__ vector bool short __ATTRS_o_ai3496vec_vmrghh(vector bool short __a, vector bool short __b) {3497return vec_perm(__a, __b,3498(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,34990x12, 0x13, 0x04, 0x05, 0x14, 0x15,35000x06, 0x07, 0x16, 0x17));3501}35023503static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,3504vector pixel __b) {3505return vec_perm(__a, __b,3506(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,35070x12, 0x13, 0x04, 0x05, 0x14, 0x15,35080x06, 0x07, 0x16, 0x17));3509}35103511/* vec_vmrghw */35123513#define __builtin_altivec_vmrghw vec_vmrghw35143515static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,3516vector int __b) {3517return vec_perm(__a, __b,3518(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,35190x12, 0x13, 0x04, 0x05, 0x06, 0x07,35200x14, 0x15, 0x16, 0x17));3521}35223523static __inline__ vector unsigned int __ATTRS_o_ai3524vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {3525return vec_perm(__a, __b,3526(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,35270x12, 0x13, 0x04, 0x05, 0x06, 0x07,35280x14, 0x15, 0x16, 0x17));3529}35303531static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,3532vector bool int __b) {3533return vec_perm(__a, __b,3534(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,35350x12, 0x13, 0x04, 0x05, 0x06, 0x07,35360x14, 0x15, 0x16, 0x17));3537}35383539static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,3540vector float __b) {3541return vec_perm(__a, __b,3542(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,35430x12, 0x13, 0x04, 0x05, 0x06, 0x07,35440x14, 0x15, 0x16, 0x17));3545}35463547/* vec_mergel */35483549static __inline__ vector signed char __ATTRS_o_ai3550vec_mergel(vector signed char __a, vector signed char __b) {3551return vec_perm(__a, __b,3552(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,35530x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,35540x0E, 0x1E, 0x0F, 0x1F));3555}35563557static __inline__ vector unsigned char __ATTRS_o_ai3558vec_mergel(vector unsigned char __a, vector unsigned char __b) {3559return vec_perm(__a, __b,3560(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,35610x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,35620x0E, 0x1E, 0x0F, 0x1F));3563}35643565static __inline__ vector bool char __ATTRS_o_ai3566vec_mergel(vector bool char __a, vector bool char __b) {3567return vec_perm(__a, __b,3568(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,35690x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,35700x0E, 0x1E, 0x0F, 0x1F));3571}35723573static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,3574vector short __b) {3575return vec_perm(__a, __b,3576(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,35770x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,35780x0E, 0x0F, 0x1E, 0x1F));3579}35803581static __inline__ vector unsigned short __ATTRS_o_ai3582vec_mergel(vector unsigned short __a, vector unsigned short __b) {3583return vec_perm(__a, __b,3584(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,35850x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,35860x0E, 0x0F, 0x1E, 0x1F));3587}35883589static __inline__ vector bool short __ATTRS_o_ai3590vec_mergel(vector bool short __a, vector bool short __b) {3591return vec_perm(__a, __b,3592(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,35930x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,35940x0E, 0x0F, 0x1E, 0x1F));3595}35963597static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,3598vector pixel __b) {3599return vec_perm(__a, __b,3600(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,36010x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,36020x0E, 0x0F, 0x1E, 0x1F));3603}36043605static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,3606vector int __b) {3607return vec_perm(__a, __b,3608(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,36090x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,36100x1C, 0x1D, 0x1E, 0x1F));3611}36123613static __inline__ vector unsigned int __ATTRS_o_ai3614vec_mergel(vector unsigned int __a, vector unsigned int __b) {3615return vec_perm(__a, __b,3616(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,36170x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,36180x1C, 0x1D, 0x1E, 0x1F));3619}36203621static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,3622vector bool int __b) {3623return vec_perm(__a, __b,3624(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,36250x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,36260x1C, 0x1D, 0x1E, 0x1F));3627}36283629static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,3630vector float __b) {3631return vec_perm(__a, __b,3632(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,36330x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,36340x1C, 0x1D, 0x1E, 0x1F));3635}36363637#ifdef __VSX__3638static __inline__ vector signed long long __ATTRS_o_ai3639vec_mergel(vector signed long long __a, vector signed long long __b) {3640return vec_perm(__a, __b,3641(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36420x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36430x1C, 0x1D, 0x1E, 0x1F));3644}3645static __inline__ vector signed long long __ATTRS_o_ai3646vec_mergel(vector signed long long __a, vector bool long long __b) {3647return vec_perm(__a, (vector signed long long)__b,3648(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36490x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36500x1C, 0x1D, 0x1E, 0x1F));3651}3652static __inline__ vector signed long long __ATTRS_o_ai3653vec_mergel(vector bool long long __a, vector signed long long __b) {3654return vec_perm((vector signed long long)__a, __b,3655(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36560x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36570x1C, 0x1D, 0x1E, 0x1F));3658}3659static __inline__ vector unsigned long long __ATTRS_o_ai3660vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {3661return vec_perm(__a, __b,3662(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36630x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36640x1C, 0x1D, 0x1E, 0x1F));3665}3666static __inline__ vector unsigned long long __ATTRS_o_ai3667vec_mergel(vector unsigned long long __a, vector bool long long __b) {3668return vec_perm(__a, (vector unsigned long long)__b,3669(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36700x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36710x1C, 0x1D, 0x1E, 0x1F));3672}3673static __inline__ vector unsigned long long __ATTRS_o_ai3674vec_mergel(vector bool long long __a, vector unsigned long long __b) {3675return vec_perm((vector unsigned long long)__a, __b,3676(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36770x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36780x1C, 0x1D, 0x1E, 0x1F));3679}3680static __inline__ vector bool long long __ATTRS_o_ai3681vec_mergel(vector bool long long __a, vector bool long long __b) {3682return vec_perm(__a, __b,3683(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36840x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36850x1C, 0x1D, 0x1E, 0x1F));3686}3687static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,3688vector double __b) {3689return vec_perm(__a, __b,3690(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36910x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36920x1C, 0x1D, 0x1E, 0x1F));3693}3694static __inline__ vector double __ATTRS_o_ai3695vec_mergel(vector double __a, vector bool long long __b) {3696return vec_perm(__a, (vector double)__b,3697(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,36980x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,36990x1C, 0x1D, 0x1E, 0x1F));3700}3701static __inline__ vector double __ATTRS_o_ai3702vec_mergel(vector bool long long __a, vector double __b) {3703return vec_perm((vector double)__a, __b,3704(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,37050x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,37060x1C, 0x1D, 0x1E, 0x1F));3707}3708#endif37093710/* vec_vmrglb */37113712#define __builtin_altivec_vmrglb vec_vmrglb37133714static __inline__ vector signed char __ATTRS_o_ai3715vec_vmrglb(vector signed char __a, vector signed char __b) {3716return vec_perm(__a, __b,3717(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,37180x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,37190x0E, 0x1E, 0x0F, 0x1F));3720}37213722static __inline__ vector unsigned char __ATTRS_o_ai3723vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {3724return vec_perm(__a, __b,3725(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,37260x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,37270x0E, 0x1E, 0x0F, 0x1F));3728}37293730static __inline__ vector bool char __ATTRS_o_ai3731vec_vmrglb(vector bool char __a, vector bool char __b) {3732return vec_perm(__a, __b,3733(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,37340x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,37350x0E, 0x1E, 0x0F, 0x1F));3736}37373738/* vec_vmrglh */37393740#define __builtin_altivec_vmrglh vec_vmrglh37413742static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,3743vector short __b) {3744return vec_perm(__a, __b,3745(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,37460x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,37470x0E, 0x0F, 0x1E, 0x1F));3748}37493750static __inline__ vector unsigned short __ATTRS_o_ai3751vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {3752return vec_perm(__a, __b,3753(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,37540x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,37550x0E, 0x0F, 0x1E, 0x1F));3756}37573758static __inline__ vector bool short __ATTRS_o_ai3759vec_vmrglh(vector bool short __a, vector bool short __b) {3760return vec_perm(__a, __b,3761(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,37620x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,37630x0E, 0x0F, 0x1E, 0x1F));3764}37653766static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,3767vector pixel __b) {3768return vec_perm(__a, __b,3769(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,37700x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,37710x0E, 0x0F, 0x1E, 0x1F));3772}37733774/* vec_vmrglw */37753776#define __builtin_altivec_vmrglw vec_vmrglw37773778static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,3779vector int __b) {3780return vec_perm(__a, __b,3781(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,37820x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,37830x1C, 0x1D, 0x1E, 0x1F));3784}37853786static __inline__ vector unsigned int __ATTRS_o_ai3787vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {3788return vec_perm(__a, __b,3789(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,37900x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,37910x1C, 0x1D, 0x1E, 0x1F));3792}37933794static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,3795vector bool int __b) {3796return vec_perm(__a, __b,3797(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,37980x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,37990x1C, 0x1D, 0x1E, 0x1F));3800}38013802static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,3803vector float __b) {3804return vec_perm(__a, __b,3805(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,38060x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,38070x1C, 0x1D, 0x1E, 0x1F));3808}38093810#ifdef __POWER8_VECTOR__3811/* vec_mergee */38123813static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,3814vector bool int __b) {3815return vec_perm(__a, __b,3816(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,38170x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,38180x18, 0x19, 0x1A, 0x1B));3819}38203821static __inline__ vector signed int __ATTRS_o_ai3822vec_mergee(vector signed int __a, vector signed int __b) {3823return vec_perm(__a, __b,3824(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,38250x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,38260x18, 0x19, 0x1A, 0x1B));3827}38283829static __inline__ vector unsigned int __ATTRS_o_ai3830vec_mergee(vector unsigned int __a, vector unsigned int __b) {3831return vec_perm(__a, __b,3832(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,38330x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,38340x18, 0x19, 0x1A, 0x1B));3835}38363837/* vec_mergeo */38383839static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,3840vector bool int __b) {3841return vec_perm(__a, __b,3842(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,38430x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,38440x1C, 0x1D, 0x1E, 0x1F));3845}38463847static __inline__ vector signed int __ATTRS_o_ai3848vec_mergeo(vector signed int __a, vector signed int __b) {3849return vec_perm(__a, __b,3850(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,38510x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,38520x1C, 0x1D, 0x1E, 0x1F));3853}38543855static __inline__ vector unsigned int __ATTRS_o_ai3856vec_mergeo(vector unsigned int __a, vector unsigned int __b) {3857return vec_perm(__a, __b,3858(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,38590x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,38600x1C, 0x1D, 0x1E, 0x1F));3861}38623863#endif38643865/* vec_mfvscr */38663867static __inline__ vector unsigned short __attribute__((__always_inline__))3868vec_mfvscr(void) {3869return __builtin_altivec_mfvscr();3870}38713872/* vec_min */38733874static __inline__ vector signed char __ATTRS_o_ai3875vec_min(vector signed char __a, vector signed char __b) {3876return __builtin_altivec_vminsb(__a, __b);3877}38783879static __inline__ vector signed char __ATTRS_o_ai3880vec_min(vector bool char __a, vector signed char __b) {3881return __builtin_altivec_vminsb((vector signed char)__a, __b);3882}38833884static __inline__ vector signed char __ATTRS_o_ai3885vec_min(vector signed char __a, vector bool char __b) {3886return __builtin_altivec_vminsb(__a, (vector signed char)__b);3887}38883889static __inline__ vector unsigned char __ATTRS_o_ai3890vec_min(vector unsigned char __a, vector unsigned char __b) {3891return __builtin_altivec_vminub(__a, __b);3892}38933894static __inline__ vector unsigned char __ATTRS_o_ai3895vec_min(vector bool char __a, vector unsigned char __b) {3896return __builtin_altivec_vminub((vector unsigned char)__a, __b);3897}38983899static __inline__ vector unsigned char __ATTRS_o_ai3900vec_min(vector unsigned char __a, vector bool char __b) {3901return __builtin_altivec_vminub(__a, (vector unsigned char)__b);3902}39033904static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,3905vector short __b) {3906return __builtin_altivec_vminsh(__a, __b);3907}39083909static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,3910vector short __b) {3911return __builtin_altivec_vminsh((vector short)__a, __b);3912}39133914static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,3915vector bool short __b) {3916return __builtin_altivec_vminsh(__a, (vector short)__b);3917}39183919static __inline__ vector unsigned short __ATTRS_o_ai3920vec_min(vector unsigned short __a, vector unsigned short __b) {3921return __builtin_altivec_vminuh(__a, __b);3922}39233924static __inline__ vector unsigned short __ATTRS_o_ai3925vec_min(vector bool short __a, vector unsigned short __b) {3926return __builtin_altivec_vminuh((vector unsigned short)__a, __b);3927}39283929static __inline__ vector unsigned short __ATTRS_o_ai3930vec_min(vector unsigned short __a, vector bool short __b) {3931return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);3932}39333934static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,3935vector int __b) {3936return __builtin_altivec_vminsw(__a, __b);3937}39383939static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,3940vector int __b) {3941return __builtin_altivec_vminsw((vector int)__a, __b);3942}39433944static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,3945vector bool int __b) {3946return __builtin_altivec_vminsw(__a, (vector int)__b);3947}39483949static __inline__ vector unsigned int __ATTRS_o_ai3950vec_min(vector unsigned int __a, vector unsigned int __b) {3951return __builtin_altivec_vminuw(__a, __b);3952}39533954static __inline__ vector unsigned int __ATTRS_o_ai3955vec_min(vector bool int __a, vector unsigned int __b) {3956return __builtin_altivec_vminuw((vector unsigned int)__a, __b);3957}39583959static __inline__ vector unsigned int __ATTRS_o_ai3960vec_min(vector unsigned int __a, vector bool int __b) {3961return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);3962}39633964#ifdef __POWER8_VECTOR__3965static __inline__ vector signed long long __ATTRS_o_ai3966vec_min(vector signed long long __a, vector signed long long __b) {3967return __builtin_altivec_vminsd(__a, __b);3968}39693970static __inline__ vector signed long long __ATTRS_o_ai3971vec_min(vector bool long long __a, vector signed long long __b) {3972return __builtin_altivec_vminsd((vector signed long long)__a, __b);3973}39743975static __inline__ vector signed long long __ATTRS_o_ai3976vec_min(vector signed long long __a, vector bool long long __b) {3977return __builtin_altivec_vminsd(__a, (vector signed long long)__b);3978}39793980static __inline__ vector unsigned long long __ATTRS_o_ai3981vec_min(vector unsigned long long __a, vector unsigned long long __b) {3982return __builtin_altivec_vminud(__a, __b);3983}39843985static __inline__ vector unsigned long long __ATTRS_o_ai3986vec_min(vector bool long long __a, vector unsigned long long __b) {3987return __builtin_altivec_vminud((vector unsigned long long)__a, __b);3988}39893990static __inline__ vector unsigned long long __ATTRS_o_ai3991vec_min(vector unsigned long long __a, vector bool long long __b) {3992return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);3993}3994#endif39953996static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,3997vector float __b) {3998#ifdef __VSX__3999return __builtin_vsx_xvminsp(__a, __b);4000#else4001return __builtin_altivec_vminfp(__a, __b);4002#endif4003}40044005#ifdef __VSX__4006static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,4007vector double __b) {4008return __builtin_vsx_xvmindp(__a, __b);4009}4010#endif40114012/* vec_vminsb */40134014static __inline__ vector signed char __ATTRS_o_ai4015vec_vminsb(vector signed char __a, vector signed char __b) {4016return __builtin_altivec_vminsb(__a, __b);4017}40184019static __inline__ vector signed char __ATTRS_o_ai4020vec_vminsb(vector bool char __a, vector signed char __b) {4021return __builtin_altivec_vminsb((vector signed char)__a, __b);4022}40234024static __inline__ vector signed char __ATTRS_o_ai4025vec_vminsb(vector signed char __a, vector bool char __b) {4026return __builtin_altivec_vminsb(__a, (vector signed char)__b);4027}40284029/* vec_vminub */40304031static __inline__ vector unsigned char __ATTRS_o_ai4032vec_vminub(vector unsigned char __a, vector unsigned char __b) {4033return __builtin_altivec_vminub(__a, __b);4034}40354036static __inline__ vector unsigned char __ATTRS_o_ai4037vec_vminub(vector bool char __a, vector unsigned char __b) {4038return __builtin_altivec_vminub((vector unsigned char)__a, __b);4039}40404041static __inline__ vector unsigned char __ATTRS_o_ai4042vec_vminub(vector unsigned char __a, vector bool char __b) {4043return __builtin_altivec_vminub(__a, (vector unsigned char)__b);4044}40454046/* vec_vminsh */40474048static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,4049vector short __b) {4050return __builtin_altivec_vminsh(__a, __b);4051}40524053static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,4054vector short __b) {4055return __builtin_altivec_vminsh((vector short)__a, __b);4056}40574058static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,4059vector bool short __b) {4060return __builtin_altivec_vminsh(__a, (vector short)__b);4061}40624063/* vec_vminuh */40644065static __inline__ vector unsigned short __ATTRS_o_ai4066vec_vminuh(vector unsigned short __a, vector unsigned short __b) {4067return __builtin_altivec_vminuh(__a, __b);4068}40694070static __inline__ vector unsigned short __ATTRS_o_ai4071vec_vminuh(vector bool short __a, vector unsigned short __b) {4072return __builtin_altivec_vminuh((vector unsigned short)__a, __b);4073}40744075static __inline__ vector unsigned short __ATTRS_o_ai4076vec_vminuh(vector unsigned short __a, vector bool short __b) {4077return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);4078}40794080/* vec_vminsw */40814082static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,4083vector int __b) {4084return __builtin_altivec_vminsw(__a, __b);4085}40864087static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,4088vector int __b) {4089return __builtin_altivec_vminsw((vector int)__a, __b);4090}40914092static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,4093vector bool int __b) {4094return __builtin_altivec_vminsw(__a, (vector int)__b);4095}40964097/* vec_vminuw */40984099static __inline__ vector unsigned int __ATTRS_o_ai4100vec_vminuw(vector unsigned int __a, vector unsigned int __b) {4101return __builtin_altivec_vminuw(__a, __b);4102}41034104static __inline__ vector unsigned int __ATTRS_o_ai4105vec_vminuw(vector bool int __a, vector unsigned int __b) {4106return __builtin_altivec_vminuw((vector unsigned int)__a, __b);4107}41084109static __inline__ vector unsigned int __ATTRS_o_ai4110vec_vminuw(vector unsigned int __a, vector bool int __b) {4111return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);4112}41134114/* vec_vminfp */41154116static __inline__ vector float __attribute__((__always_inline__))4117vec_vminfp(vector float __a, vector float __b) {4118#ifdef __VSX__4119return __builtin_vsx_xvminsp(__a, __b);4120#else4121return __builtin_altivec_vminfp(__a, __b);4122#endif4123}41244125/* vec_mladd */41264127#define __builtin_altivec_vmladduhm vec_mladd41284129static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,4130vector short __b,4131vector short __c) {4132return __a * __b + __c;4133}41344135static __inline__ vector short __ATTRS_o_ai vec_mladd(4136vector short __a, vector unsigned short __b, vector unsigned short __c) {4137return __a * (vector short)__b + (vector short)__c;4138}41394140static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,4141vector short __b,4142vector short __c) {4143return (vector short)__a * __b + __c;4144}41454146static __inline__ vector unsigned short __ATTRS_o_ai4147vec_mladd(vector unsigned short __a, vector unsigned short __b,4148vector unsigned short __c) {4149return __a * __b + __c;4150}41514152/* vec_vmladduhm */41534154static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,4155vector short __b,4156vector short __c) {4157return __a * __b + __c;4158}41594160static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(4161vector short __a, vector unsigned short __b, vector unsigned short __c) {4162return __a * (vector short)__b + (vector short)__c;4163}41644165static __inline__ vector short __ATTRS_o_ai4166vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {4167return (vector short)__a * __b + __c;4168}41694170static __inline__ vector unsigned short __ATTRS_o_ai4171vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,4172vector unsigned short __c) {4173return __a * __b + __c;4174}41754176/* vec_mradds */41774178static __inline__ vector short __attribute__((__always_inline__))4179vec_mradds(vector short __a, vector short __b, vector short __c) {4180return __builtin_altivec_vmhraddshs(__a, __b, __c);4181}41824183/* vec_vmhraddshs */41844185static __inline__ vector short __attribute__((__always_inline__))4186vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {4187return __builtin_altivec_vmhraddshs(__a, __b, __c);4188}41894190/* vec_msum */41914192static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,4193vector unsigned char __b,4194vector int __c) {4195return __builtin_altivec_vmsummbm(__a, __b, __c);4196}41974198static __inline__ vector unsigned int __ATTRS_o_ai4199vec_msum(vector unsigned char __a, vector unsigned char __b,4200vector unsigned int __c) {4201return __builtin_altivec_vmsumubm(__a, __b, __c);4202}42034204static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,4205vector short __b,4206vector int __c) {4207return __builtin_altivec_vmsumshm(__a, __b, __c);4208}42094210static __inline__ vector unsigned int __ATTRS_o_ai4211vec_msum(vector unsigned short __a, vector unsigned short __b,4212vector unsigned int __c) {4213return __builtin_altivec_vmsumuhm(__a, __b, __c);4214}42154216/* vec_vmsummbm */42174218static __inline__ vector int __attribute__((__always_inline__))4219vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {4220return __builtin_altivec_vmsummbm(__a, __b, __c);4221}42224223/* vec_vmsumubm */42244225static __inline__ vector unsigned int __attribute__((__always_inline__))4226vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,4227vector unsigned int __c) {4228return __builtin_altivec_vmsumubm(__a, __b, __c);4229}42304231/* vec_vmsumshm */42324233static __inline__ vector int __attribute__((__always_inline__))4234vec_vmsumshm(vector short __a, vector short __b, vector int __c) {4235return __builtin_altivec_vmsumshm(__a, __b, __c);4236}42374238/* vec_vmsumuhm */42394240static __inline__ vector unsigned int __attribute__((__always_inline__))4241vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,4242vector unsigned int __c) {4243return __builtin_altivec_vmsumuhm(__a, __b, __c);4244}42454246/* vec_msums */42474248static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,4249vector short __b,4250vector int __c) {4251return __builtin_altivec_vmsumshs(__a, __b, __c);4252}42534254static __inline__ vector unsigned int __ATTRS_o_ai4255vec_msums(vector unsigned short __a, vector unsigned short __b,4256vector unsigned int __c) {4257return __builtin_altivec_vmsumuhs(__a, __b, __c);4258}42594260/* vec_vmsumshs */42614262static __inline__ vector int __attribute__((__always_inline__))4263vec_vmsumshs(vector short __a, vector short __b, vector int __c) {4264return __builtin_altivec_vmsumshs(__a, __b, __c);4265}42664267/* vec_vmsumuhs */42684269static __inline__ vector unsigned int __attribute__((__always_inline__))4270vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,4271vector unsigned int __c) {4272return __builtin_altivec_vmsumuhs(__a, __b, __c);4273}42744275/* vec_mtvscr */42764277static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {4278__builtin_altivec_mtvscr((vector int)__a);4279}42804281static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {4282__builtin_altivec_mtvscr((vector int)__a);4283}42844285static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {4286__builtin_altivec_mtvscr((vector int)__a);4287}42884289static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {4290__builtin_altivec_mtvscr((vector int)__a);4291}42924293static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {4294__builtin_altivec_mtvscr((vector int)__a);4295}42964297static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {4298__builtin_altivec_mtvscr((vector int)__a);4299}43004301static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {4302__builtin_altivec_mtvscr((vector int)__a);4303}43044305static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {4306__builtin_altivec_mtvscr((vector int)__a);4307}43084309static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {4310__builtin_altivec_mtvscr((vector int)__a);4311}43124313static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {4314__builtin_altivec_mtvscr((vector int)__a);4315}43164317static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {4318__builtin_altivec_mtvscr((vector int)__a);4319}43204321/* vec_mul */43224323/* Integer vector multiplication will involve multiplication of the odd/even4324elements separately, then truncating the results and moving to the4325result vector.4326*/4327static __inline__ vector signed char __ATTRS_o_ai4328vec_mul(vector signed char __a, vector signed char __b) {4329return __a * __b;4330}43314332static __inline__ vector unsigned char __ATTRS_o_ai4333vec_mul(vector unsigned char __a, vector unsigned char __b) {4334return __a * __b;4335}43364337static __inline__ vector signed short __ATTRS_o_ai4338vec_mul(vector signed short __a, vector signed short __b) {4339return __a * __b;4340}43414342static __inline__ vector unsigned short __ATTRS_o_ai4343vec_mul(vector unsigned short __a, vector unsigned short __b) {4344return __a * __b;4345}43464347static __inline__ vector signed int __ATTRS_o_ai4348vec_mul(vector signed int __a, vector signed int __b) {4349return __a * __b;4350}43514352static __inline__ vector unsigned int __ATTRS_o_ai4353vec_mul(vector unsigned int __a, vector unsigned int __b) {4354return __a * __b;4355}43564357#ifdef __VSX__4358static __inline__ vector signed long long __ATTRS_o_ai4359vec_mul(vector signed long long __a, vector signed long long __b) {4360return __a * __b;4361}43624363static __inline__ vector unsigned long long __ATTRS_o_ai4364vec_mul(vector unsigned long long __a, vector unsigned long long __b) {4365return __a * __b;4366}4367#endif43684369static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,4370vector float __b) {4371return __a * __b;4372}43734374#ifdef __VSX__4375static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,4376vector double __b) {4377return __a * __b;4378}4379#endif43804381/* The vmulos* and vmules* instructions have a big endian bias, so4382we must reverse the meaning of "even" and "odd" for little endian. */43834384/* vec_mule */43854386static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,4387vector signed char __b) {4388#ifdef __LITTLE_ENDIAN__4389return __builtin_altivec_vmulosb(__a, __b);4390#else4391return __builtin_altivec_vmulesb(__a, __b);4392#endif4393}43944395static __inline__ vector unsigned short __ATTRS_o_ai4396vec_mule(vector unsigned char __a, vector unsigned char __b) {4397#ifdef __LITTLE_ENDIAN__4398return __builtin_altivec_vmuloub(__a, __b);4399#else4400return __builtin_altivec_vmuleub(__a, __b);4401#endif4402}44034404static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,4405vector short __b) {4406#ifdef __LITTLE_ENDIAN__4407return __builtin_altivec_vmulosh(__a, __b);4408#else4409return __builtin_altivec_vmulesh(__a, __b);4410#endif4411}44124413static __inline__ vector unsigned int __ATTRS_o_ai4414vec_mule(vector unsigned short __a, vector unsigned short __b) {4415#ifdef __LITTLE_ENDIAN__4416return __builtin_altivec_vmulouh(__a, __b);4417#else4418return __builtin_altivec_vmuleuh(__a, __b);4419#endif4420}44214422#ifdef __POWER8_VECTOR__4423static __inline__ vector signed long long __ATTRS_o_ai4424vec_mule(vector signed int __a, vector signed int __b) {4425#ifdef __LITTLE_ENDIAN__4426return __builtin_altivec_vmulosw(__a, __b);4427#else4428return __builtin_altivec_vmulesw(__a, __b);4429#endif4430}44314432static __inline__ vector unsigned long long __ATTRS_o_ai4433vec_mule(vector unsigned int __a, vector unsigned int __b) {4434#ifdef __LITTLE_ENDIAN__4435return __builtin_altivec_vmulouw(__a, __b);4436#else4437return __builtin_altivec_vmuleuw(__a, __b);4438#endif4439}4440#endif44414442/* vec_vmulesb */44434444static __inline__ vector short __attribute__((__always_inline__))4445vec_vmulesb(vector signed char __a, vector signed char __b) {4446#ifdef __LITTLE_ENDIAN__4447return __builtin_altivec_vmulosb(__a, __b);4448#else4449return __builtin_altivec_vmulesb(__a, __b);4450#endif4451}44524453/* vec_vmuleub */44544455static __inline__ vector unsigned short __attribute__((__always_inline__))4456vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {4457#ifdef __LITTLE_ENDIAN__4458return __builtin_altivec_vmuloub(__a, __b);4459#else4460return __builtin_altivec_vmuleub(__a, __b);4461#endif4462}44634464/* vec_vmulesh */44654466static __inline__ vector int __attribute__((__always_inline__))4467vec_vmulesh(vector short __a, vector short __b) {4468#ifdef __LITTLE_ENDIAN__4469return __builtin_altivec_vmulosh(__a, __b);4470#else4471return __builtin_altivec_vmulesh(__a, __b);4472#endif4473}44744475/* vec_vmuleuh */44764477static __inline__ vector unsigned int __attribute__((__always_inline__))4478vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {4479#ifdef __LITTLE_ENDIAN__4480return __builtin_altivec_vmulouh(__a, __b);4481#else4482return __builtin_altivec_vmuleuh(__a, __b);4483#endif4484}44854486/* vec_mulo */44874488static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,4489vector signed char __b) {4490#ifdef __LITTLE_ENDIAN__4491return __builtin_altivec_vmulesb(__a, __b);4492#else4493return __builtin_altivec_vmulosb(__a, __b);4494#endif4495}44964497static __inline__ vector unsigned short __ATTRS_o_ai4498vec_mulo(vector unsigned char __a, vector unsigned char __b) {4499#ifdef __LITTLE_ENDIAN__4500return __builtin_altivec_vmuleub(__a, __b);4501#else4502return __builtin_altivec_vmuloub(__a, __b);4503#endif4504}45054506static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,4507vector short __b) {4508#ifdef __LITTLE_ENDIAN__4509return __builtin_altivec_vmulesh(__a, __b);4510#else4511return __builtin_altivec_vmulosh(__a, __b);4512#endif4513}45144515static __inline__ vector unsigned int __ATTRS_o_ai4516vec_mulo(vector unsigned short __a, vector unsigned short __b) {4517#ifdef __LITTLE_ENDIAN__4518return __builtin_altivec_vmuleuh(__a, __b);4519#else4520return __builtin_altivec_vmulouh(__a, __b);4521#endif4522}45234524#ifdef __POWER8_VECTOR__4525static __inline__ vector signed long long __ATTRS_o_ai4526vec_mulo(vector signed int __a, vector signed int __b) {4527#ifdef __LITTLE_ENDIAN__4528return __builtin_altivec_vmulesw(__a, __b);4529#else4530return __builtin_altivec_vmulosw(__a, __b);4531#endif4532}45334534static __inline__ vector unsigned long long __ATTRS_o_ai4535vec_mulo(vector unsigned int __a, vector unsigned int __b) {4536#ifdef __LITTLE_ENDIAN__4537return __builtin_altivec_vmuleuw(__a, __b);4538#else4539return __builtin_altivec_vmulouw(__a, __b);4540#endif4541}4542#endif45434544/* vec_vmulosb */45454546static __inline__ vector short __attribute__((__always_inline__))4547vec_vmulosb(vector signed char __a, vector signed char __b) {4548#ifdef __LITTLE_ENDIAN__4549return __builtin_altivec_vmulesb(__a, __b);4550#else4551return __builtin_altivec_vmulosb(__a, __b);4552#endif4553}45544555/* vec_vmuloub */45564557static __inline__ vector unsigned short __attribute__((__always_inline__))4558vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {4559#ifdef __LITTLE_ENDIAN__4560return __builtin_altivec_vmuleub(__a, __b);4561#else4562return __builtin_altivec_vmuloub(__a, __b);4563#endif4564}45654566/* vec_vmulosh */45674568static __inline__ vector int __attribute__((__always_inline__))4569vec_vmulosh(vector short __a, vector short __b) {4570#ifdef __LITTLE_ENDIAN__4571return __builtin_altivec_vmulesh(__a, __b);4572#else4573return __builtin_altivec_vmulosh(__a, __b);4574#endif4575}45764577/* vec_vmulouh */45784579static __inline__ vector unsigned int __attribute__((__always_inline__))4580vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {4581#ifdef __LITTLE_ENDIAN__4582return __builtin_altivec_vmuleuh(__a, __b);4583#else4584return __builtin_altivec_vmulouh(__a, __b);4585#endif4586}45874588/* vec_nand */45894590#ifdef __POWER8_VECTOR__4591static __inline__ vector signed char __ATTRS_o_ai4592vec_nand(vector signed char __a, vector signed char __b) {4593return ~(__a & __b);4594}45954596static __inline__ vector signed char __ATTRS_o_ai4597vec_nand(vector signed char __a, vector bool char __b) {4598return ~(__a & __b);4599}46004601static __inline__ vector signed char __ATTRS_o_ai4602vec_nand(vector bool char __a, vector signed char __b) {4603return ~(__a & __b);4604}46054606static __inline__ vector unsigned char __ATTRS_o_ai4607vec_nand(vector unsigned char __a, vector unsigned char __b) {4608return ~(__a & __b);4609}46104611static __inline__ vector unsigned char __ATTRS_o_ai4612vec_nand(vector unsigned char __a, vector bool char __b) {4613return ~(__a & __b);4614}46154616static __inline__ vector unsigned char __ATTRS_o_ai4617vec_nand(vector bool char __a, vector unsigned char __b) {4618return ~(__a & __b);4619}46204621static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,4622vector bool char __b) {4623return ~(__a & __b);4624}46254626static __inline__ vector signed short __ATTRS_o_ai4627vec_nand(vector signed short __a, vector signed short __b) {4628return ~(__a & __b);4629}46304631static __inline__ vector signed short __ATTRS_o_ai4632vec_nand(vector signed short __a, vector bool short __b) {4633return ~(__a & __b);4634}46354636static __inline__ vector signed short __ATTRS_o_ai4637vec_nand(vector bool short __a, vector signed short __b) {4638return ~(__a & __b);4639}46404641static __inline__ vector unsigned short __ATTRS_o_ai4642vec_nand(vector unsigned short __a, vector unsigned short __b) {4643return ~(__a & __b);4644}46454646static __inline__ vector unsigned short __ATTRS_o_ai4647vec_nand(vector unsigned short __a, vector bool short __b) {4648return ~(__a & __b);4649}46504651static __inline__ vector bool short __ATTRS_o_ai4652vec_nand(vector bool short __a, vector bool short __b) {4653return ~(__a & __b);4654}46554656static __inline__ vector signed int __ATTRS_o_ai4657vec_nand(vector signed int __a, vector signed int __b) {4658return ~(__a & __b);4659}46604661static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,4662vector bool int __b) {4663return ~(__a & __b);4664}46654666static __inline__ vector signed int __ATTRS_o_ai4667vec_nand(vector bool int __a, vector signed int __b) {4668return ~(__a & __b);4669}46704671static __inline__ vector unsigned int __ATTRS_o_ai4672vec_nand(vector unsigned int __a, vector unsigned int __b) {4673return ~(__a & __b);4674}46754676static __inline__ vector unsigned int __ATTRS_o_ai4677vec_nand(vector unsigned int __a, vector bool int __b) {4678return ~(__a & __b);4679}46804681static __inline__ vector unsigned int __ATTRS_o_ai4682vec_nand(vector bool int __a, vector unsigned int __b) {4683return ~(__a & __b);4684}46854686static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,4687vector bool int __b) {4688return ~(__a & __b);4689}46904691static __inline__ vector signed long long __ATTRS_o_ai4692vec_nand(vector signed long long __a, vector signed long long __b) {4693return ~(__a & __b);4694}46954696static __inline__ vector signed long long __ATTRS_o_ai4697vec_nand(vector signed long long __a, vector bool long long __b) {4698return ~(__a & __b);4699}47004701static __inline__ vector signed long long __ATTRS_o_ai4702vec_nand(vector bool long long __a, vector signed long long __b) {4703return ~(__a & __b);4704}47054706static __inline__ vector unsigned long long __ATTRS_o_ai4707vec_nand(vector unsigned long long __a, vector unsigned long long __b) {4708return ~(__a & __b);4709}47104711static __inline__ vector unsigned long long __ATTRS_o_ai4712vec_nand(vector unsigned long long __a, vector bool long long __b) {4713return ~(__a & __b);4714}47154716static __inline__ vector unsigned long long __ATTRS_o_ai4717vec_nand(vector bool long long __a, vector unsigned long long __b) {4718return ~(__a & __b);4719}47204721static __inline__ vector bool long long __ATTRS_o_ai4722vec_nand(vector bool long long __a, vector bool long long __b) {4723return ~(__a & __b);4724}47254726#endif47274728/* vec_nmadd */47294730#ifdef __VSX__4731static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,4732vector float __b,4733vector float __c) {4734return __builtin_vsx_xvnmaddasp(__a, __b, __c);4735}47364737static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,4738vector double __b,4739vector double __c) {4740return __builtin_vsx_xvnmaddadp(__a, __b, __c);4741}4742#endif47434744/* vec_nmsub */47454746static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,4747vector float __b,4748vector float __c) {4749#ifdef __VSX__4750return __builtin_vsx_xvnmsubasp(__a, __b, __c);4751#else4752return __builtin_altivec_vnmsubfp(__a, __b, __c);4753#endif4754}47554756#ifdef __VSX__4757static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,4758vector double __b,4759vector double __c) {4760return __builtin_vsx_xvnmsubadp(__a, __b, __c);4761}4762#endif47634764/* vec_vnmsubfp */47654766static __inline__ vector float __attribute__((__always_inline__))4767vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {4768return __builtin_altivec_vnmsubfp(__a, __b, __c);4769}47704771/* vec_nor */47724773#define __builtin_altivec_vnor vec_nor47744775static __inline__ vector signed char __ATTRS_o_ai4776vec_nor(vector signed char __a, vector signed char __b) {4777return ~(__a | __b);4778}47794780static __inline__ vector unsigned char __ATTRS_o_ai4781vec_nor(vector unsigned char __a, vector unsigned char __b) {4782return ~(__a | __b);4783}47844785static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,4786vector bool char __b) {4787return ~(__a | __b);4788}47894790static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,4791vector short __b) {4792return ~(__a | __b);4793}47944795static __inline__ vector unsigned short __ATTRS_o_ai4796vec_nor(vector unsigned short __a, vector unsigned short __b) {4797return ~(__a | __b);4798}47994800static __inline__ vector bool short __ATTRS_o_ai4801vec_nor(vector bool short __a, vector bool short __b) {4802return ~(__a | __b);4803}48044805static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,4806vector int __b) {4807return ~(__a | __b);4808}48094810static __inline__ vector unsigned int __ATTRS_o_ai4811vec_nor(vector unsigned int __a, vector unsigned int __b) {4812return ~(__a | __b);4813}48144815static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,4816vector bool int __b) {4817return ~(__a | __b);4818}48194820static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,4821vector float __b) {4822vector unsigned int __res =4823~((vector unsigned int)__a | (vector unsigned int)__b);4824return (vector float)__res;4825}48264827#ifdef __VSX__4828static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,4829vector double __b) {4830vector unsigned long long __res =4831~((vector unsigned long long)__a | (vector unsigned long long)__b);4832return (vector double)__res;4833}4834#endif48354836/* vec_vnor */48374838static __inline__ vector signed char __ATTRS_o_ai4839vec_vnor(vector signed char __a, vector signed char __b) {4840return ~(__a | __b);4841}48424843static __inline__ vector unsigned char __ATTRS_o_ai4844vec_vnor(vector unsigned char __a, vector unsigned char __b) {4845return ~(__a | __b);4846}48474848static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,4849vector bool char __b) {4850return ~(__a | __b);4851}48524853static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,4854vector short __b) {4855return ~(__a | __b);4856}48574858static __inline__ vector unsigned short __ATTRS_o_ai4859vec_vnor(vector unsigned short __a, vector unsigned short __b) {4860return ~(__a | __b);4861}48624863static __inline__ vector bool short __ATTRS_o_ai4864vec_vnor(vector bool short __a, vector bool short __b) {4865return ~(__a | __b);4866}48674868static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,4869vector int __b) {4870return ~(__a | __b);4871}48724873static __inline__ vector unsigned int __ATTRS_o_ai4874vec_vnor(vector unsigned int __a, vector unsigned int __b) {4875return ~(__a | __b);4876}48774878static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,4879vector bool int __b) {4880return ~(__a | __b);4881}48824883static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,4884vector float __b) {4885vector unsigned int __res =4886~((vector unsigned int)__a | (vector unsigned int)__b);4887return (vector float)__res;4888}48894890#ifdef __VSX__4891static __inline__ vector signed long long __ATTRS_o_ai4892vec_nor(vector signed long long __a, vector signed long long __b) {4893return ~(__a | __b);4894}48954896static __inline__ vector unsigned long long __ATTRS_o_ai4897vec_nor(vector unsigned long long __a, vector unsigned long long __b) {4898return ~(__a | __b);4899}49004901static __inline__ vector bool long long __ATTRS_o_ai4902vec_nor(vector bool long long __a, vector bool long long __b) {4903return ~(__a | __b);4904}4905#endif49064907/* vec_or */49084909#define __builtin_altivec_vor vec_or49104911static __inline__ vector signed char __ATTRS_o_ai4912vec_or(vector signed char __a, vector signed char __b) {4913return __a | __b;4914}49154916static __inline__ vector signed char __ATTRS_o_ai4917vec_or(vector bool char __a, vector signed char __b) {4918return (vector signed char)__a | __b;4919}49204921static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,4922vector bool char __b) {4923return __a | (vector signed char)__b;4924}49254926static __inline__ vector unsigned char __ATTRS_o_ai4927vec_or(vector unsigned char __a, vector unsigned char __b) {4928return __a | __b;4929}49304931static __inline__ vector unsigned char __ATTRS_o_ai4932vec_or(vector bool char __a, vector unsigned char __b) {4933return (vector unsigned char)__a | __b;4934}49354936static __inline__ vector unsigned char __ATTRS_o_ai4937vec_or(vector unsigned char __a, vector bool char __b) {4938return __a | (vector unsigned char)__b;4939}49404941static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,4942vector bool char __b) {4943return __a | __b;4944}49454946static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,4947vector short __b) {4948return __a | __b;4949}49504951static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,4952vector short __b) {4953return (vector short)__a | __b;4954}49554956static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,4957vector bool short __b) {4958return __a | (vector short)__b;4959}49604961static __inline__ vector unsigned short __ATTRS_o_ai4962vec_or(vector unsigned short __a, vector unsigned short __b) {4963return __a | __b;4964}49654966static __inline__ vector unsigned short __ATTRS_o_ai4967vec_or(vector bool short __a, vector unsigned short __b) {4968return (vector unsigned short)__a | __b;4969}49704971static __inline__ vector unsigned short __ATTRS_o_ai4972vec_or(vector unsigned short __a, vector bool short __b) {4973return __a | (vector unsigned short)__b;4974}49754976static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,4977vector bool short __b) {4978return __a | __b;4979}49804981static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,4982vector int __b) {4983return __a | __b;4984}49854986static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,4987vector int __b) {4988return (vector int)__a | __b;4989}49904991static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,4992vector bool int __b) {4993return __a | (vector int)__b;4994}49954996static __inline__ vector unsigned int __ATTRS_o_ai4997vec_or(vector unsigned int __a, vector unsigned int __b) {4998return __a | __b;4999}50005001static __inline__ vector unsigned int __ATTRS_o_ai5002vec_or(vector bool int __a, vector unsigned int __b) {5003return (vector unsigned int)__a | __b;5004}50055006static __inline__ vector unsigned int __ATTRS_o_ai5007vec_or(vector unsigned int __a, vector bool int __b) {5008return __a | (vector unsigned int)__b;5009}50105011static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,5012vector bool int __b) {5013return __a | __b;5014}50155016static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,5017vector float __b) {5018vector unsigned int __res =5019(vector unsigned int)__a | (vector unsigned int)__b;5020return (vector float)__res;5021}50225023static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,5024vector float __b) {5025vector unsigned int __res =5026(vector unsigned int)__a | (vector unsigned int)__b;5027return (vector float)__res;5028}50295030static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,5031vector bool int __b) {5032vector unsigned int __res =5033(vector unsigned int)__a | (vector unsigned int)__b;5034return (vector float)__res;5035}50365037#ifdef __VSX__5038static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,5039vector double __b) {5040return (vector unsigned long long)__a | (vector unsigned long long)__b;5041}50425043static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,5044vector bool long long __b) {5045return (vector unsigned long long)__a | (vector unsigned long long)__b;5046}50475048static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,5049vector double __b) {5050vector unsigned long long __res =5051(vector unsigned long long)__a | (vector unsigned long long)__b;5052return (vector double)__res;5053}50545055static __inline__ vector signed long long __ATTRS_o_ai5056vec_or(vector signed long long __a, vector signed long long __b) {5057return __a | __b;5058}50595060static __inline__ vector signed long long __ATTRS_o_ai5061vec_or(vector bool long long __a, vector signed long long __b) {5062return (vector signed long long)__a | __b;5063}50645065static __inline__ vector signed long long __ATTRS_o_ai5066vec_or(vector signed long long __a, vector bool long long __b) {5067return __a | (vector signed long long)__b;5068}50695070static __inline__ vector unsigned long long __ATTRS_o_ai5071vec_or(vector unsigned long long __a, vector unsigned long long __b) {5072return __a | __b;5073}50745075static __inline__ vector unsigned long long __ATTRS_o_ai5076vec_or(vector bool long long __a, vector unsigned long long __b) {5077return (vector unsigned long long)__a | __b;5078}50795080static __inline__ vector unsigned long long __ATTRS_o_ai5081vec_or(vector unsigned long long __a, vector bool long long __b) {5082return __a | (vector unsigned long long)__b;5083}50845085static __inline__ vector bool long long __ATTRS_o_ai5086vec_or(vector bool long long __a, vector bool long long __b) {5087return __a | __b;5088}5089#endif50905091#ifdef __POWER8_VECTOR__5092static __inline__ vector signed char __ATTRS_o_ai5093vec_orc(vector signed char __a, vector signed char __b) {5094return __a | ~__b;5095}50965097static __inline__ vector signed char __ATTRS_o_ai5098vec_orc(vector signed char __a, vector bool char __b) {5099return __a | ~__b;5100}51015102static __inline__ vector signed char __ATTRS_o_ai5103vec_orc(vector bool char __a, vector signed char __b) {5104return __a | ~__b;5105}51065107static __inline__ vector unsigned char __ATTRS_o_ai5108vec_orc(vector unsigned char __a, vector unsigned char __b) {5109return __a | ~__b;5110}51115112static __inline__ vector unsigned char __ATTRS_o_ai5113vec_orc(vector unsigned char __a, vector bool char __b) {5114return __a | ~__b;5115}51165117static __inline__ vector unsigned char __ATTRS_o_ai5118vec_orc(vector bool char __a, vector unsigned char __b) {5119return __a | ~__b;5120}51215122static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,5123vector bool char __b) {5124return __a | ~__b;5125}51265127static __inline__ vector signed short __ATTRS_o_ai5128vec_orc(vector signed short __a, vector signed short __b) {5129return __a | ~__b;5130}51315132static __inline__ vector signed short __ATTRS_o_ai5133vec_orc(vector signed short __a, vector bool short __b) {5134return __a | ~__b;5135}51365137static __inline__ vector signed short __ATTRS_o_ai5138vec_orc(vector bool short __a, vector signed short __b) {5139return __a | ~__b;5140}51415142static __inline__ vector unsigned short __ATTRS_o_ai5143vec_orc(vector unsigned short __a, vector unsigned short __b) {5144return __a | ~__b;5145}51465147static __inline__ vector unsigned short __ATTRS_o_ai5148vec_orc(vector unsigned short __a, vector bool short __b) {5149return __a | ~__b;5150}51515152static __inline__ vector unsigned short __ATTRS_o_ai5153vec_orc(vector bool short __a, vector unsigned short __b) {5154return __a | ~__b;5155}51565157static __inline__ vector bool short __ATTRS_o_ai5158vec_orc(vector bool short __a, vector bool short __b) {5159return __a | ~__b;5160}51615162static __inline__ vector signed int __ATTRS_o_ai5163vec_orc(vector signed int __a, vector signed int __b) {5164return __a | ~__b;5165}51665167static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,5168vector bool int __b) {5169return __a | ~__b;5170}51715172static __inline__ vector signed int __ATTRS_o_ai5173vec_orc(vector bool int __a, vector signed int __b) {5174return __a | ~__b;5175}51765177static __inline__ vector unsigned int __ATTRS_o_ai5178vec_orc(vector unsigned int __a, vector unsigned int __b) {5179return __a | ~__b;5180}51815182static __inline__ vector unsigned int __ATTRS_o_ai5183vec_orc(vector unsigned int __a, vector bool int __b) {5184return __a | ~__b;5185}51865187static __inline__ vector unsigned int __ATTRS_o_ai5188vec_orc(vector bool int __a, vector unsigned int __b) {5189return __a | ~__b;5190}51915192static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,5193vector bool int __b) {5194return __a | ~__b;5195}51965197static __inline__ vector signed long long __ATTRS_o_ai5198vec_orc(vector signed long long __a, vector signed long long __b) {5199return __a | ~__b;5200}52015202static __inline__ vector signed long long __ATTRS_o_ai5203vec_orc(vector signed long long __a, vector bool long long __b) {5204return __a | ~__b;5205}52065207static __inline__ vector signed long long __ATTRS_o_ai5208vec_orc(vector bool long long __a, vector signed long long __b) {5209return __a | ~__b;5210}52115212static __inline__ vector unsigned long long __ATTRS_o_ai5213vec_orc(vector unsigned long long __a, vector unsigned long long __b) {5214return __a | ~__b;5215}52165217static __inline__ vector unsigned long long __ATTRS_o_ai5218vec_orc(vector unsigned long long __a, vector bool long long __b) {5219return __a | ~__b;5220}52215222static __inline__ vector unsigned long long __ATTRS_o_ai5223vec_orc(vector bool long long __a, vector unsigned long long __b) {5224return __a | ~__b;5225}52265227static __inline__ vector bool long long __ATTRS_o_ai5228vec_orc(vector bool long long __a, vector bool long long __b) {5229return __a | ~__b;5230}5231#endif52325233/* vec_vor */52345235static __inline__ vector signed char __ATTRS_o_ai5236vec_vor(vector signed char __a, vector signed char __b) {5237return __a | __b;5238}52395240static __inline__ vector signed char __ATTRS_o_ai5241vec_vor(vector bool char __a, vector signed char __b) {5242return (vector signed char)__a | __b;5243}52445245static __inline__ vector signed char __ATTRS_o_ai5246vec_vor(vector signed char __a, vector bool char __b) {5247return __a | (vector signed char)__b;5248}52495250static __inline__ vector unsigned char __ATTRS_o_ai5251vec_vor(vector unsigned char __a, vector unsigned char __b) {5252return __a | __b;5253}52545255static __inline__ vector unsigned char __ATTRS_o_ai5256vec_vor(vector bool char __a, vector unsigned char __b) {5257return (vector unsigned char)__a | __b;5258}52595260static __inline__ vector unsigned char __ATTRS_o_ai5261vec_vor(vector unsigned char __a, vector bool char __b) {5262return __a | (vector unsigned char)__b;5263}52645265static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,5266vector bool char __b) {5267return __a | __b;5268}52695270static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,5271vector short __b) {5272return __a | __b;5273}52745275static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,5276vector short __b) {5277return (vector short)__a | __b;5278}52795280static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,5281vector bool short __b) {5282return __a | (vector short)__b;5283}52845285static __inline__ vector unsigned short __ATTRS_o_ai5286vec_vor(vector unsigned short __a, vector unsigned short __b) {5287return __a | __b;5288}52895290static __inline__ vector unsigned short __ATTRS_o_ai5291vec_vor(vector bool short __a, vector unsigned short __b) {5292return (vector unsigned short)__a | __b;5293}52945295static __inline__ vector unsigned short __ATTRS_o_ai5296vec_vor(vector unsigned short __a, vector bool short __b) {5297return __a | (vector unsigned short)__b;5298}52995300static __inline__ vector bool short __ATTRS_o_ai5301vec_vor(vector bool short __a, vector bool short __b) {5302return __a | __b;5303}53045305static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,5306vector int __b) {5307return __a | __b;5308}53095310static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,5311vector int __b) {5312return (vector int)__a | __b;5313}53145315static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,5316vector bool int __b) {5317return __a | (vector int)__b;5318}53195320static __inline__ vector unsigned int __ATTRS_o_ai5321vec_vor(vector unsigned int __a, vector unsigned int __b) {5322return __a | __b;5323}53245325static __inline__ vector unsigned int __ATTRS_o_ai5326vec_vor(vector bool int __a, vector unsigned int __b) {5327return (vector unsigned int)__a | __b;5328}53295330static __inline__ vector unsigned int __ATTRS_o_ai5331vec_vor(vector unsigned int __a, vector bool int __b) {5332return __a | (vector unsigned int)__b;5333}53345335static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,5336vector bool int __b) {5337return __a | __b;5338}53395340static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,5341vector float __b) {5342vector unsigned int __res =5343(vector unsigned int)__a | (vector unsigned int)__b;5344return (vector float)__res;5345}53465347static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,5348vector float __b) {5349vector unsigned int __res =5350(vector unsigned int)__a | (vector unsigned int)__b;5351return (vector float)__res;5352}53535354static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,5355vector bool int __b) {5356vector unsigned int __res =5357(vector unsigned int)__a | (vector unsigned int)__b;5358return (vector float)__res;5359}53605361#ifdef __VSX__5362static __inline__ vector signed long long __ATTRS_o_ai5363vec_vor(vector signed long long __a, vector signed long long __b) {5364return __a | __b;5365}53665367static __inline__ vector signed long long __ATTRS_o_ai5368vec_vor(vector bool long long __a, vector signed long long __b) {5369return (vector signed long long)__a | __b;5370}53715372static __inline__ vector signed long long __ATTRS_o_ai5373vec_vor(vector signed long long __a, vector bool long long __b) {5374return __a | (vector signed long long)__b;5375}53765377static __inline__ vector unsigned long long __ATTRS_o_ai5378vec_vor(vector unsigned long long __a, vector unsigned long long __b) {5379return __a | __b;5380}53815382static __inline__ vector unsigned long long __ATTRS_o_ai5383vec_vor(vector bool long long __a, vector unsigned long long __b) {5384return (vector unsigned long long)__a | __b;5385}53865387static __inline__ vector unsigned long long __ATTRS_o_ai5388vec_vor(vector unsigned long long __a, vector bool long long __b) {5389return __a | (vector unsigned long long)__b;5390}53915392static __inline__ vector bool long long __ATTRS_o_ai5393vec_vor(vector bool long long __a, vector bool long long __b) {5394return __a | __b;5395}5396#endif53975398/* vec_pack */53995400/* The various vector pack instructions have a big-endian bias, so for5401little endian we must handle reversed element numbering. */54025403static __inline__ vector signed char __ATTRS_o_ai5404vec_pack(vector signed short __a, vector signed short __b) {5405#ifdef __LITTLE_ENDIAN__5406return (vector signed char)vec_perm(5407__a, __b,5408(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,54090x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5410#else5411return (vector signed char)vec_perm(5412__a, __b,5413(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,54140x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5415#endif5416}54175418static __inline__ vector unsigned char __ATTRS_o_ai5419vec_pack(vector unsigned short __a, vector unsigned short __b) {5420#ifdef __LITTLE_ENDIAN__5421return (vector unsigned char)vec_perm(5422__a, __b,5423(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,54240x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5425#else5426return (vector unsigned char)vec_perm(5427__a, __b,5428(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,54290x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5430#endif5431}54325433static __inline__ vector bool char __ATTRS_o_ai5434vec_pack(vector bool short __a, vector bool short __b) {5435#ifdef __LITTLE_ENDIAN__5436return (vector bool char)vec_perm(5437__a, __b,5438(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,54390x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5440#else5441return (vector bool char)vec_perm(5442__a, __b,5443(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,54440x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5445#endif5446}54475448static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,5449vector int __b) {5450#ifdef __LITTLE_ENDIAN__5451return (vector short)vec_perm(5452__a, __b,5453(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,54540x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5455#else5456return (vector short)vec_perm(5457__a, __b,5458(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,54590x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5460#endif5461}54625463static __inline__ vector unsigned short __ATTRS_o_ai5464vec_pack(vector unsigned int __a, vector unsigned int __b) {5465#ifdef __LITTLE_ENDIAN__5466return (vector unsigned short)vec_perm(5467__a, __b,5468(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,54690x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5470#else5471return (vector unsigned short)vec_perm(5472__a, __b,5473(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,54740x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5475#endif5476}54775478static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,5479vector bool int __b) {5480#ifdef __LITTLE_ENDIAN__5481return (vector bool short)vec_perm(5482__a, __b,5483(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,54840x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5485#else5486return (vector bool short)vec_perm(5487__a, __b,5488(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,54890x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5490#endif5491}54925493#ifdef __VSX__5494static __inline__ vector signed int __ATTRS_o_ai5495vec_pack(vector signed long long __a, vector signed long long __b) {5496#ifdef __LITTLE_ENDIAN__5497return (vector signed int)vec_perm(5498__a, __b,5499(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,55000x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5501#else5502return (vector signed int)vec_perm(5503__a, __b,5504(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,55050x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5506#endif5507}5508static __inline__ vector unsigned int __ATTRS_o_ai5509vec_pack(vector unsigned long long __a, vector unsigned long long __b) {5510#ifdef __LITTLE_ENDIAN__5511return (vector unsigned int)vec_perm(5512__a, __b,5513(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,55140x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5515#else5516return (vector unsigned int)vec_perm(5517__a, __b,5518(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,55190x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5520#endif5521}55225523static __inline__ vector bool int __ATTRS_o_ai5524vec_pack(vector bool long long __a, vector bool long long __b) {5525#ifdef __LITTLE_ENDIAN__5526return (vector bool int)vec_perm(5527__a, __b,5528(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,55290x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5530#else5531return (vector bool int)vec_perm(5532__a, __b,5533(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,55340x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5535#endif5536}55375538#endif55395540/* vec_vpkuhum */55415542#define __builtin_altivec_vpkuhum vec_vpkuhum55435544static __inline__ vector signed char __ATTRS_o_ai5545vec_vpkuhum(vector signed short __a, vector signed short __b) {5546#ifdef __LITTLE_ENDIAN__5547return (vector signed char)vec_perm(5548__a, __b,5549(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,55500x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5551#else5552return (vector signed char)vec_perm(5553__a, __b,5554(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,55550x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5556#endif5557}55585559static __inline__ vector unsigned char __ATTRS_o_ai5560vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {5561#ifdef __LITTLE_ENDIAN__5562return (vector unsigned char)vec_perm(5563__a, __b,5564(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,55650x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5566#else5567return (vector unsigned char)vec_perm(5568__a, __b,5569(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,55700x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5571#endif5572}55735574static __inline__ vector bool char __ATTRS_o_ai5575vec_vpkuhum(vector bool short __a, vector bool short __b) {5576#ifdef __LITTLE_ENDIAN__5577return (vector bool char)vec_perm(5578__a, __b,5579(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,55800x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));5581#else5582return (vector bool char)vec_perm(5583__a, __b,5584(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,55850x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));5586#endif5587}55885589/* vec_vpkuwum */55905591#define __builtin_altivec_vpkuwum vec_vpkuwum55925593static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,5594vector int __b) {5595#ifdef __LITTLE_ENDIAN__5596return (vector short)vec_perm(5597__a, __b,5598(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,55990x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5600#else5601return (vector short)vec_perm(5602__a, __b,5603(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,56040x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5605#endif5606}56075608static __inline__ vector unsigned short __ATTRS_o_ai5609vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {5610#ifdef __LITTLE_ENDIAN__5611return (vector unsigned short)vec_perm(5612__a, __b,5613(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,56140x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5615#else5616return (vector unsigned short)vec_perm(5617__a, __b,5618(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,56190x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5620#endif5621}56225623static __inline__ vector bool short __ATTRS_o_ai5624vec_vpkuwum(vector bool int __a, vector bool int __b) {5625#ifdef __LITTLE_ENDIAN__5626return (vector bool short)vec_perm(5627__a, __b,5628(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,56290x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));5630#else5631return (vector bool short)vec_perm(5632__a, __b,5633(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,56340x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));5635#endif5636}56375638/* vec_vpkudum */56395640#ifdef __POWER8_VECTOR__5641#define __builtin_altivec_vpkudum vec_vpkudum56425643static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,5644vector long long __b) {5645#ifdef __LITTLE_ENDIAN__5646return (vector int)vec_perm(5647__a, __b,5648(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,56490x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5650#else5651return (vector int)vec_perm(5652__a, __b,5653(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,56540x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5655#endif5656}56575658static __inline__ vector unsigned int __ATTRS_o_ai5659vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {5660#ifdef __LITTLE_ENDIAN__5661return (vector unsigned int)vec_perm(5662__a, __b,5663(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,56640x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5665#else5666return (vector unsigned int)vec_perm(5667__a, __b,5668(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,56690x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5670#endif5671}56725673static __inline__ vector bool int __ATTRS_o_ai5674vec_vpkudum(vector bool long long __a, vector bool long long __b) {5675#ifdef __LITTLE_ENDIAN__5676return (vector bool int)vec_perm(5677(vector long long)__a, (vector long long)__b,5678(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,56790x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));5680#else5681return (vector bool int)vec_perm(5682(vector long long)__a, (vector long long)__b,5683(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,56840x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));5685#endif5686}5687#endif56885689/* vec_packpx */56905691static __inline__ vector pixel __attribute__((__always_inline__))5692vec_packpx(vector unsigned int __a, vector unsigned int __b) {5693#ifdef __LITTLE_ENDIAN__5694return (vector pixel)__builtin_altivec_vpkpx(__b, __a);5695#else5696return (vector pixel)__builtin_altivec_vpkpx(__a, __b);5697#endif5698}56995700/* vec_vpkpx */57015702static __inline__ vector pixel __attribute__((__always_inline__))5703vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {5704#ifdef __LITTLE_ENDIAN__5705return (vector pixel)__builtin_altivec_vpkpx(__b, __a);5706#else5707return (vector pixel)__builtin_altivec_vpkpx(__a, __b);5708#endif5709}57105711/* vec_packs */57125713static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,5714vector short __b) {5715#ifdef __LITTLE_ENDIAN__5716return __builtin_altivec_vpkshss(__b, __a);5717#else5718return __builtin_altivec_vpkshss(__a, __b);5719#endif5720}57215722static __inline__ vector unsigned char __ATTRS_o_ai5723vec_packs(vector unsigned short __a, vector unsigned short __b) {5724#ifdef __LITTLE_ENDIAN__5725return __builtin_altivec_vpkuhus(__b, __a);5726#else5727return __builtin_altivec_vpkuhus(__a, __b);5728#endif5729}57305731static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,5732vector int __b) {5733#ifdef __LITTLE_ENDIAN__5734return __builtin_altivec_vpkswss(__b, __a);5735#else5736return __builtin_altivec_vpkswss(__a, __b);5737#endif5738}57395740static __inline__ vector unsigned short __ATTRS_o_ai5741vec_packs(vector unsigned int __a, vector unsigned int __b) {5742#ifdef __LITTLE_ENDIAN__5743return __builtin_altivec_vpkuwus(__b, __a);5744#else5745return __builtin_altivec_vpkuwus(__a, __b);5746#endif5747}57485749#ifdef __POWER8_VECTOR__5750static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,5751vector long long __b) {5752#ifdef __LITTLE_ENDIAN__5753return __builtin_altivec_vpksdss(__b, __a);5754#else5755return __builtin_altivec_vpksdss(__a, __b);5756#endif5757}57585759static __inline__ vector unsigned int __ATTRS_o_ai5760vec_packs(vector unsigned long long __a, vector unsigned long long __b) {5761#ifdef __LITTLE_ENDIAN__5762return __builtin_altivec_vpkudus(__b, __a);5763#else5764return __builtin_altivec_vpkudus(__a, __b);5765#endif5766}5767#endif57685769/* vec_vpkshss */57705771static __inline__ vector signed char __attribute__((__always_inline__))5772vec_vpkshss(vector short __a, vector short __b) {5773#ifdef __LITTLE_ENDIAN__5774return __builtin_altivec_vpkshss(__b, __a);5775#else5776return __builtin_altivec_vpkshss(__a, __b);5777#endif5778}57795780/* vec_vpksdss */57815782#ifdef __POWER8_VECTOR__5783static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,5784vector long long __b) {5785#ifdef __LITTLE_ENDIAN__5786return __builtin_altivec_vpksdss(__b, __a);5787#else5788return __builtin_altivec_vpksdss(__a, __b);5789#endif5790}5791#endif57925793/* vec_vpkuhus */57945795static __inline__ vector unsigned char __attribute__((__always_inline__))5796vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {5797#ifdef __LITTLE_ENDIAN__5798return __builtin_altivec_vpkuhus(__b, __a);5799#else5800return __builtin_altivec_vpkuhus(__a, __b);5801#endif5802}58035804/* vec_vpkudus */58055806#ifdef __POWER8_VECTOR__5807static __inline__ vector unsigned int __attribute__((__always_inline__))5808vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {5809#ifdef __LITTLE_ENDIAN__5810return __builtin_altivec_vpkudus(__b, __a);5811#else5812return __builtin_altivec_vpkudus(__a, __b);5813#endif5814}5815#endif58165817/* vec_vpkswss */58185819static __inline__ vector signed short __attribute__((__always_inline__))5820vec_vpkswss(vector int __a, vector int __b) {5821#ifdef __LITTLE_ENDIAN__5822return __builtin_altivec_vpkswss(__b, __a);5823#else5824return __builtin_altivec_vpkswss(__a, __b);5825#endif5826}58275828/* vec_vpkuwus */58295830static __inline__ vector unsigned short __attribute__((__always_inline__))5831vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {5832#ifdef __LITTLE_ENDIAN__5833return __builtin_altivec_vpkuwus(__b, __a);5834#else5835return __builtin_altivec_vpkuwus(__a, __b);5836#endif5837}58385839/* vec_packsu */58405841static __inline__ vector unsigned char __ATTRS_o_ai5842vec_packsu(vector short __a, vector short __b) {5843#ifdef __LITTLE_ENDIAN__5844return __builtin_altivec_vpkshus(__b, __a);5845#else5846return __builtin_altivec_vpkshus(__a, __b);5847#endif5848}58495850static __inline__ vector unsigned char __ATTRS_o_ai5851vec_packsu(vector unsigned short __a, vector unsigned short __b) {5852#ifdef __LITTLE_ENDIAN__5853return __builtin_altivec_vpkuhus(__b, __a);5854#else5855return __builtin_altivec_vpkuhus(__a, __b);5856#endif5857}58585859static __inline__ vector unsigned short __ATTRS_o_ai5860vec_packsu(vector int __a, vector int __b) {5861#ifdef __LITTLE_ENDIAN__5862return __builtin_altivec_vpkswus(__b, __a);5863#else5864return __builtin_altivec_vpkswus(__a, __b);5865#endif5866}58675868static __inline__ vector unsigned short __ATTRS_o_ai5869vec_packsu(vector unsigned int __a, vector unsigned int __b) {5870#ifdef __LITTLE_ENDIAN__5871return __builtin_altivec_vpkuwus(__b, __a);5872#else5873return __builtin_altivec_vpkuwus(__a, __b);5874#endif5875}58765877#ifdef __POWER8_VECTOR__5878static __inline__ vector unsigned int __ATTRS_o_ai5879vec_packsu(vector long long __a, vector long long __b) {5880#ifdef __LITTLE_ENDIAN__5881return __builtin_altivec_vpksdus(__b, __a);5882#else5883return __builtin_altivec_vpksdus(__a, __b);5884#endif5885}58865887static __inline__ vector unsigned int __ATTRS_o_ai5888vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {5889#ifdef __LITTLE_ENDIAN__5890return __builtin_altivec_vpkudus(__b, __a);5891#else5892return __builtin_altivec_vpkudus(__a, __b);5893#endif5894}5895#endif58965897/* vec_vpkshus */58985899static __inline__ vector unsigned char __ATTRS_o_ai5900vec_vpkshus(vector short __a, vector short __b) {5901#ifdef __LITTLE_ENDIAN__5902return __builtin_altivec_vpkshus(__b, __a);5903#else5904return __builtin_altivec_vpkshus(__a, __b);5905#endif5906}59075908static __inline__ vector unsigned char __ATTRS_o_ai5909vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {5910#ifdef __LITTLE_ENDIAN__5911return __builtin_altivec_vpkuhus(__b, __a);5912#else5913return __builtin_altivec_vpkuhus(__a, __b);5914#endif5915}59165917/* vec_vpkswus */59185919static __inline__ vector unsigned short __ATTRS_o_ai5920vec_vpkswus(vector int __a, vector int __b) {5921#ifdef __LITTLE_ENDIAN__5922return __builtin_altivec_vpkswus(__b, __a);5923#else5924return __builtin_altivec_vpkswus(__a, __b);5925#endif5926}59275928static __inline__ vector unsigned short __ATTRS_o_ai5929vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {5930#ifdef __LITTLE_ENDIAN__5931return __builtin_altivec_vpkuwus(__b, __a);5932#else5933return __builtin_altivec_vpkuwus(__a, __b);5934#endif5935}59365937/* vec_vpksdus */59385939#ifdef __POWER8_VECTOR__5940static __inline__ vector unsigned int __ATTRS_o_ai5941vec_vpksdus(vector long long __a, vector long long __b) {5942#ifdef __LITTLE_ENDIAN__5943return __builtin_altivec_vpksdus(__b, __a);5944#else5945return __builtin_altivec_vpksdus(__a, __b);5946#endif5947}5948#endif59495950/* vec_perm */59515952// The vperm instruction is defined architecturally with a big-endian bias.5953// For little endian, we swap the input operands and invert the permute5954// control vector. Only the rightmost 5 bits matter, so we could use5955// a vector of all 31s instead of all 255s to perform the inversion.5956// However, when the PCV is not a constant, using 255 has an advantage5957// in that the vec_xor can be recognized as a vec_nor (and for P8 and5958// later, possibly a vec_nand).59595960static __inline__ vector signed char __ATTRS_o_ai vec_perm(5961vector signed char __a, vector signed char __b, vector unsigned char __c) {5962#ifdef __LITTLE_ENDIAN__5963vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,5964255, 255, 255, 255, 255, 255, 255, 255};5965__d = vec_xor(__c, __d);5966return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,5967(vector int)__a, __d);5968#else5969return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,5970(vector int)__b, __c);5971#endif5972}59735974static __inline__ vector unsigned char __ATTRS_o_ai5975vec_perm(vector unsigned char __a, vector unsigned char __b,5976vector unsigned char __c) {5977#ifdef __LITTLE_ENDIAN__5978vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,5979255, 255, 255, 255, 255, 255, 255, 255};5980__d = vec_xor(__c, __d);5981return (vector unsigned char)__builtin_altivec_vperm_4si(5982(vector int)__b, (vector int)__a, __d);5983#else5984return (vector unsigned char)__builtin_altivec_vperm_4si(5985(vector int)__a, (vector int)__b, __c);5986#endif5987}59885989static __inline__ vector bool char __ATTRS_o_ai5990vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {5991#ifdef __LITTLE_ENDIAN__5992vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,5993255, 255, 255, 255, 255, 255, 255, 255};5994__d = vec_xor(__c, __d);5995return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,5996(vector int)__a, __d);5997#else5998return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,5999(vector int)__b, __c);6000#endif6001}60026003static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,6004vector signed short __b,6005vector unsigned char __c) {6006#ifdef __LITTLE_ENDIAN__6007vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6008255, 255, 255, 255, 255, 255, 255, 255};6009__d = vec_xor(__c, __d);6010return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,6011(vector int)__a, __d);6012#else6013return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,6014(vector int)__b, __c);6015#endif6016}60176018static __inline__ vector unsigned short __ATTRS_o_ai6019vec_perm(vector unsigned short __a, vector unsigned short __b,6020vector unsigned char __c) {6021#ifdef __LITTLE_ENDIAN__6022vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6023255, 255, 255, 255, 255, 255, 255, 255};6024__d = vec_xor(__c, __d);6025return (vector unsigned short)__builtin_altivec_vperm_4si(6026(vector int)__b, (vector int)__a, __d);6027#else6028return (vector unsigned short)__builtin_altivec_vperm_4si(6029(vector int)__a, (vector int)__b, __c);6030#endif6031}60326033static __inline__ vector bool short __ATTRS_o_ai vec_perm(6034vector bool short __a, vector bool short __b, vector unsigned char __c) {6035#ifdef __LITTLE_ENDIAN__6036vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6037255, 255, 255, 255, 255, 255, 255, 255};6038__d = vec_xor(__c, __d);6039return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,6040(vector int)__a, __d);6041#else6042return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,6043(vector int)__b, __c);6044#endif6045}60466047static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,6048vector pixel __b,6049vector unsigned char __c) {6050#ifdef __LITTLE_ENDIAN__6051vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6052255, 255, 255, 255, 255, 255, 255, 255};6053__d = vec_xor(__c, __d);6054return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,6055(vector int)__a, __d);6056#else6057return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,6058(vector int)__b, __c);6059#endif6060}60616062static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,6063vector signed int __b,6064vector unsigned char __c) {6065#ifdef __LITTLE_ENDIAN__6066vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6067255, 255, 255, 255, 255, 255, 255, 255};6068__d = vec_xor(__c, __d);6069return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);6070#else6071return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);6072#endif6073}60746075static __inline__ vector unsigned int __ATTRS_o_ai6076vec_perm(vector unsigned int __a, vector unsigned int __b,6077vector unsigned char __c) {6078#ifdef __LITTLE_ENDIAN__6079vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6080255, 255, 255, 255, 255, 255, 255, 255};6081__d = vec_xor(__c, __d);6082return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,6083(vector int)__a, __d);6084#else6085return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,6086(vector int)__b, __c);6087#endif6088}60896090static __inline__ vector bool int __ATTRS_o_ai6091vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {6092#ifdef __LITTLE_ENDIAN__6093vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6094255, 255, 255, 255, 255, 255, 255, 255};6095__d = vec_xor(__c, __d);6096return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,6097(vector int)__a, __d);6098#else6099return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,6100(vector int)__b, __c);6101#endif6102}61036104static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,6105vector float __b,6106vector unsigned char __c) {6107#ifdef __LITTLE_ENDIAN__6108vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6109255, 255, 255, 255, 255, 255, 255, 255};6110__d = vec_xor(__c, __d);6111return (vector float)__builtin_altivec_vperm_4si((vector int)__b,6112(vector int)__a, __d);6113#else6114return (vector float)__builtin_altivec_vperm_4si((vector int)__a,6115(vector int)__b, __c);6116#endif6117}61186119#ifdef __VSX__6120static __inline__ vector long long __ATTRS_o_ai6121vec_perm(vector signed long long __a, vector signed long long __b,6122vector unsigned char __c) {6123#ifdef __LITTLE_ENDIAN__6124vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6125255, 255, 255, 255, 255, 255, 255, 255};6126__d = vec_xor(__c, __d);6127return (vector signed long long)__builtin_altivec_vperm_4si(6128(vector int)__b, (vector int)__a, __d);6129#else6130return (vector signed long long)__builtin_altivec_vperm_4si(6131(vector int)__a, (vector int)__b, __c);6132#endif6133}61346135static __inline__ vector unsigned long long __ATTRS_o_ai6136vec_perm(vector unsigned long long __a, vector unsigned long long __b,6137vector unsigned char __c) {6138#ifdef __LITTLE_ENDIAN__6139vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6140255, 255, 255, 255, 255, 255, 255, 255};6141__d = vec_xor(__c, __d);6142return (vector unsigned long long)__builtin_altivec_vperm_4si(6143(vector int)__b, (vector int)__a, __d);6144#else6145return (vector unsigned long long)__builtin_altivec_vperm_4si(6146(vector int)__a, (vector int)__b, __c);6147#endif6148}61496150static __inline__ vector bool long long __ATTRS_o_ai6151vec_perm(vector bool long long __a, vector bool long long __b,6152vector unsigned char __c) {6153#ifdef __LITTLE_ENDIAN__6154vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6155255, 255, 255, 255, 255, 255, 255, 255};6156__d = vec_xor(__c, __d);6157return (vector bool long long)__builtin_altivec_vperm_4si(6158(vector int)__b, (vector int)__a, __d);6159#else6160return (vector bool long long)__builtin_altivec_vperm_4si(6161(vector int)__a, (vector int)__b, __c);6162#endif6163}61646165static __inline__ vector double __ATTRS_o_ai6166vec_perm(vector double __a, vector double __b, vector unsigned char __c) {6167#ifdef __LITTLE_ENDIAN__6168vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,6169255, 255, 255, 255, 255, 255, 255, 255};6170__d = vec_xor(__c, __d);6171return (vector double)__builtin_altivec_vperm_4si((vector int)__b,6172(vector int)__a, __d);6173#else6174return (vector double)__builtin_altivec_vperm_4si((vector int)__a,6175(vector int)__b, __c);6176#endif6177}6178#endif61796180/* vec_vperm */61816182static __inline__ vector signed char __ATTRS_o_ai vec_vperm(6183vector signed char __a, vector signed char __b, vector unsigned char __c) {6184return vec_perm(__a, __b, __c);6185}61866187static __inline__ vector unsigned char __ATTRS_o_ai6188vec_vperm(vector unsigned char __a, vector unsigned char __b,6189vector unsigned char __c) {6190return vec_perm(__a, __b, __c);6191}61926193static __inline__ vector bool char __ATTRS_o_ai vec_vperm(6194vector bool char __a, vector bool char __b, vector unsigned char __c) {6195return vec_perm(__a, __b, __c);6196}61976198static __inline__ vector short __ATTRS_o_ai6199vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {6200return vec_perm(__a, __b, __c);6201}62026203static __inline__ vector unsigned short __ATTRS_o_ai6204vec_vperm(vector unsigned short __a, vector unsigned short __b,6205vector unsigned char __c) {6206return vec_perm(__a, __b, __c);6207}62086209static __inline__ vector bool short __ATTRS_o_ai vec_vperm(6210vector bool short __a, vector bool short __b, vector unsigned char __c) {6211return vec_perm(__a, __b, __c);6212}62136214static __inline__ vector pixel __ATTRS_o_ai6215vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {6216return vec_perm(__a, __b, __c);6217}62186219static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,6220vector int __b,6221vector unsigned char __c) {6222return vec_perm(__a, __b, __c);6223}62246225static __inline__ vector unsigned int __ATTRS_o_ai6226vec_vperm(vector unsigned int __a, vector unsigned int __b,6227vector unsigned char __c) {6228return vec_perm(__a, __b, __c);6229}62306231static __inline__ vector bool int __ATTRS_o_ai6232vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {6233return vec_perm(__a, __b, __c);6234}62356236static __inline__ vector float __ATTRS_o_ai6237vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {6238return vec_perm(__a, __b, __c);6239}62406241#ifdef __VSX__6242static __inline__ vector long long __ATTRS_o_ai vec_vperm(6243vector long long __a, vector long long __b, vector unsigned char __c) {6244return vec_perm(__a, __b, __c);6245}62466247static __inline__ vector unsigned long long __ATTRS_o_ai6248vec_vperm(vector unsigned long long __a, vector unsigned long long __b,6249vector unsigned char __c) {6250return vec_perm(__a, __b, __c);6251}62526253static __inline__ vector double __ATTRS_o_ai6254vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {6255return vec_perm(__a, __b, __c);6256}6257#endif62586259/* vec_re */62606261static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {6262#ifdef __VSX__6263return __builtin_vsx_xvresp(__a);6264#else6265return __builtin_altivec_vrefp(__a);6266#endif6267}62686269#ifdef __VSX__6270static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {6271return __builtin_vsx_xvredp(__a);6272}6273#endif62746275/* vec_vrefp */62766277static __inline__ vector float __attribute__((__always_inline__))6278vec_vrefp(vector float __a) {6279return __builtin_altivec_vrefp(__a);6280}62816282/* vec_rl */62836284static __inline__ vector signed char __ATTRS_o_ai6285vec_rl(vector signed char __a, vector unsigned char __b) {6286return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);6287}62886289static __inline__ vector unsigned char __ATTRS_o_ai6290vec_rl(vector unsigned char __a, vector unsigned char __b) {6291return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);6292}62936294static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,6295vector unsigned short __b) {6296return __builtin_altivec_vrlh(__a, __b);6297}62986299static __inline__ vector unsigned short __ATTRS_o_ai6300vec_rl(vector unsigned short __a, vector unsigned short __b) {6301return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);6302}63036304static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,6305vector unsigned int __b) {6306return __builtin_altivec_vrlw(__a, __b);6307}63086309static __inline__ vector unsigned int __ATTRS_o_ai6310vec_rl(vector unsigned int __a, vector unsigned int __b) {6311return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);6312}63136314#ifdef __POWER8_VECTOR__6315static __inline__ vector signed long long __ATTRS_o_ai6316vec_rl(vector signed long long __a, vector unsigned long long __b) {6317return __builtin_altivec_vrld(__a, __b);6318}63196320static __inline__ vector unsigned long long __ATTRS_o_ai6321vec_rl(vector unsigned long long __a, vector unsigned long long __b) {6322return __builtin_altivec_vrld(__a, __b);6323}6324#endif63256326/* vec_vrlb */63276328static __inline__ vector signed char __ATTRS_o_ai6329vec_vrlb(vector signed char __a, vector unsigned char __b) {6330return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);6331}63326333static __inline__ vector unsigned char __ATTRS_o_ai6334vec_vrlb(vector unsigned char __a, vector unsigned char __b) {6335return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);6336}63376338/* vec_vrlh */63396340static __inline__ vector short __ATTRS_o_ai6341vec_vrlh(vector short __a, vector unsigned short __b) {6342return __builtin_altivec_vrlh(__a, __b);6343}63446345static __inline__ vector unsigned short __ATTRS_o_ai6346vec_vrlh(vector unsigned short __a, vector unsigned short __b) {6347return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);6348}63496350/* vec_vrlw */63516352static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,6353vector unsigned int __b) {6354return __builtin_altivec_vrlw(__a, __b);6355}63566357static __inline__ vector unsigned int __ATTRS_o_ai6358vec_vrlw(vector unsigned int __a, vector unsigned int __b) {6359return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);6360}63616362/* vec_round */63636364static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {6365#ifdef __VSX__6366return __builtin_vsx_xvrspi(__a);6367#else6368return __builtin_altivec_vrfin(__a);6369#endif6370}63716372#ifdef __VSX__6373static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {6374return __builtin_vsx_xvrdpi(__a);6375}63766377/* vec_rint */63786379static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {6380return __builtin_vsx_xvrspic(__a);6381}63826383static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {6384return __builtin_vsx_xvrdpic(__a);6385}63866387/* vec_nearbyint */63886389static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {6390return __builtin_vsx_xvrspi(__a);6391}63926393static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {6394return __builtin_vsx_xvrdpi(__a);6395}6396#endif63976398/* vec_vrfin */63996400static __inline__ vector float __attribute__((__always_inline__))6401vec_vrfin(vector float __a) {6402return __builtin_altivec_vrfin(__a);6403}64046405/* vec_sqrt */64066407#ifdef __VSX__6408static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {6409return __builtin_vsx_xvsqrtsp(__a);6410}64116412static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {6413return __builtin_vsx_xvsqrtdp(__a);6414}6415#endif64166417/* vec_rsqrte */64186419static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {6420#ifdef __VSX__6421return __builtin_vsx_xvrsqrtesp(__a);6422#else6423return __builtin_altivec_vrsqrtefp(__a);6424#endif6425}64266427#ifdef __VSX__6428static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {6429return __builtin_vsx_xvrsqrtedp(__a);6430}6431#endif64326433/* vec_vrsqrtefp */64346435static __inline__ __vector float __attribute__((__always_inline__))6436vec_vrsqrtefp(vector float __a) {6437return __builtin_altivec_vrsqrtefp(__a);6438}64396440/* vec_sel */64416442#define __builtin_altivec_vsel_4si vec_sel64436444static __inline__ vector signed char __ATTRS_o_ai vec_sel(6445vector signed char __a, vector signed char __b, vector unsigned char __c) {6446return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);6447}64486449static __inline__ vector signed char __ATTRS_o_ai6450vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {6451return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);6452}64536454static __inline__ vector unsigned char __ATTRS_o_ai6455vec_sel(vector unsigned char __a, vector unsigned char __b,6456vector unsigned char __c) {6457return (__a & ~__c) | (__b & __c);6458}64596460static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(6461vector unsigned char __a, vector unsigned char __b, vector bool char __c) {6462return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);6463}64646465static __inline__ vector bool char __ATTRS_o_ai6466vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {6467return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);6468}64696470static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,6471vector bool char __b,6472vector bool char __c) {6473return (__a & ~__c) | (__b & __c);6474}64756476static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,6477vector short __b,6478vector unsigned short __c) {6479return (__a & ~(vector short)__c) | (__b & (vector short)__c);6480}64816482static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,6483vector short __b,6484vector bool short __c) {6485return (__a & ~(vector short)__c) | (__b & (vector short)__c);6486}64876488static __inline__ vector unsigned short __ATTRS_o_ai6489vec_sel(vector unsigned short __a, vector unsigned short __b,6490vector unsigned short __c) {6491return (__a & ~__c) | (__b & __c);6492}64936494static __inline__ vector unsigned short __ATTRS_o_ai6495vec_sel(vector unsigned short __a, vector unsigned short __b,6496vector bool short __c) {6497return (__a & ~(vector unsigned short)__c) |6498(__b & (vector unsigned short)__c);6499}65006501static __inline__ vector bool short __ATTRS_o_ai vec_sel(6502vector bool short __a, vector bool short __b, vector unsigned short __c) {6503return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);6504}65056506static __inline__ vector bool short __ATTRS_o_ai6507vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {6508return (__a & ~__c) | (__b & __c);6509}65106511static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,6512vector int __b,6513vector unsigned int __c) {6514return (__a & ~(vector int)__c) | (__b & (vector int)__c);6515}65166517static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,6518vector int __b,6519vector bool int __c) {6520return (__a & ~(vector int)__c) | (__b & (vector int)__c);6521}65226523static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(6524vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {6525return (__a & ~__c) | (__b & __c);6526}65276528static __inline__ vector unsigned int __ATTRS_o_ai6529vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {6530return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);6531}65326533static __inline__ vector bool int __ATTRS_o_ai6534vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {6535return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);6536}65376538static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,6539vector bool int __b,6540vector bool int __c) {6541return (__a & ~__c) | (__b & __c);6542}65436544static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,6545vector float __b,6546vector unsigned int __c) {6547vector int __res = ((vector int)__a & ~(vector int)__c) |6548((vector int)__b & (vector int)__c);6549return (vector float)__res;6550}65516552static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,6553vector float __b,6554vector bool int __c) {6555vector int __res = ((vector int)__a & ~(vector int)__c) |6556((vector int)__b & (vector int)__c);6557return (vector float)__res;6558}65596560#ifdef __VSX__6561static __inline__ vector double __ATTRS_o_ai6562vec_sel(vector double __a, vector double __b, vector bool long long __c) {6563vector long long __res = ((vector long long)__a & ~(vector long long)__c) |6564((vector long long)__b & (vector long long)__c);6565return (vector double)__res;6566}65676568static __inline__ vector double __ATTRS_o_ai6569vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {6570vector long long __res = ((vector long long)__a & ~(vector long long)__c) |6571((vector long long)__b & (vector long long)__c);6572return (vector double)__res;6573}6574#endif65756576/* vec_vsel */65776578static __inline__ vector signed char __ATTRS_o_ai vec_vsel(6579vector signed char __a, vector signed char __b, vector unsigned char __c) {6580return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);6581}65826583static __inline__ vector signed char __ATTRS_o_ai6584vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {6585return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);6586}65876588static __inline__ vector unsigned char __ATTRS_o_ai6589vec_vsel(vector unsigned char __a, vector unsigned char __b,6590vector unsigned char __c) {6591return (__a & ~__c) | (__b & __c);6592}65936594static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(6595vector unsigned char __a, vector unsigned char __b, vector bool char __c) {6596return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);6597}65986599static __inline__ vector bool char __ATTRS_o_ai6600vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {6601return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);6602}66036604static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,6605vector bool char __b,6606vector bool char __c) {6607return (__a & ~__c) | (__b & __c);6608}66096610static __inline__ vector short __ATTRS_o_ai6611vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {6612return (__a & ~(vector short)__c) | (__b & (vector short)__c);6613}66146615static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,6616vector short __b,6617vector bool short __c) {6618return (__a & ~(vector short)__c) | (__b & (vector short)__c);6619}66206621static __inline__ vector unsigned short __ATTRS_o_ai6622vec_vsel(vector unsigned short __a, vector unsigned short __b,6623vector unsigned short __c) {6624return (__a & ~__c) | (__b & __c);6625}66266627static __inline__ vector unsigned short __ATTRS_o_ai6628vec_vsel(vector unsigned short __a, vector unsigned short __b,6629vector bool short __c) {6630return (__a & ~(vector unsigned short)__c) |6631(__b & (vector unsigned short)__c);6632}66336634static __inline__ vector bool short __ATTRS_o_ai vec_vsel(6635vector bool short __a, vector bool short __b, vector unsigned short __c) {6636return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);6637}66386639static __inline__ vector bool short __ATTRS_o_ai6640vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {6641return (__a & ~__c) | (__b & __c);6642}66436644static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,6645vector int __b,6646vector unsigned int __c) {6647return (__a & ~(vector int)__c) | (__b & (vector int)__c);6648}66496650static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,6651vector int __b,6652vector bool int __c) {6653return (__a & ~(vector int)__c) | (__b & (vector int)__c);6654}66556656static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(6657vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {6658return (__a & ~__c) | (__b & __c);6659}66606661static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(6662vector unsigned int __a, vector unsigned int __b, vector bool int __c) {6663return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);6664}66656666static __inline__ vector bool int __ATTRS_o_ai6667vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {6668return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);6669}66706671static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,6672vector bool int __b,6673vector bool int __c) {6674return (__a & ~__c) | (__b & __c);6675}66766677static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,6678vector float __b,6679vector unsigned int __c) {6680vector int __res = ((vector int)__a & ~(vector int)__c) |6681((vector int)__b & (vector int)__c);6682return (vector float)__res;6683}66846685static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,6686vector float __b,6687vector bool int __c) {6688vector int __res = ((vector int)__a & ~(vector int)__c) |6689((vector int)__b & (vector int)__c);6690return (vector float)__res;6691}66926693/* vec_sl */66946695static __inline__ vector signed char __ATTRS_o_ai6696vec_sl(vector signed char __a, vector unsigned char __b) {6697return __a << (vector signed char)__b;6698}66996700static __inline__ vector unsigned char __ATTRS_o_ai6701vec_sl(vector unsigned char __a, vector unsigned char __b) {6702return __a << __b;6703}67046705static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,6706vector unsigned short __b) {6707return __a << (vector short)__b;6708}67096710static __inline__ vector unsigned short __ATTRS_o_ai6711vec_sl(vector unsigned short __a, vector unsigned short __b) {6712return __a << __b;6713}67146715static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,6716vector unsigned int __b) {6717return __a << (vector int)__b;6718}67196720static __inline__ vector unsigned int __ATTRS_o_ai6721vec_sl(vector unsigned int __a, vector unsigned int __b) {6722return __a << __b;6723}67246725#ifdef __POWER8_VECTOR__6726static __inline__ vector signed long long __ATTRS_o_ai6727vec_sl(vector signed long long __a, vector unsigned long long __b) {6728return __a << (vector long long)__b;6729}67306731static __inline__ vector unsigned long long __ATTRS_o_ai6732vec_sl(vector unsigned long long __a, vector unsigned long long __b) {6733return __a << __b;6734}6735#endif67366737/* vec_vslb */67386739#define __builtin_altivec_vslb vec_vslb67406741static __inline__ vector signed char __ATTRS_o_ai6742vec_vslb(vector signed char __a, vector unsigned char __b) {6743return vec_sl(__a, __b);6744}67456746static __inline__ vector unsigned char __ATTRS_o_ai6747vec_vslb(vector unsigned char __a, vector unsigned char __b) {6748return vec_sl(__a, __b);6749}67506751/* vec_vslh */67526753#define __builtin_altivec_vslh vec_vslh67546755static __inline__ vector short __ATTRS_o_ai6756vec_vslh(vector short __a, vector unsigned short __b) {6757return vec_sl(__a, __b);6758}67596760static __inline__ vector unsigned short __ATTRS_o_ai6761vec_vslh(vector unsigned short __a, vector unsigned short __b) {6762return vec_sl(__a, __b);6763}67646765/* vec_vslw */67666767#define __builtin_altivec_vslw vec_vslw67686769static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,6770vector unsigned int __b) {6771return vec_sl(__a, __b);6772}67736774static __inline__ vector unsigned int __ATTRS_o_ai6775vec_vslw(vector unsigned int __a, vector unsigned int __b) {6776return vec_sl(__a, __b);6777}67786779/* vec_sld */67806781#define __builtin_altivec_vsldoi_4si vec_sld67826783static __inline__ vector signed char __ATTRS_o_ai vec_sld(6784vector signed char __a, vector signed char __b, unsigned const int __c) {6785unsigned char __d = __c & 0x0F;6786#ifdef __LITTLE_ENDIAN__6787return vec_perm(6788__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,678920 - __d, 21 - __d, 22 - __d, 23 - __d,679024 - __d, 25 - __d, 26 - __d, 27 - __d,679128 - __d, 29 - __d, 30 - __d, 31 - __d));6792#else6793return vec_perm(6794__a, __b,6795(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6796__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6797__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6798#endif6799}68006801static __inline__ vector unsigned char __ATTRS_o_ai6802vec_sld(vector unsigned char __a, vector unsigned char __b,6803unsigned const int __c) {6804unsigned char __d = __c & 0x0F;6805#ifdef __LITTLE_ENDIAN__6806return vec_perm(6807__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,680820 - __d, 21 - __d, 22 - __d, 23 - __d,680924 - __d, 25 - __d, 26 - __d, 27 - __d,681028 - __d, 29 - __d, 30 - __d, 31 - __d));6811#else6812return vec_perm(6813__a, __b,6814(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6815__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6816__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6817#endif6818}68196820static __inline__ vector bool char __ATTRS_o_ai6821vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {6822unsigned char __d = __c & 0x0F;6823#ifdef __LITTLE_ENDIAN__6824return vec_perm(6825__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,682620 - __d, 21 - __d, 22 - __d, 23 - __d,682724 - __d, 25 - __d, 26 - __d, 27 - __d,682828 - __d, 29 - __d, 30 - __d, 31 - __d));6829#else6830return vec_perm(6831__a, __b,6832(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6833__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6834__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6835#endif6836}68376838static __inline__ vector signed short __ATTRS_o_ai vec_sld(6839vector signed short __a, vector signed short __b, unsigned const int __c) {6840unsigned char __d = __c & 0x0F;6841#ifdef __LITTLE_ENDIAN__6842return vec_perm(6843__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,684420 - __d, 21 - __d, 22 - __d, 23 - __d,684524 - __d, 25 - __d, 26 - __d, 27 - __d,684628 - __d, 29 - __d, 30 - __d, 31 - __d));6847#else6848return vec_perm(6849__a, __b,6850(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6851__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6852__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6853#endif6854}68556856static __inline__ vector unsigned short __ATTRS_o_ai6857vec_sld(vector unsigned short __a, vector unsigned short __b,6858unsigned const int __c) {6859unsigned char __d = __c & 0x0F;6860#ifdef __LITTLE_ENDIAN__6861return vec_perm(6862__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,686320 - __d, 21 - __d, 22 - __d, 23 - __d,686424 - __d, 25 - __d, 26 - __d, 27 - __d,686528 - __d, 29 - __d, 30 - __d, 31 - __d));6866#else6867return vec_perm(6868__a, __b,6869(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6870__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6871__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6872#endif6873}68746875static __inline__ vector bool short __ATTRS_o_ai6876vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {6877unsigned char __d = __c & 0x0F;6878#ifdef __LITTLE_ENDIAN__6879return vec_perm(6880__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,688120 - __d, 21 - __d, 22 - __d, 23 - __d,688224 - __d, 25 - __d, 26 - __d, 27 - __d,688328 - __d, 29 - __d, 30 - __d, 31 - __d));6884#else6885return vec_perm(6886__a, __b,6887(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6888__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6889__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6890#endif6891}68926893static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,6894vector pixel __b,6895unsigned const int __c) {6896unsigned char __d = __c & 0x0F;6897#ifdef __LITTLE_ENDIAN__6898return vec_perm(6899__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,690020 - __d, 21 - __d, 22 - __d, 23 - __d,690124 - __d, 25 - __d, 26 - __d, 27 - __d,690228 - __d, 29 - __d, 30 - __d, 31 - __d));6903#else6904return vec_perm(6905__a, __b,6906(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6907__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6908__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6909#endif6910}69116912static __inline__ vector signed int __ATTRS_o_ai6913vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {6914unsigned char __d = __c & 0x0F;6915#ifdef __LITTLE_ENDIAN__6916return vec_perm(6917__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,691820 - __d, 21 - __d, 22 - __d, 23 - __d,691924 - __d, 25 - __d, 26 - __d, 27 - __d,692028 - __d, 29 - __d, 30 - __d, 31 - __d));6921#else6922return vec_perm(6923__a, __b,6924(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6925__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6926__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6927#endif6928}69296930static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(6931vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {6932unsigned char __d = __c & 0x0F;6933#ifdef __LITTLE_ENDIAN__6934return vec_perm(6935__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,693620 - __d, 21 - __d, 22 - __d, 23 - __d,693724 - __d, 25 - __d, 26 - __d, 27 - __d,693828 - __d, 29 - __d, 30 - __d, 31 - __d));6939#else6940return vec_perm(6941__a, __b,6942(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6943__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6944__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6945#endif6946}69476948static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,6949vector bool int __b,6950unsigned const int __c) {6951unsigned char __d = __c & 0x0F;6952#ifdef __LITTLE_ENDIAN__6953return vec_perm(6954__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,695520 - __d, 21 - __d, 22 - __d, 23 - __d,695624 - __d, 25 - __d, 26 - __d, 27 - __d,695728 - __d, 29 - __d, 30 - __d, 31 - __d));6958#else6959return vec_perm(6960__a, __b,6961(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6962__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6963__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6964#endif6965}69666967static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,6968vector float __b,6969unsigned const int __c) {6970unsigned char __d = __c & 0x0F;6971#ifdef __LITTLE_ENDIAN__6972return vec_perm(6973__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,697420 - __d, 21 - __d, 22 - __d, 23 - __d,697524 - __d, 25 - __d, 26 - __d, 27 - __d,697628 - __d, 29 - __d, 30 - __d, 31 - __d));6977#else6978return vec_perm(6979__a, __b,6980(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,6981__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,6982__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));6983#endif6984}69856986/* vec_vsldoi */69876988static __inline__ vector signed char __ATTRS_o_ai6989vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {6990unsigned char __d = __c & 0x0F;6991#ifdef __LITTLE_ENDIAN__6992return vec_perm(6993__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,699420 - __d, 21 - __d, 22 - __d, 23 - __d,699524 - __d, 25 - __d, 26 - __d, 27 - __d,699628 - __d, 29 - __d, 30 - __d, 31 - __d));6997#else6998return vec_perm(6999__a, __b,7000(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7001__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7002__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7003#endif7004}70057006static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(7007vector unsigned char __a, vector unsigned char __b, unsigned char __c) {7008unsigned char __d = __c & 0x0F;7009#ifdef __LITTLE_ENDIAN__7010return vec_perm(7011__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,701220 - __d, 21 - __d, 22 - __d, 23 - __d,701324 - __d, 25 - __d, 26 - __d, 27 - __d,701428 - __d, 29 - __d, 30 - __d, 31 - __d));7015#else7016return vec_perm(7017__a, __b,7018(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7019__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7020__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7021#endif7022}70237024static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,7025vector short __b,7026unsigned char __c) {7027unsigned char __d = __c & 0x0F;7028#ifdef __LITTLE_ENDIAN__7029return vec_perm(7030__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,703120 - __d, 21 - __d, 22 - __d, 23 - __d,703224 - __d, 25 - __d, 26 - __d, 27 - __d,703328 - __d, 29 - __d, 30 - __d, 31 - __d));7034#else7035return vec_perm(7036__a, __b,7037(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7038__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7039__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7040#endif7041}70427043static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(7044vector unsigned short __a, vector unsigned short __b, unsigned char __c) {7045unsigned char __d = __c & 0x0F;7046#ifdef __LITTLE_ENDIAN__7047return vec_perm(7048__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,704920 - __d, 21 - __d, 22 - __d, 23 - __d,705024 - __d, 25 - __d, 26 - __d, 27 - __d,705128 - __d, 29 - __d, 30 - __d, 31 - __d));7052#else7053return vec_perm(7054__a, __b,7055(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7056__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7057__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7058#endif7059}70607061static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,7062vector pixel __b,7063unsigned char __c) {7064unsigned char __d = __c & 0x0F;7065#ifdef __LITTLE_ENDIAN__7066return vec_perm(7067__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,706820 - __d, 21 - __d, 22 - __d, 23 - __d,706924 - __d, 25 - __d, 26 - __d, 27 - __d,707028 - __d, 29 - __d, 30 - __d, 31 - __d));7071#else7072return vec_perm(7073__a, __b,7074(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7075__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7076__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7077#endif7078}70797080static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,7081vector int __b,7082unsigned char __c) {7083unsigned char __d = __c & 0x0F;7084#ifdef __LITTLE_ENDIAN__7085return vec_perm(7086__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,708720 - __d, 21 - __d, 22 - __d, 23 - __d,708824 - __d, 25 - __d, 26 - __d, 27 - __d,708928 - __d, 29 - __d, 30 - __d, 31 - __d));7090#else7091return vec_perm(7092__a, __b,7093(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7094__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7095__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7096#endif7097}70987099static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(7100vector unsigned int __a, vector unsigned int __b, unsigned char __c) {7101unsigned char __d = __c & 0x0F;7102#ifdef __LITTLE_ENDIAN__7103return vec_perm(7104__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,710520 - __d, 21 - __d, 22 - __d, 23 - __d,710624 - __d, 25 - __d, 26 - __d, 27 - __d,710728 - __d, 29 - __d, 30 - __d, 31 - __d));7108#else7109return vec_perm(7110__a, __b,7111(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7112__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7113__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7114#endif7115}71167117static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,7118vector float __b,7119unsigned char __c) {7120unsigned char __d = __c & 0x0F;7121#ifdef __LITTLE_ENDIAN__7122return vec_perm(7123__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,712420 - __d, 21 - __d, 22 - __d, 23 - __d,712524 - __d, 25 - __d, 26 - __d, 27 - __d,712628 - __d, 29 - __d, 30 - __d, 31 - __d));7127#else7128return vec_perm(7129__a, __b,7130(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,7131__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,7132__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));7133#endif7134}71357136/* vec_sll */71377138static __inline__ vector signed char __ATTRS_o_ai7139vec_sll(vector signed char __a, vector unsigned char __b) {7140return (vector signed char)__builtin_altivec_vsl((vector int)__a,7141(vector int)__b);7142}71437144static __inline__ vector signed char __ATTRS_o_ai7145vec_sll(vector signed char __a, vector unsigned short __b) {7146return (vector signed char)__builtin_altivec_vsl((vector int)__a,7147(vector int)__b);7148}71497150static __inline__ vector signed char __ATTRS_o_ai7151vec_sll(vector signed char __a, vector unsigned int __b) {7152return (vector signed char)__builtin_altivec_vsl((vector int)__a,7153(vector int)__b);7154}71557156static __inline__ vector unsigned char __ATTRS_o_ai7157vec_sll(vector unsigned char __a, vector unsigned char __b) {7158return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7159(vector int)__b);7160}71617162static __inline__ vector unsigned char __ATTRS_o_ai7163vec_sll(vector unsigned char __a, vector unsigned short __b) {7164return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7165(vector int)__b);7166}71677168static __inline__ vector unsigned char __ATTRS_o_ai7169vec_sll(vector unsigned char __a, vector unsigned int __b) {7170return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7171(vector int)__b);7172}71737174static __inline__ vector bool char __ATTRS_o_ai7175vec_sll(vector bool char __a, vector unsigned char __b) {7176return (vector bool char)__builtin_altivec_vsl((vector int)__a,7177(vector int)__b);7178}71797180static __inline__ vector bool char __ATTRS_o_ai7181vec_sll(vector bool char __a, vector unsigned short __b) {7182return (vector bool char)__builtin_altivec_vsl((vector int)__a,7183(vector int)__b);7184}71857186static __inline__ vector bool char __ATTRS_o_ai7187vec_sll(vector bool char __a, vector unsigned int __b) {7188return (vector bool char)__builtin_altivec_vsl((vector int)__a,7189(vector int)__b);7190}71917192static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,7193vector unsigned char __b) {7194return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7195}71967197static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,7198vector unsigned short __b) {7199return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7200}72017202static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,7203vector unsigned int __b) {7204return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7205}72067207static __inline__ vector unsigned short __ATTRS_o_ai7208vec_sll(vector unsigned short __a, vector unsigned char __b) {7209return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7210(vector int)__b);7211}72127213static __inline__ vector unsigned short __ATTRS_o_ai7214vec_sll(vector unsigned short __a, vector unsigned short __b) {7215return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7216(vector int)__b);7217}72187219static __inline__ vector unsigned short __ATTRS_o_ai7220vec_sll(vector unsigned short __a, vector unsigned int __b) {7221return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7222(vector int)__b);7223}72247225static __inline__ vector bool short __ATTRS_o_ai7226vec_sll(vector bool short __a, vector unsigned char __b) {7227return (vector bool short)__builtin_altivec_vsl((vector int)__a,7228(vector int)__b);7229}72307231static __inline__ vector bool short __ATTRS_o_ai7232vec_sll(vector bool short __a, vector unsigned short __b) {7233return (vector bool short)__builtin_altivec_vsl((vector int)__a,7234(vector int)__b);7235}72367237static __inline__ vector bool short __ATTRS_o_ai7238vec_sll(vector bool short __a, vector unsigned int __b) {7239return (vector bool short)__builtin_altivec_vsl((vector int)__a,7240(vector int)__b);7241}72427243static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,7244vector unsigned char __b) {7245return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7246}72477248static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,7249vector unsigned short __b) {7250return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7251}72527253static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,7254vector unsigned int __b) {7255return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7256}72577258static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,7259vector unsigned char __b) {7260return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7261}72627263static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,7264vector unsigned short __b) {7265return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7266}72677268static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,7269vector unsigned int __b) {7270return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7271}72727273static __inline__ vector unsigned int __ATTRS_o_ai7274vec_sll(vector unsigned int __a, vector unsigned char __b) {7275return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7276(vector int)__b);7277}72787279static __inline__ vector unsigned int __ATTRS_o_ai7280vec_sll(vector unsigned int __a, vector unsigned short __b) {7281return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7282(vector int)__b);7283}72847285static __inline__ vector unsigned int __ATTRS_o_ai7286vec_sll(vector unsigned int __a, vector unsigned int __b) {7287return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7288(vector int)__b);7289}72907291static __inline__ vector bool int __ATTRS_o_ai7292vec_sll(vector bool int __a, vector unsigned char __b) {7293return (vector bool int)__builtin_altivec_vsl((vector int)__a,7294(vector int)__b);7295}72967297static __inline__ vector bool int __ATTRS_o_ai7298vec_sll(vector bool int __a, vector unsigned short __b) {7299return (vector bool int)__builtin_altivec_vsl((vector int)__a,7300(vector int)__b);7301}73027303static __inline__ vector bool int __ATTRS_o_ai7304vec_sll(vector bool int __a, vector unsigned int __b) {7305return (vector bool int)__builtin_altivec_vsl((vector int)__a,7306(vector int)__b);7307}73087309/* vec_vsl */73107311static __inline__ vector signed char __ATTRS_o_ai7312vec_vsl(vector signed char __a, vector unsigned char __b) {7313return (vector signed char)__builtin_altivec_vsl((vector int)__a,7314(vector int)__b);7315}73167317static __inline__ vector signed char __ATTRS_o_ai7318vec_vsl(vector signed char __a, vector unsigned short __b) {7319return (vector signed char)__builtin_altivec_vsl((vector int)__a,7320(vector int)__b);7321}73227323static __inline__ vector signed char __ATTRS_o_ai7324vec_vsl(vector signed char __a, vector unsigned int __b) {7325return (vector signed char)__builtin_altivec_vsl((vector int)__a,7326(vector int)__b);7327}73287329static __inline__ vector unsigned char __ATTRS_o_ai7330vec_vsl(vector unsigned char __a, vector unsigned char __b) {7331return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7332(vector int)__b);7333}73347335static __inline__ vector unsigned char __ATTRS_o_ai7336vec_vsl(vector unsigned char __a, vector unsigned short __b) {7337return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7338(vector int)__b);7339}73407341static __inline__ vector unsigned char __ATTRS_o_ai7342vec_vsl(vector unsigned char __a, vector unsigned int __b) {7343return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,7344(vector int)__b);7345}73467347static __inline__ vector bool char __ATTRS_o_ai7348vec_vsl(vector bool char __a, vector unsigned char __b) {7349return (vector bool char)__builtin_altivec_vsl((vector int)__a,7350(vector int)__b);7351}73527353static __inline__ vector bool char __ATTRS_o_ai7354vec_vsl(vector bool char __a, vector unsigned short __b) {7355return (vector bool char)__builtin_altivec_vsl((vector int)__a,7356(vector int)__b);7357}73587359static __inline__ vector bool char __ATTRS_o_ai7360vec_vsl(vector bool char __a, vector unsigned int __b) {7361return (vector bool char)__builtin_altivec_vsl((vector int)__a,7362(vector int)__b);7363}73647365static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,7366vector unsigned char __b) {7367return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7368}73697370static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,7371vector unsigned short __b) {7372return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7373}73747375static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,7376vector unsigned int __b) {7377return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7378}73797380static __inline__ vector unsigned short __ATTRS_o_ai7381vec_vsl(vector unsigned short __a, vector unsigned char __b) {7382return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7383(vector int)__b);7384}73857386static __inline__ vector unsigned short __ATTRS_o_ai7387vec_vsl(vector unsigned short __a, vector unsigned short __b) {7388return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7389(vector int)__b);7390}73917392static __inline__ vector unsigned short __ATTRS_o_ai7393vec_vsl(vector unsigned short __a, vector unsigned int __b) {7394return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,7395(vector int)__b);7396}73977398static __inline__ vector bool short __ATTRS_o_ai7399vec_vsl(vector bool short __a, vector unsigned char __b) {7400return (vector bool short)__builtin_altivec_vsl((vector int)__a,7401(vector int)__b);7402}74037404static __inline__ vector bool short __ATTRS_o_ai7405vec_vsl(vector bool short __a, vector unsigned short __b) {7406return (vector bool short)__builtin_altivec_vsl((vector int)__a,7407(vector int)__b);7408}74097410static __inline__ vector bool short __ATTRS_o_ai7411vec_vsl(vector bool short __a, vector unsigned int __b) {7412return (vector bool short)__builtin_altivec_vsl((vector int)__a,7413(vector int)__b);7414}74157416static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,7417vector unsigned char __b) {7418return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7419}74207421static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,7422vector unsigned short __b) {7423return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7424}74257426static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,7427vector unsigned int __b) {7428return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);7429}74307431static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,7432vector unsigned char __b) {7433return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7434}74357436static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,7437vector unsigned short __b) {7438return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7439}74407441static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,7442vector unsigned int __b) {7443return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);7444}74457446static __inline__ vector unsigned int __ATTRS_o_ai7447vec_vsl(vector unsigned int __a, vector unsigned char __b) {7448return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7449(vector int)__b);7450}74517452static __inline__ vector unsigned int __ATTRS_o_ai7453vec_vsl(vector unsigned int __a, vector unsigned short __b) {7454return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7455(vector int)__b);7456}74577458static __inline__ vector unsigned int __ATTRS_o_ai7459vec_vsl(vector unsigned int __a, vector unsigned int __b) {7460return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,7461(vector int)__b);7462}74637464static __inline__ vector bool int __ATTRS_o_ai7465vec_vsl(vector bool int __a, vector unsigned char __b) {7466return (vector bool int)__builtin_altivec_vsl((vector int)__a,7467(vector int)__b);7468}74697470static __inline__ vector bool int __ATTRS_o_ai7471vec_vsl(vector bool int __a, vector unsigned short __b) {7472return (vector bool int)__builtin_altivec_vsl((vector int)__a,7473(vector int)__b);7474}74757476static __inline__ vector bool int __ATTRS_o_ai7477vec_vsl(vector bool int __a, vector unsigned int __b) {7478return (vector bool int)__builtin_altivec_vsl((vector int)__a,7479(vector int)__b);7480}74817482/* vec_slo */74837484static __inline__ vector signed char __ATTRS_o_ai7485vec_slo(vector signed char __a, vector signed char __b) {7486return (vector signed char)__builtin_altivec_vslo((vector int)__a,7487(vector int)__b);7488}74897490static __inline__ vector signed char __ATTRS_o_ai7491vec_slo(vector signed char __a, vector unsigned char __b) {7492return (vector signed char)__builtin_altivec_vslo((vector int)__a,7493(vector int)__b);7494}74957496static __inline__ vector unsigned char __ATTRS_o_ai7497vec_slo(vector unsigned char __a, vector signed char __b) {7498return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,7499(vector int)__b);7500}75017502static __inline__ vector unsigned char __ATTRS_o_ai7503vec_slo(vector unsigned char __a, vector unsigned char __b) {7504return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,7505(vector int)__b);7506}75077508static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,7509vector signed char __b) {7510return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7511}75127513static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,7514vector unsigned char __b) {7515return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7516}75177518static __inline__ vector unsigned short __ATTRS_o_ai7519vec_slo(vector unsigned short __a, vector signed char __b) {7520return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,7521(vector int)__b);7522}75237524static __inline__ vector unsigned short __ATTRS_o_ai7525vec_slo(vector unsigned short __a, vector unsigned char __b) {7526return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,7527(vector int)__b);7528}75297530static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,7531vector signed char __b) {7532return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7533}75347535static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,7536vector unsigned char __b) {7537return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7538}75397540static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,7541vector signed char __b) {7542return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);7543}75447545static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,7546vector unsigned char __b) {7547return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);7548}75497550static __inline__ vector unsigned int __ATTRS_o_ai7551vec_slo(vector unsigned int __a, vector signed char __b) {7552return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,7553(vector int)__b);7554}75557556static __inline__ vector unsigned int __ATTRS_o_ai7557vec_slo(vector unsigned int __a, vector unsigned char __b) {7558return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,7559(vector int)__b);7560}75617562static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,7563vector signed char __b) {7564return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7565}75667567static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,7568vector unsigned char __b) {7569return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7570}75717572/* vec_vslo */75737574static __inline__ vector signed char __ATTRS_o_ai7575vec_vslo(vector signed char __a, vector signed char __b) {7576return (vector signed char)__builtin_altivec_vslo((vector int)__a,7577(vector int)__b);7578}75797580static __inline__ vector signed char __ATTRS_o_ai7581vec_vslo(vector signed char __a, vector unsigned char __b) {7582return (vector signed char)__builtin_altivec_vslo((vector int)__a,7583(vector int)__b);7584}75857586static __inline__ vector unsigned char __ATTRS_o_ai7587vec_vslo(vector unsigned char __a, vector signed char __b) {7588return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,7589(vector int)__b);7590}75917592static __inline__ vector unsigned char __ATTRS_o_ai7593vec_vslo(vector unsigned char __a, vector unsigned char __b) {7594return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,7595(vector int)__b);7596}75977598static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,7599vector signed char __b) {7600return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7601}76027603static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,7604vector unsigned char __b) {7605return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7606}76077608static __inline__ vector unsigned short __ATTRS_o_ai7609vec_vslo(vector unsigned short __a, vector signed char __b) {7610return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,7611(vector int)__b);7612}76137614static __inline__ vector unsigned short __ATTRS_o_ai7615vec_vslo(vector unsigned short __a, vector unsigned char __b) {7616return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,7617(vector int)__b);7618}76197620static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,7621vector signed char __b) {7622return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7623}76247625static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,7626vector unsigned char __b) {7627return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7628}76297630static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,7631vector signed char __b) {7632return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);7633}76347635static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,7636vector unsigned char __b) {7637return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);7638}76397640static __inline__ vector unsigned int __ATTRS_o_ai7641vec_vslo(vector unsigned int __a, vector signed char __b) {7642return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,7643(vector int)__b);7644}76457646static __inline__ vector unsigned int __ATTRS_o_ai7647vec_vslo(vector unsigned int __a, vector unsigned char __b) {7648return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,7649(vector int)__b);7650}76517652static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,7653vector signed char __b) {7654return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7655}76567657static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,7658vector unsigned char __b) {7659return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);7660}76617662/* vec_splat */76637664static __inline__ vector signed char __ATTRS_o_ai7665vec_splat(vector signed char __a, unsigned const int __b) {7666return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));7667}76687669static __inline__ vector unsigned char __ATTRS_o_ai7670vec_splat(vector unsigned char __a, unsigned const int __b) {7671return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));7672}76737674static __inline__ vector bool char __ATTRS_o_ai7675vec_splat(vector bool char __a, unsigned const int __b) {7676return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));7677}76787679static __inline__ vector signed short __ATTRS_o_ai7680vec_splat(vector signed short __a, unsigned const int __b) {7681unsigned char b0 = (__b & 0x07) * 2;7682unsigned char b1 = b0 + 1;7683return vec_perm(__a, __a,7684(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,7685b0, b1, b0, b1, b0, b1));7686}76877688static __inline__ vector unsigned short __ATTRS_o_ai7689vec_splat(vector unsigned short __a, unsigned const int __b) {7690unsigned char b0 = (__b & 0x07) * 2;7691unsigned char b1 = b0 + 1;7692return vec_perm(__a, __a,7693(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,7694b0, b1, b0, b1, b0, b1));7695}76967697static __inline__ vector bool short __ATTRS_o_ai7698vec_splat(vector bool short __a, unsigned const int __b) {7699unsigned char b0 = (__b & 0x07) * 2;7700unsigned char b1 = b0 + 1;7701return vec_perm(__a, __a,7702(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,7703b0, b1, b0, b1, b0, b1));7704}77057706static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,7707unsigned const int __b) {7708unsigned char b0 = (__b & 0x07) * 2;7709unsigned char b1 = b0 + 1;7710return vec_perm(__a, __a,7711(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,7712b0, b1, b0, b1, b0, b1));7713}77147715static __inline__ vector signed int __ATTRS_o_ai7716vec_splat(vector signed int __a, unsigned const int __b) {7717unsigned char b0 = (__b & 0x03) * 4;7718unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;7719return vec_perm(__a, __a,7720(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,7721b2, b3, b0, b1, b2, b3));7722}77237724static __inline__ vector unsigned int __ATTRS_o_ai7725vec_splat(vector unsigned int __a, unsigned const int __b) {7726unsigned char b0 = (__b & 0x03) * 4;7727unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;7728return vec_perm(__a, __a,7729(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,7730b2, b3, b0, b1, b2, b3));7731}77327733static __inline__ vector bool int __ATTRS_o_ai7734vec_splat(vector bool int __a, unsigned const int __b) {7735unsigned char b0 = (__b & 0x03) * 4;7736unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;7737return vec_perm(__a, __a,7738(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,7739b2, b3, b0, b1, b2, b3));7740}77417742static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,7743unsigned const int __b) {7744unsigned char b0 = (__b & 0x03) * 4;7745unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;7746return vec_perm(__a, __a,7747(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,7748b2, b3, b0, b1, b2, b3));7749}77507751#ifdef __VSX__7752static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,7753unsigned const int __b) {7754unsigned char b0 = (__b & 0x01) * 8;7755unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,7756b6 = b0 + 6, b7 = b0 + 7;7757return vec_perm(__a, __a,7758(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,7759b2, b3, b4, b5, b6, b7));7760}7761static __inline__ vector bool long long __ATTRS_o_ai7762vec_splat(vector bool long long __a, unsigned const int __b) {7763unsigned char b0 = (__b & 0x01) * 8;7764unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,7765b6 = b0 + 6, b7 = b0 + 7;7766return vec_perm(__a, __a,7767(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,7768b2, b3, b4, b5, b6, b7));7769}7770static __inline__ vector signed long long __ATTRS_o_ai7771vec_splat(vector signed long long __a, unsigned const int __b) {7772unsigned char b0 = (__b & 0x01) * 8;7773unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,7774b6 = b0 + 6, b7 = b0 + 7;7775return vec_perm(__a, __a,7776(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,7777b2, b3, b4, b5, b6, b7));7778}7779static __inline__ vector unsigned long long __ATTRS_o_ai7780vec_splat(vector unsigned long long __a, unsigned const int __b) {7781unsigned char b0 = (__b & 0x01) * 8;7782unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,7783b6 = b0 + 6, b7 = b0 + 7;7784return vec_perm(__a, __a,7785(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,7786b2, b3, b4, b5, b6, b7));7787}7788#endif77897790/* vec_vspltb */77917792#define __builtin_altivec_vspltb vec_vspltb77937794static __inline__ vector signed char __ATTRS_o_ai7795vec_vspltb(vector signed char __a, unsigned char __b) {7796return vec_perm(__a, __a, (vector unsigned char)(__b));7797}77987799static __inline__ vector unsigned char __ATTRS_o_ai7800vec_vspltb(vector unsigned char __a, unsigned char __b) {7801return vec_perm(__a, __a, (vector unsigned char)(__b));7802}78037804static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,7805unsigned char __b) {7806return vec_perm(__a, __a, (vector unsigned char)(__b));7807}78087809/* vec_vsplth */78107811#define __builtin_altivec_vsplth vec_vsplth78127813static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,7814unsigned char __b) {7815__b *= 2;7816unsigned char b1 = __b + 1;7817return vec_perm(__a, __a,7818(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,7819__b, b1, __b, b1, __b, b1, __b, b1));7820}78217822static __inline__ vector unsigned short __ATTRS_o_ai7823vec_vsplth(vector unsigned short __a, unsigned char __b) {7824__b *= 2;7825unsigned char b1 = __b + 1;7826return vec_perm(__a, __a,7827(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,7828__b, b1, __b, b1, __b, b1, __b, b1));7829}78307831static __inline__ vector bool short __ATTRS_o_ai7832vec_vsplth(vector bool short __a, unsigned char __b) {7833__b *= 2;7834unsigned char b1 = __b + 1;7835return vec_perm(__a, __a,7836(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,7837__b, b1, __b, b1, __b, b1, __b, b1));7838}78397840static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,7841unsigned char __b) {7842__b *= 2;7843unsigned char b1 = __b + 1;7844return vec_perm(__a, __a,7845(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,7846__b, b1, __b, b1, __b, b1, __b, b1));7847}78487849/* vec_vspltw */78507851#define __builtin_altivec_vspltw vec_vspltw78527853static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,7854unsigned char __b) {7855__b *= 4;7856unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;7857return vec_perm(__a, __a,7858(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,7859b1, b2, b3, __b, b1, b2, b3));7860}78617862static __inline__ vector unsigned int __ATTRS_o_ai7863vec_vspltw(vector unsigned int __a, unsigned char __b) {7864__b *= 4;7865unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;7866return vec_perm(__a, __a,7867(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,7868b1, b2, b3, __b, b1, b2, b3));7869}78707871static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,7872unsigned char __b) {7873__b *= 4;7874unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;7875return vec_perm(__a, __a,7876(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,7877b1, b2, b3, __b, b1, b2, b3));7878}78797880static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,7881unsigned char __b) {7882__b *= 4;7883unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;7884return vec_perm(__a, __a,7885(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,7886b1, b2, b3, __b, b1, b2, b3));7887}78887889/* vec_splat_s8 */78907891#define __builtin_altivec_vspltisb vec_splat_s878927893// FIXME: parameter should be treated as 5-bit signed literal7894static __inline__ vector signed char __ATTRS_o_ai7895vec_splat_s8(signed char __a) {7896return (vector signed char)(__a);7897}78987899/* vec_vspltisb */79007901// FIXME: parameter should be treated as 5-bit signed literal7902static __inline__ vector signed char __ATTRS_o_ai7903vec_vspltisb(signed char __a) {7904return (vector signed char)(__a);7905}79067907/* vec_splat_s16 */79087909#define __builtin_altivec_vspltish vec_splat_s1679107911// FIXME: parameter should be treated as 5-bit signed literal7912static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {7913return (vector short)(__a);7914}79157916/* vec_vspltish */79177918// FIXME: parameter should be treated as 5-bit signed literal7919static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {7920return (vector short)(__a);7921}79227923/* vec_splat_s32 */79247925#define __builtin_altivec_vspltisw vec_splat_s3279267927// FIXME: parameter should be treated as 5-bit signed literal7928static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {7929return (vector int)(__a);7930}79317932/* vec_vspltisw */79337934// FIXME: parameter should be treated as 5-bit signed literal7935static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {7936return (vector int)(__a);7937}79387939/* vec_splat_u8 */79407941// FIXME: parameter should be treated as 5-bit signed literal7942static __inline__ vector unsigned char __ATTRS_o_ai7943vec_splat_u8(unsigned char __a) {7944return (vector unsigned char)(__a);7945}79467947/* vec_splat_u16 */79487949// FIXME: parameter should be treated as 5-bit signed literal7950static __inline__ vector unsigned short __ATTRS_o_ai7951vec_splat_u16(signed char __a) {7952return (vector unsigned short)(__a);7953}79547955/* vec_splat_u32 */79567957// FIXME: parameter should be treated as 5-bit signed literal7958static __inline__ vector unsigned int __ATTRS_o_ai7959vec_splat_u32(signed char __a) {7960return (vector unsigned int)(__a);7961}79627963/* vec_sr */79647965static __inline__ vector signed char __ATTRS_o_ai7966vec_sr(vector signed char __a, vector unsigned char __b) {7967vector unsigned char __res = (vector unsigned char)__a >> __b;7968return (vector signed char)__res;7969}79707971static __inline__ vector unsigned char __ATTRS_o_ai7972vec_sr(vector unsigned char __a, vector unsigned char __b) {7973return __a >> __b;7974}79757976static __inline__ vector signed short __ATTRS_o_ai7977vec_sr(vector signed short __a, vector unsigned short __b) {7978vector unsigned short __res = (vector unsigned short)__a >> __b;7979return (vector signed short)__res;7980}79817982static __inline__ vector unsigned short __ATTRS_o_ai7983vec_sr(vector unsigned short __a, vector unsigned short __b) {7984return __a >> __b;7985}79867987static __inline__ vector signed int __ATTRS_o_ai7988vec_sr(vector signed int __a, vector unsigned int __b) {7989vector unsigned int __res = (vector unsigned int)__a >> __b;7990return (vector signed int)__res;7991}79927993static __inline__ vector unsigned int __ATTRS_o_ai7994vec_sr(vector unsigned int __a, vector unsigned int __b) {7995return __a >> __b;7996}79977998#ifdef __POWER8_VECTOR__7999static __inline__ vector signed long long __ATTRS_o_ai8000vec_sr(vector signed long long __a, vector unsigned long long __b) {8001vector unsigned long long __res = (vector unsigned long long)__a >> __b;8002return (vector signed long long)__res;8003}80048005static __inline__ vector unsigned long long __ATTRS_o_ai8006vec_sr(vector unsigned long long __a, vector unsigned long long __b) {8007return __a >> __b;8008}8009#endif80108011/* vec_vsrb */80128013#define __builtin_altivec_vsrb vec_vsrb80148015static __inline__ vector signed char __ATTRS_o_ai8016vec_vsrb(vector signed char __a, vector unsigned char __b) {8017return __a >> (vector signed char)__b;8018}80198020static __inline__ vector unsigned char __ATTRS_o_ai8021vec_vsrb(vector unsigned char __a, vector unsigned char __b) {8022return __a >> __b;8023}80248025/* vec_vsrh */80268027#define __builtin_altivec_vsrh vec_vsrh80288029static __inline__ vector short __ATTRS_o_ai8030vec_vsrh(vector short __a, vector unsigned short __b) {8031return __a >> (vector short)__b;8032}80338034static __inline__ vector unsigned short __ATTRS_o_ai8035vec_vsrh(vector unsigned short __a, vector unsigned short __b) {8036return __a >> __b;8037}80388039/* vec_vsrw */80408041#define __builtin_altivec_vsrw vec_vsrw80428043static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,8044vector unsigned int __b) {8045return __a >> (vector int)__b;8046}80478048static __inline__ vector unsigned int __ATTRS_o_ai8049vec_vsrw(vector unsigned int __a, vector unsigned int __b) {8050return __a >> __b;8051}80528053/* vec_sra */80548055static __inline__ vector signed char __ATTRS_o_ai8056vec_sra(vector signed char __a, vector unsigned char __b) {8057return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);8058}80598060static __inline__ vector unsigned char __ATTRS_o_ai8061vec_sra(vector unsigned char __a, vector unsigned char __b) {8062return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);8063}80648065static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,8066vector unsigned short __b) {8067return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);8068}80698070static __inline__ vector unsigned short __ATTRS_o_ai8071vec_sra(vector unsigned short __a, vector unsigned short __b) {8072return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);8073}80748075static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,8076vector unsigned int __b) {8077return __builtin_altivec_vsraw(__a, __b);8078}80798080static __inline__ vector unsigned int __ATTRS_o_ai8081vec_sra(vector unsigned int __a, vector unsigned int __b) {8082return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);8083}80848085#ifdef __POWER8_VECTOR__8086static __inline__ vector signed long long __ATTRS_o_ai8087vec_sra(vector signed long long __a, vector unsigned long long __b) {8088return __a >> __b;8089}80908091static __inline__ vector unsigned long long __ATTRS_o_ai8092vec_sra(vector unsigned long long __a, vector unsigned long long __b) {8093return (vector unsigned long long)((vector signed long long)__a >> __b);8094}8095#endif80968097/* vec_vsrab */80988099static __inline__ vector signed char __ATTRS_o_ai8100vec_vsrab(vector signed char __a, vector unsigned char __b) {8101return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);8102}81038104static __inline__ vector unsigned char __ATTRS_o_ai8105vec_vsrab(vector unsigned char __a, vector unsigned char __b) {8106return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);8107}81088109/* vec_vsrah */81108111static __inline__ vector short __ATTRS_o_ai8112vec_vsrah(vector short __a, vector unsigned short __b) {8113return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);8114}81158116static __inline__ vector unsigned short __ATTRS_o_ai8117vec_vsrah(vector unsigned short __a, vector unsigned short __b) {8118return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);8119}81208121/* vec_vsraw */81228123static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,8124vector unsigned int __b) {8125return __builtin_altivec_vsraw(__a, __b);8126}81278128static __inline__ vector unsigned int __ATTRS_o_ai8129vec_vsraw(vector unsigned int __a, vector unsigned int __b) {8130return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);8131}81328133/* vec_srl */81348135static __inline__ vector signed char __ATTRS_o_ai8136vec_srl(vector signed char __a, vector unsigned char __b) {8137return (vector signed char)__builtin_altivec_vsr((vector int)__a,8138(vector int)__b);8139}81408141static __inline__ vector signed char __ATTRS_o_ai8142vec_srl(vector signed char __a, vector unsigned short __b) {8143return (vector signed char)__builtin_altivec_vsr((vector int)__a,8144(vector int)__b);8145}81468147static __inline__ vector signed char __ATTRS_o_ai8148vec_srl(vector signed char __a, vector unsigned int __b) {8149return (vector signed char)__builtin_altivec_vsr((vector int)__a,8150(vector int)__b);8151}81528153static __inline__ vector unsigned char __ATTRS_o_ai8154vec_srl(vector unsigned char __a, vector unsigned char __b) {8155return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8156(vector int)__b);8157}81588159static __inline__ vector unsigned char __ATTRS_o_ai8160vec_srl(vector unsigned char __a, vector unsigned short __b) {8161return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8162(vector int)__b);8163}81648165static __inline__ vector unsigned char __ATTRS_o_ai8166vec_srl(vector unsigned char __a, vector unsigned int __b) {8167return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8168(vector int)__b);8169}81708171static __inline__ vector bool char __ATTRS_o_ai8172vec_srl(vector bool char __a, vector unsigned char __b) {8173return (vector bool char)__builtin_altivec_vsr((vector int)__a,8174(vector int)__b);8175}81768177static __inline__ vector bool char __ATTRS_o_ai8178vec_srl(vector bool char __a, vector unsigned short __b) {8179return (vector bool char)__builtin_altivec_vsr((vector int)__a,8180(vector int)__b);8181}81828183static __inline__ vector bool char __ATTRS_o_ai8184vec_srl(vector bool char __a, vector unsigned int __b) {8185return (vector bool char)__builtin_altivec_vsr((vector int)__a,8186(vector int)__b);8187}81888189static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,8190vector unsigned char __b) {8191return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8192}81938194static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,8195vector unsigned short __b) {8196return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8197}81988199static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,8200vector unsigned int __b) {8201return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8202}82038204static __inline__ vector unsigned short __ATTRS_o_ai8205vec_srl(vector unsigned short __a, vector unsigned char __b) {8206return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8207(vector int)__b);8208}82098210static __inline__ vector unsigned short __ATTRS_o_ai8211vec_srl(vector unsigned short __a, vector unsigned short __b) {8212return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8213(vector int)__b);8214}82158216static __inline__ vector unsigned short __ATTRS_o_ai8217vec_srl(vector unsigned short __a, vector unsigned int __b) {8218return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8219(vector int)__b);8220}82218222static __inline__ vector bool short __ATTRS_o_ai8223vec_srl(vector bool short __a, vector unsigned char __b) {8224return (vector bool short)__builtin_altivec_vsr((vector int)__a,8225(vector int)__b);8226}82278228static __inline__ vector bool short __ATTRS_o_ai8229vec_srl(vector bool short __a, vector unsigned short __b) {8230return (vector bool short)__builtin_altivec_vsr((vector int)__a,8231(vector int)__b);8232}82338234static __inline__ vector bool short __ATTRS_o_ai8235vec_srl(vector bool short __a, vector unsigned int __b) {8236return (vector bool short)__builtin_altivec_vsr((vector int)__a,8237(vector int)__b);8238}82398240static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,8241vector unsigned char __b) {8242return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8243}82448245static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,8246vector unsigned short __b) {8247return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8248}82498250static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,8251vector unsigned int __b) {8252return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8253}82548255static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,8256vector unsigned char __b) {8257return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8258}82598260static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,8261vector unsigned short __b) {8262return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8263}82648265static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,8266vector unsigned int __b) {8267return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8268}82698270static __inline__ vector unsigned int __ATTRS_o_ai8271vec_srl(vector unsigned int __a, vector unsigned char __b) {8272return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8273(vector int)__b);8274}82758276static __inline__ vector unsigned int __ATTRS_o_ai8277vec_srl(vector unsigned int __a, vector unsigned short __b) {8278return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8279(vector int)__b);8280}82818282static __inline__ vector unsigned int __ATTRS_o_ai8283vec_srl(vector unsigned int __a, vector unsigned int __b) {8284return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8285(vector int)__b);8286}82878288static __inline__ vector bool int __ATTRS_o_ai8289vec_srl(vector bool int __a, vector unsigned char __b) {8290return (vector bool int)__builtin_altivec_vsr((vector int)__a,8291(vector int)__b);8292}82938294static __inline__ vector bool int __ATTRS_o_ai8295vec_srl(vector bool int __a, vector unsigned short __b) {8296return (vector bool int)__builtin_altivec_vsr((vector int)__a,8297(vector int)__b);8298}82998300static __inline__ vector bool int __ATTRS_o_ai8301vec_srl(vector bool int __a, vector unsigned int __b) {8302return (vector bool int)__builtin_altivec_vsr((vector int)__a,8303(vector int)__b);8304}83058306/* vec_vsr */83078308static __inline__ vector signed char __ATTRS_o_ai8309vec_vsr(vector signed char __a, vector unsigned char __b) {8310return (vector signed char)__builtin_altivec_vsr((vector int)__a,8311(vector int)__b);8312}83138314static __inline__ vector signed char __ATTRS_o_ai8315vec_vsr(vector signed char __a, vector unsigned short __b) {8316return (vector signed char)__builtin_altivec_vsr((vector int)__a,8317(vector int)__b);8318}83198320static __inline__ vector signed char __ATTRS_o_ai8321vec_vsr(vector signed char __a, vector unsigned int __b) {8322return (vector signed char)__builtin_altivec_vsr((vector int)__a,8323(vector int)__b);8324}83258326static __inline__ vector unsigned char __ATTRS_o_ai8327vec_vsr(vector unsigned char __a, vector unsigned char __b) {8328return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8329(vector int)__b);8330}83318332static __inline__ vector unsigned char __ATTRS_o_ai8333vec_vsr(vector unsigned char __a, vector unsigned short __b) {8334return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8335(vector int)__b);8336}83378338static __inline__ vector unsigned char __ATTRS_o_ai8339vec_vsr(vector unsigned char __a, vector unsigned int __b) {8340return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,8341(vector int)__b);8342}83438344static __inline__ vector bool char __ATTRS_o_ai8345vec_vsr(vector bool char __a, vector unsigned char __b) {8346return (vector bool char)__builtin_altivec_vsr((vector int)__a,8347(vector int)__b);8348}83498350static __inline__ vector bool char __ATTRS_o_ai8351vec_vsr(vector bool char __a, vector unsigned short __b) {8352return (vector bool char)__builtin_altivec_vsr((vector int)__a,8353(vector int)__b);8354}83558356static __inline__ vector bool char __ATTRS_o_ai8357vec_vsr(vector bool char __a, vector unsigned int __b) {8358return (vector bool char)__builtin_altivec_vsr((vector int)__a,8359(vector int)__b);8360}83618362static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,8363vector unsigned char __b) {8364return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8365}83668367static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,8368vector unsigned short __b) {8369return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8370}83718372static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,8373vector unsigned int __b) {8374return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8375}83768377static __inline__ vector unsigned short __ATTRS_o_ai8378vec_vsr(vector unsigned short __a, vector unsigned char __b) {8379return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8380(vector int)__b);8381}83828383static __inline__ vector unsigned short __ATTRS_o_ai8384vec_vsr(vector unsigned short __a, vector unsigned short __b) {8385return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8386(vector int)__b);8387}83888389static __inline__ vector unsigned short __ATTRS_o_ai8390vec_vsr(vector unsigned short __a, vector unsigned int __b) {8391return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,8392(vector int)__b);8393}83948395static __inline__ vector bool short __ATTRS_o_ai8396vec_vsr(vector bool short __a, vector unsigned char __b) {8397return (vector bool short)__builtin_altivec_vsr((vector int)__a,8398(vector int)__b);8399}84008401static __inline__ vector bool short __ATTRS_o_ai8402vec_vsr(vector bool short __a, vector unsigned short __b) {8403return (vector bool short)__builtin_altivec_vsr((vector int)__a,8404(vector int)__b);8405}84068407static __inline__ vector bool short __ATTRS_o_ai8408vec_vsr(vector bool short __a, vector unsigned int __b) {8409return (vector bool short)__builtin_altivec_vsr((vector int)__a,8410(vector int)__b);8411}84128413static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,8414vector unsigned char __b) {8415return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8416}84178418static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,8419vector unsigned short __b) {8420return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8421}84228423static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,8424vector unsigned int __b) {8425return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);8426}84278428static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,8429vector unsigned char __b) {8430return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8431}84328433static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,8434vector unsigned short __b) {8435return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8436}84378438static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,8439vector unsigned int __b) {8440return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);8441}84428443static __inline__ vector unsigned int __ATTRS_o_ai8444vec_vsr(vector unsigned int __a, vector unsigned char __b) {8445return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8446(vector int)__b);8447}84488449static __inline__ vector unsigned int __ATTRS_o_ai8450vec_vsr(vector unsigned int __a, vector unsigned short __b) {8451return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8452(vector int)__b);8453}84548455static __inline__ vector unsigned int __ATTRS_o_ai8456vec_vsr(vector unsigned int __a, vector unsigned int __b) {8457return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,8458(vector int)__b);8459}84608461static __inline__ vector bool int __ATTRS_o_ai8462vec_vsr(vector bool int __a, vector unsigned char __b) {8463return (vector bool int)__builtin_altivec_vsr((vector int)__a,8464(vector int)__b);8465}84668467static __inline__ vector bool int __ATTRS_o_ai8468vec_vsr(vector bool int __a, vector unsigned short __b) {8469return (vector bool int)__builtin_altivec_vsr((vector int)__a,8470(vector int)__b);8471}84728473static __inline__ vector bool int __ATTRS_o_ai8474vec_vsr(vector bool int __a, vector unsigned int __b) {8475return (vector bool int)__builtin_altivec_vsr((vector int)__a,8476(vector int)__b);8477}84788479/* vec_sro */84808481static __inline__ vector signed char __ATTRS_o_ai8482vec_sro(vector signed char __a, vector signed char __b) {8483return (vector signed char)__builtin_altivec_vsro((vector int)__a,8484(vector int)__b);8485}84868487static __inline__ vector signed char __ATTRS_o_ai8488vec_sro(vector signed char __a, vector unsigned char __b) {8489return (vector signed char)__builtin_altivec_vsro((vector int)__a,8490(vector int)__b);8491}84928493static __inline__ vector unsigned char __ATTRS_o_ai8494vec_sro(vector unsigned char __a, vector signed char __b) {8495return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,8496(vector int)__b);8497}84988499static __inline__ vector unsigned char __ATTRS_o_ai8500vec_sro(vector unsigned char __a, vector unsigned char __b) {8501return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,8502(vector int)__b);8503}85048505static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,8506vector signed char __b) {8507return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8508}85098510static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,8511vector unsigned char __b) {8512return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8513}85148515static __inline__ vector unsigned short __ATTRS_o_ai8516vec_sro(vector unsigned short __a, vector signed char __b) {8517return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,8518(vector int)__b);8519}85208521static __inline__ vector unsigned short __ATTRS_o_ai8522vec_sro(vector unsigned short __a, vector unsigned char __b) {8523return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,8524(vector int)__b);8525}85268527static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,8528vector signed char __b) {8529return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8530}85318532static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,8533vector unsigned char __b) {8534return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8535}85368537static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,8538vector signed char __b) {8539return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);8540}85418542static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,8543vector unsigned char __b) {8544return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);8545}85468547static __inline__ vector unsigned int __ATTRS_o_ai8548vec_sro(vector unsigned int __a, vector signed char __b) {8549return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,8550(vector int)__b);8551}85528553static __inline__ vector unsigned int __ATTRS_o_ai8554vec_sro(vector unsigned int __a, vector unsigned char __b) {8555return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,8556(vector int)__b);8557}85588559static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,8560vector signed char __b) {8561return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8562}85638564static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,8565vector unsigned char __b) {8566return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8567}85688569/* vec_vsro */85708571static __inline__ vector signed char __ATTRS_o_ai8572vec_vsro(vector signed char __a, vector signed char __b) {8573return (vector signed char)__builtin_altivec_vsro((vector int)__a,8574(vector int)__b);8575}85768577static __inline__ vector signed char __ATTRS_o_ai8578vec_vsro(vector signed char __a, vector unsigned char __b) {8579return (vector signed char)__builtin_altivec_vsro((vector int)__a,8580(vector int)__b);8581}85828583static __inline__ vector unsigned char __ATTRS_o_ai8584vec_vsro(vector unsigned char __a, vector signed char __b) {8585return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,8586(vector int)__b);8587}85888589static __inline__ vector unsigned char __ATTRS_o_ai8590vec_vsro(vector unsigned char __a, vector unsigned char __b) {8591return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,8592(vector int)__b);8593}85948595static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,8596vector signed char __b) {8597return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8598}85998600static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,8601vector unsigned char __b) {8602return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8603}86048605static __inline__ vector unsigned short __ATTRS_o_ai8606vec_vsro(vector unsigned short __a, vector signed char __b) {8607return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,8608(vector int)__b);8609}86108611static __inline__ vector unsigned short __ATTRS_o_ai8612vec_vsro(vector unsigned short __a, vector unsigned char __b) {8613return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,8614(vector int)__b);8615}86168617static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,8618vector signed char __b) {8619return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8620}86218622static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,8623vector unsigned char __b) {8624return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8625}86268627static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,8628vector signed char __b) {8629return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);8630}86318632static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,8633vector unsigned char __b) {8634return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);8635}86368637static __inline__ vector unsigned int __ATTRS_o_ai8638vec_vsro(vector unsigned int __a, vector signed char __b) {8639return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,8640(vector int)__b);8641}86428643static __inline__ vector unsigned int __ATTRS_o_ai8644vec_vsro(vector unsigned int __a, vector unsigned char __b) {8645return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,8646(vector int)__b);8647}86488649static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,8650vector signed char __b) {8651return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8652}86538654static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,8655vector unsigned char __b) {8656return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);8657}86588659/* vec_st */86608661static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,8662vector signed char *__c) {8663__builtin_altivec_stvx((vector int)__a, __b, __c);8664}86658666static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, int __b,8667signed char *__c) {8668__builtin_altivec_stvx((vector int)__a, __b, __c);8669}86708671static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,8672vector unsigned char *__c) {8673__builtin_altivec_stvx((vector int)__a, __b, __c);8674}86758676static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, int __b,8677unsigned char *__c) {8678__builtin_altivec_stvx((vector int)__a, __b, __c);8679}86808681static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,8682signed char *__c) {8683__builtin_altivec_stvx((vector int)__a, __b, __c);8684}86858686static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,8687unsigned char *__c) {8688__builtin_altivec_stvx((vector int)__a, __b, __c);8689}86908691static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, int __b,8692vector bool char *__c) {8693__builtin_altivec_stvx((vector int)__a, __b, __c);8694}86958696static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,8697vector short *__c) {8698__builtin_altivec_stvx((vector int)__a, __b, __c);8699}87008701static __inline__ void __ATTRS_o_ai vec_st(vector short __a, int __b,8702short *__c) {8703__builtin_altivec_stvx((vector int)__a, __b, __c);8704}87058706static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,8707vector unsigned short *__c) {8708__builtin_altivec_stvx((vector int)__a, __b, __c);8709}87108711static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, int __b,8712unsigned short *__c) {8713__builtin_altivec_stvx((vector int)__a, __b, __c);8714}87158716static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,8717short *__c) {8718__builtin_altivec_stvx((vector int)__a, __b, __c);8719}87208721static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,8722unsigned short *__c) {8723__builtin_altivec_stvx((vector int)__a, __b, __c);8724}87258726static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, int __b,8727vector bool short *__c) {8728__builtin_altivec_stvx((vector int)__a, __b, __c);8729}87308731static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,8732short *__c) {8733__builtin_altivec_stvx((vector int)__a, __b, __c);8734}87358736static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,8737unsigned short *__c) {8738__builtin_altivec_stvx((vector int)__a, __b, __c);8739}87408741static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, int __b,8742vector pixel *__c) {8743__builtin_altivec_stvx((vector int)__a, __b, __c);8744}87458746static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b,8747vector int *__c) {8748__builtin_altivec_stvx(__a, __b, __c);8749}87508751static __inline__ void __ATTRS_o_ai vec_st(vector int __a, int __b, int *__c) {8752__builtin_altivec_stvx(__a, __b, __c);8753}87548755static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,8756vector unsigned int *__c) {8757__builtin_altivec_stvx((vector int)__a, __b, __c);8758}87598760static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, int __b,8761unsigned int *__c) {8762__builtin_altivec_stvx((vector int)__a, __b, __c);8763}87648765static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,8766int *__c) {8767__builtin_altivec_stvx((vector int)__a, __b, __c);8768}87698770static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,8771unsigned int *__c) {8772__builtin_altivec_stvx((vector int)__a, __b, __c);8773}87748775static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, int __b,8776vector bool int *__c) {8777__builtin_altivec_stvx((vector int)__a, __b, __c);8778}87798780static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,8781vector float *__c) {8782__builtin_altivec_stvx((vector int)__a, __b, __c);8783}87848785static __inline__ void __ATTRS_o_ai vec_st(vector float __a, int __b,8786float *__c) {8787__builtin_altivec_stvx((vector int)__a, __b, __c);8788}87898790/* vec_stvx */87918792static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,8793vector signed char *__c) {8794__builtin_altivec_stvx((vector int)__a, __b, __c);8795}87968797static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, int __b,8798signed char *__c) {8799__builtin_altivec_stvx((vector int)__a, __b, __c);8800}88018802static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,8803vector unsigned char *__c) {8804__builtin_altivec_stvx((vector int)__a, __b, __c);8805}88068807static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, int __b,8808unsigned char *__c) {8809__builtin_altivec_stvx((vector int)__a, __b, __c);8810}88118812static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,8813signed char *__c) {8814__builtin_altivec_stvx((vector int)__a, __b, __c);8815}88168817static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,8818unsigned char *__c) {8819__builtin_altivec_stvx((vector int)__a, __b, __c);8820}88218822static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, int __b,8823vector bool char *__c) {8824__builtin_altivec_stvx((vector int)__a, __b, __c);8825}88268827static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,8828vector short *__c) {8829__builtin_altivec_stvx((vector int)__a, __b, __c);8830}88318832static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, int __b,8833short *__c) {8834__builtin_altivec_stvx((vector int)__a, __b, __c);8835}88368837static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,8838vector unsigned short *__c) {8839__builtin_altivec_stvx((vector int)__a, __b, __c);8840}88418842static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, int __b,8843unsigned short *__c) {8844__builtin_altivec_stvx((vector int)__a, __b, __c);8845}88468847static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,8848short *__c) {8849__builtin_altivec_stvx((vector int)__a, __b, __c);8850}88518852static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,8853unsigned short *__c) {8854__builtin_altivec_stvx((vector int)__a, __b, __c);8855}88568857static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, int __b,8858vector bool short *__c) {8859__builtin_altivec_stvx((vector int)__a, __b, __c);8860}88618862static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,8863short *__c) {8864__builtin_altivec_stvx((vector int)__a, __b, __c);8865}88668867static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,8868unsigned short *__c) {8869__builtin_altivec_stvx((vector int)__a, __b, __c);8870}88718872static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, int __b,8873vector pixel *__c) {8874__builtin_altivec_stvx((vector int)__a, __b, __c);8875}88768877static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,8878vector int *__c) {8879__builtin_altivec_stvx(__a, __b, __c);8880}88818882static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, int __b,8883int *__c) {8884__builtin_altivec_stvx(__a, __b, __c);8885}88868887static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,8888vector unsigned int *__c) {8889__builtin_altivec_stvx((vector int)__a, __b, __c);8890}88918892static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, int __b,8893unsigned int *__c) {8894__builtin_altivec_stvx((vector int)__a, __b, __c);8895}88968897static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,8898int *__c) {8899__builtin_altivec_stvx((vector int)__a, __b, __c);8900}89018902static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,8903unsigned int *__c) {8904__builtin_altivec_stvx((vector int)__a, __b, __c);8905}89068907static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, int __b,8908vector bool int *__c) {8909__builtin_altivec_stvx((vector int)__a, __b, __c);8910}89118912static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,8913vector float *__c) {8914__builtin_altivec_stvx((vector int)__a, __b, __c);8915}89168917static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, int __b,8918float *__c) {8919__builtin_altivec_stvx((vector int)__a, __b, __c);8920}89218922/* vec_ste */89238924static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, int __b,8925signed char *__c) {8926__builtin_altivec_stvebx((vector char)__a, __b, __c);8927}89288929static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, int __b,8930unsigned char *__c) {8931__builtin_altivec_stvebx((vector char)__a, __b, __c);8932}89338934static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,8935signed char *__c) {8936__builtin_altivec_stvebx((vector char)__a, __b, __c);8937}89388939static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, int __b,8940unsigned char *__c) {8941__builtin_altivec_stvebx((vector char)__a, __b, __c);8942}89438944static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, int __b,8945short *__c) {8946__builtin_altivec_stvehx(__a, __b, __c);8947}89488949static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, int __b,8950unsigned short *__c) {8951__builtin_altivec_stvehx((vector short)__a, __b, __c);8952}89538954static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,8955short *__c) {8956__builtin_altivec_stvehx((vector short)__a, __b, __c);8957}89588959static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, int __b,8960unsigned short *__c) {8961__builtin_altivec_stvehx((vector short)__a, __b, __c);8962}89638964static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,8965short *__c) {8966__builtin_altivec_stvehx((vector short)__a, __b, __c);8967}89688969static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, int __b,8970unsigned short *__c) {8971__builtin_altivec_stvehx((vector short)__a, __b, __c);8972}89738974static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, int __b, int *__c) {8975__builtin_altivec_stvewx(__a, __b, __c);8976}89778978static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, int __b,8979unsigned int *__c) {8980__builtin_altivec_stvewx((vector int)__a, __b, __c);8981}89828983static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,8984int *__c) {8985__builtin_altivec_stvewx((vector int)__a, __b, __c);8986}89878988static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, int __b,8989unsigned int *__c) {8990__builtin_altivec_stvewx((vector int)__a, __b, __c);8991}89928993static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, int __b,8994float *__c) {8995__builtin_altivec_stvewx((vector int)__a, __b, __c);8996}89978998/* vec_stvebx */89999000static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, int __b,9001signed char *__c) {9002__builtin_altivec_stvebx((vector char)__a, __b, __c);9003}90049005static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,9006int __b, unsigned char *__c) {9007__builtin_altivec_stvebx((vector char)__a, __b, __c);9008}90099010static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,9011signed char *__c) {9012__builtin_altivec_stvebx((vector char)__a, __b, __c);9013}90149015static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, int __b,9016unsigned char *__c) {9017__builtin_altivec_stvebx((vector char)__a, __b, __c);9018}90199020/* vec_stvehx */90219022static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, int __b,9023short *__c) {9024__builtin_altivec_stvehx(__a, __b, __c);9025}90269027static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,9028int __b, unsigned short *__c) {9029__builtin_altivec_stvehx((vector short)__a, __b, __c);9030}90319032static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,9033short *__c) {9034__builtin_altivec_stvehx((vector short)__a, __b, __c);9035}90369037static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, int __b,9038unsigned short *__c) {9039__builtin_altivec_stvehx((vector short)__a, __b, __c);9040}90419042static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,9043short *__c) {9044__builtin_altivec_stvehx((vector short)__a, __b, __c);9045}90469047static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, int __b,9048unsigned short *__c) {9049__builtin_altivec_stvehx((vector short)__a, __b, __c);9050}90519052/* vec_stvewx */90539054static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, int __b,9055int *__c) {9056__builtin_altivec_stvewx(__a, __b, __c);9057}90589059static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, int __b,9060unsigned int *__c) {9061__builtin_altivec_stvewx((vector int)__a, __b, __c);9062}90639064static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,9065int *__c) {9066__builtin_altivec_stvewx((vector int)__a, __b, __c);9067}90689069static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, int __b,9070unsigned int *__c) {9071__builtin_altivec_stvewx((vector int)__a, __b, __c);9072}90739074static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, int __b,9075float *__c) {9076__builtin_altivec_stvewx((vector int)__a, __b, __c);9077}90789079/* vec_stl */90809081static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,9082vector signed char *__c) {9083__builtin_altivec_stvxl((vector int)__a, __b, __c);9084}90859086static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,9087signed char *__c) {9088__builtin_altivec_stvxl((vector int)__a, __b, __c);9089}90909091static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,9092vector unsigned char *__c) {9093__builtin_altivec_stvxl((vector int)__a, __b, __c);9094}90959096static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,9097unsigned char *__c) {9098__builtin_altivec_stvxl((vector int)__a, __b, __c);9099}91009101static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,9102signed char *__c) {9103__builtin_altivec_stvxl((vector int)__a, __b, __c);9104}91059106static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,9107unsigned char *__c) {9108__builtin_altivec_stvxl((vector int)__a, __b, __c);9109}91109111static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,9112vector bool char *__c) {9113__builtin_altivec_stvxl((vector int)__a, __b, __c);9114}91159116static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,9117vector short *__c) {9118__builtin_altivec_stvxl((vector int)__a, __b, __c);9119}91209121static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,9122short *__c) {9123__builtin_altivec_stvxl((vector int)__a, __b, __c);9124}91259126static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,9127vector unsigned short *__c) {9128__builtin_altivec_stvxl((vector int)__a, __b, __c);9129}91309131static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,9132unsigned short *__c) {9133__builtin_altivec_stvxl((vector int)__a, __b, __c);9134}91359136static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,9137short *__c) {9138__builtin_altivec_stvxl((vector int)__a, __b, __c);9139}91409141static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,9142unsigned short *__c) {9143__builtin_altivec_stvxl((vector int)__a, __b, __c);9144}91459146static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,9147vector bool short *__c) {9148__builtin_altivec_stvxl((vector int)__a, __b, __c);9149}91509151static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,9152short *__c) {9153__builtin_altivec_stvxl((vector int)__a, __b, __c);9154}91559156static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,9157unsigned short *__c) {9158__builtin_altivec_stvxl((vector int)__a, __b, __c);9159}91609161static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,9162vector pixel *__c) {9163__builtin_altivec_stvxl((vector int)__a, __b, __c);9164}91659166static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,9167vector int *__c) {9168__builtin_altivec_stvxl(__a, __b, __c);9169}91709171static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {9172__builtin_altivec_stvxl(__a, __b, __c);9173}91749175static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,9176vector unsigned int *__c) {9177__builtin_altivec_stvxl((vector int)__a, __b, __c);9178}91799180static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,9181unsigned int *__c) {9182__builtin_altivec_stvxl((vector int)__a, __b, __c);9183}91849185static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,9186int *__c) {9187__builtin_altivec_stvxl((vector int)__a, __b, __c);9188}91899190static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,9191unsigned int *__c) {9192__builtin_altivec_stvxl((vector int)__a, __b, __c);9193}91949195static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,9196vector bool int *__c) {9197__builtin_altivec_stvxl((vector int)__a, __b, __c);9198}91999200static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,9201vector float *__c) {9202__builtin_altivec_stvxl((vector int)__a, __b, __c);9203}92049205static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,9206float *__c) {9207__builtin_altivec_stvxl((vector int)__a, __b, __c);9208}92099210/* vec_stvxl */92119212static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,9213vector signed char *__c) {9214__builtin_altivec_stvxl((vector int)__a, __b, __c);9215}92169217static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,9218signed char *__c) {9219__builtin_altivec_stvxl((vector int)__a, __b, __c);9220}92219222static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,9223vector unsigned char *__c) {9224__builtin_altivec_stvxl((vector int)__a, __b, __c);9225}92269227static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,9228unsigned char *__c) {9229__builtin_altivec_stvxl((vector int)__a, __b, __c);9230}92319232static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,9233signed char *__c) {9234__builtin_altivec_stvxl((vector int)__a, __b, __c);9235}92369237static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,9238unsigned char *__c) {9239__builtin_altivec_stvxl((vector int)__a, __b, __c);9240}92419242static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,9243vector bool char *__c) {9244__builtin_altivec_stvxl((vector int)__a, __b, __c);9245}92469247static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,9248vector short *__c) {9249__builtin_altivec_stvxl((vector int)__a, __b, __c);9250}92519252static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,9253short *__c) {9254__builtin_altivec_stvxl((vector int)__a, __b, __c);9255}92569257static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,9258int __b,9259vector unsigned short *__c) {9260__builtin_altivec_stvxl((vector int)__a, __b, __c);9261}92629263static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,9264int __b, unsigned short *__c) {9265__builtin_altivec_stvxl((vector int)__a, __b, __c);9266}92679268static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,9269short *__c) {9270__builtin_altivec_stvxl((vector int)__a, __b, __c);9271}92729273static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,9274unsigned short *__c) {9275__builtin_altivec_stvxl((vector int)__a, __b, __c);9276}92779278static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,9279vector bool short *__c) {9280__builtin_altivec_stvxl((vector int)__a, __b, __c);9281}92829283static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,9284short *__c) {9285__builtin_altivec_stvxl((vector int)__a, __b, __c);9286}92879288static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,9289unsigned short *__c) {9290__builtin_altivec_stvxl((vector int)__a, __b, __c);9291}92929293static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,9294vector pixel *__c) {9295__builtin_altivec_stvxl((vector int)__a, __b, __c);9296}92979298static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,9299vector int *__c) {9300__builtin_altivec_stvxl(__a, __b, __c);9301}93029303static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,9304int *__c) {9305__builtin_altivec_stvxl(__a, __b, __c);9306}93079308static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,9309vector unsigned int *__c) {9310__builtin_altivec_stvxl((vector int)__a, __b, __c);9311}93129313static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,9314unsigned int *__c) {9315__builtin_altivec_stvxl((vector int)__a, __b, __c);9316}93179318static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,9319int *__c) {9320__builtin_altivec_stvxl((vector int)__a, __b, __c);9321}93229323static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,9324unsigned int *__c) {9325__builtin_altivec_stvxl((vector int)__a, __b, __c);9326}93279328static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,9329vector bool int *__c) {9330__builtin_altivec_stvxl((vector int)__a, __b, __c);9331}93329333static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,9334vector float *__c) {9335__builtin_altivec_stvxl((vector int)__a, __b, __c);9336}93379338static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,9339float *__c) {9340__builtin_altivec_stvxl((vector int)__a, __b, __c);9341}93429343/* vec_sub */93449345static __inline__ vector signed char __ATTRS_o_ai9346vec_sub(vector signed char __a, vector signed char __b) {9347return __a - __b;9348}93499350static __inline__ vector signed char __ATTRS_o_ai9351vec_sub(vector bool char __a, vector signed char __b) {9352return (vector signed char)__a - __b;9353}93549355static __inline__ vector signed char __ATTRS_o_ai9356vec_sub(vector signed char __a, vector bool char __b) {9357return __a - (vector signed char)__b;9358}93599360static __inline__ vector unsigned char __ATTRS_o_ai9361vec_sub(vector unsigned char __a, vector unsigned char __b) {9362return __a - __b;9363}93649365static __inline__ vector unsigned char __ATTRS_o_ai9366vec_sub(vector bool char __a, vector unsigned char __b) {9367return (vector unsigned char)__a - __b;9368}93699370static __inline__ vector unsigned char __ATTRS_o_ai9371vec_sub(vector unsigned char __a, vector bool char __b) {9372return __a - (vector unsigned char)__b;9373}93749375static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,9376vector short __b) {9377return __a - __b;9378}93799380static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,9381vector short __b) {9382return (vector short)__a - __b;9383}93849385static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,9386vector bool short __b) {9387return __a - (vector short)__b;9388}93899390static __inline__ vector unsigned short __ATTRS_o_ai9391vec_sub(vector unsigned short __a, vector unsigned short __b) {9392return __a - __b;9393}93949395static __inline__ vector unsigned short __ATTRS_o_ai9396vec_sub(vector bool short __a, vector unsigned short __b) {9397return (vector unsigned short)__a - __b;9398}93999400static __inline__ vector unsigned short __ATTRS_o_ai9401vec_sub(vector unsigned short __a, vector bool short __b) {9402return __a - (vector unsigned short)__b;9403}94049405static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,9406vector int __b) {9407return __a - __b;9408}94099410static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,9411vector int __b) {9412return (vector int)__a - __b;9413}94149415static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,9416vector bool int __b) {9417return __a - (vector int)__b;9418}94199420static __inline__ vector unsigned int __ATTRS_o_ai9421vec_sub(vector unsigned int __a, vector unsigned int __b) {9422return __a - __b;9423}94249425static __inline__ vector unsigned int __ATTRS_o_ai9426vec_sub(vector bool int __a, vector unsigned int __b) {9427return (vector unsigned int)__a - __b;9428}94299430static __inline__ vector unsigned int __ATTRS_o_ai9431vec_sub(vector unsigned int __a, vector bool int __b) {9432return __a - (vector unsigned int)__b;9433}94349435#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)9436static __inline__ vector signed __int128 __ATTRS_o_ai9437vec_sub(vector signed __int128 __a, vector signed __int128 __b) {9438return __a - __b;9439}94409441static __inline__ vector unsigned __int128 __ATTRS_o_ai9442vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {9443return __a - __b;9444}9445#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)94469447#ifdef __VSX__9448static __inline__ vector signed long long __ATTRS_o_ai9449vec_sub(vector signed long long __a, vector signed long long __b) {9450return __a - __b;9451}94529453static __inline__ vector unsigned long long __ATTRS_o_ai9454vec_sub(vector unsigned long long __a, vector unsigned long long __b) {9455return __a - __b;9456}94579458static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,9459vector double __b) {9460return __a - __b;9461}9462#endif94639464static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,9465vector float __b) {9466return __a - __b;9467}94689469/* vec_vsububm */94709471#define __builtin_altivec_vsububm vec_vsububm94729473static __inline__ vector signed char __ATTRS_o_ai9474vec_vsububm(vector signed char __a, vector signed char __b) {9475return __a - __b;9476}94779478static __inline__ vector signed char __ATTRS_o_ai9479vec_vsububm(vector bool char __a, vector signed char __b) {9480return (vector signed char)__a - __b;9481}94829483static __inline__ vector signed char __ATTRS_o_ai9484vec_vsububm(vector signed char __a, vector bool char __b) {9485return __a - (vector signed char)__b;9486}94879488static __inline__ vector unsigned char __ATTRS_o_ai9489vec_vsububm(vector unsigned char __a, vector unsigned char __b) {9490return __a - __b;9491}94929493static __inline__ vector unsigned char __ATTRS_o_ai9494vec_vsububm(vector bool char __a, vector unsigned char __b) {9495return (vector unsigned char)__a - __b;9496}94979498static __inline__ vector unsigned char __ATTRS_o_ai9499vec_vsububm(vector unsigned char __a, vector bool char __b) {9500return __a - (vector unsigned char)__b;9501}95029503/* vec_vsubuhm */95049505#define __builtin_altivec_vsubuhm vec_vsubuhm95069507static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,9508vector short __b) {9509return __a - __b;9510}95119512static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,9513vector short __b) {9514return (vector short)__a - __b;9515}95169517static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,9518vector bool short __b) {9519return __a - (vector short)__b;9520}95219522static __inline__ vector unsigned short __ATTRS_o_ai9523vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {9524return __a - __b;9525}95269527static __inline__ vector unsigned short __ATTRS_o_ai9528vec_vsubuhm(vector bool short __a, vector unsigned short __b) {9529return (vector unsigned short)__a - __b;9530}95319532static __inline__ vector unsigned short __ATTRS_o_ai9533vec_vsubuhm(vector unsigned short __a, vector bool short __b) {9534return __a - (vector unsigned short)__b;9535}95369537/* vec_vsubuwm */95389539#define __builtin_altivec_vsubuwm vec_vsubuwm95409541static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,9542vector int __b) {9543return __a - __b;9544}95459546static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,9547vector int __b) {9548return (vector int)__a - __b;9549}95509551static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,9552vector bool int __b) {9553return __a - (vector int)__b;9554}95559556static __inline__ vector unsigned int __ATTRS_o_ai9557vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {9558return __a - __b;9559}95609561static __inline__ vector unsigned int __ATTRS_o_ai9562vec_vsubuwm(vector bool int __a, vector unsigned int __b) {9563return (vector unsigned int)__a - __b;9564}95659566static __inline__ vector unsigned int __ATTRS_o_ai9567vec_vsubuwm(vector unsigned int __a, vector bool int __b) {9568return __a - (vector unsigned int)__b;9569}95709571/* vec_vsubfp */95729573#define __builtin_altivec_vsubfp vec_vsubfp95749575static __inline__ vector float __attribute__((__always_inline__))9576vec_vsubfp(vector float __a, vector float __b) {9577return __a - __b;9578}95799580/* vec_subc */95819582static __inline__ vector unsigned int __ATTRS_o_ai9583vec_subc(vector unsigned int __a, vector unsigned int __b) {9584return __builtin_altivec_vsubcuw(__a, __b);9585}95869587#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)9588static __inline__ vector unsigned __int128 __ATTRS_o_ai9589vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {9590return __builtin_altivec_vsubcuq(__a, __b);9591}95929593static __inline__ vector signed __int128 __ATTRS_o_ai9594vec_subc(vector signed __int128 __a, vector signed __int128 __b) {9595return __builtin_altivec_vsubcuq(__a, __b);9596}9597#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)95989599/* vec_vsubcuw */96009601static __inline__ vector unsigned int __attribute__((__always_inline__))9602vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {9603return __builtin_altivec_vsubcuw(__a, __b);9604}96059606/* vec_subs */96079608static __inline__ vector signed char __ATTRS_o_ai9609vec_subs(vector signed char __a, vector signed char __b) {9610return __builtin_altivec_vsubsbs(__a, __b);9611}96129613static __inline__ vector signed char __ATTRS_o_ai9614vec_subs(vector bool char __a, vector signed char __b) {9615return __builtin_altivec_vsubsbs((vector signed char)__a, __b);9616}96179618static __inline__ vector signed char __ATTRS_o_ai9619vec_subs(vector signed char __a, vector bool char __b) {9620return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);9621}96229623static __inline__ vector unsigned char __ATTRS_o_ai9624vec_subs(vector unsigned char __a, vector unsigned char __b) {9625return __builtin_altivec_vsububs(__a, __b);9626}96279628static __inline__ vector unsigned char __ATTRS_o_ai9629vec_subs(vector bool char __a, vector unsigned char __b) {9630return __builtin_altivec_vsububs((vector unsigned char)__a, __b);9631}96329633static __inline__ vector unsigned char __ATTRS_o_ai9634vec_subs(vector unsigned char __a, vector bool char __b) {9635return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);9636}96379638static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,9639vector short __b) {9640return __builtin_altivec_vsubshs(__a, __b);9641}96429643static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,9644vector short __b) {9645return __builtin_altivec_vsubshs((vector short)__a, __b);9646}96479648static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,9649vector bool short __b) {9650return __builtin_altivec_vsubshs(__a, (vector short)__b);9651}96529653static __inline__ vector unsigned short __ATTRS_o_ai9654vec_subs(vector unsigned short __a, vector unsigned short __b) {9655return __builtin_altivec_vsubuhs(__a, __b);9656}96579658static __inline__ vector unsigned short __ATTRS_o_ai9659vec_subs(vector bool short __a, vector unsigned short __b) {9660return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);9661}96629663static __inline__ vector unsigned short __ATTRS_o_ai9664vec_subs(vector unsigned short __a, vector bool short __b) {9665return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);9666}96679668static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,9669vector int __b) {9670return __builtin_altivec_vsubsws(__a, __b);9671}96729673static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,9674vector int __b) {9675return __builtin_altivec_vsubsws((vector int)__a, __b);9676}96779678static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,9679vector bool int __b) {9680return __builtin_altivec_vsubsws(__a, (vector int)__b);9681}96829683static __inline__ vector unsigned int __ATTRS_o_ai9684vec_subs(vector unsigned int __a, vector unsigned int __b) {9685return __builtin_altivec_vsubuws(__a, __b);9686}96879688static __inline__ vector unsigned int __ATTRS_o_ai9689vec_subs(vector bool int __a, vector unsigned int __b) {9690return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);9691}96929693static __inline__ vector unsigned int __ATTRS_o_ai9694vec_subs(vector unsigned int __a, vector bool int __b) {9695return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);9696}96979698/* vec_vsubsbs */96999700static __inline__ vector signed char __ATTRS_o_ai9701vec_vsubsbs(vector signed char __a, vector signed char __b) {9702return __builtin_altivec_vsubsbs(__a, __b);9703}97049705static __inline__ vector signed char __ATTRS_o_ai9706vec_vsubsbs(vector bool char __a, vector signed char __b) {9707return __builtin_altivec_vsubsbs((vector signed char)__a, __b);9708}97099710static __inline__ vector signed char __ATTRS_o_ai9711vec_vsubsbs(vector signed char __a, vector bool char __b) {9712return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);9713}97149715/* vec_vsububs */97169717static __inline__ vector unsigned char __ATTRS_o_ai9718vec_vsububs(vector unsigned char __a, vector unsigned char __b) {9719return __builtin_altivec_vsububs(__a, __b);9720}97219722static __inline__ vector unsigned char __ATTRS_o_ai9723vec_vsububs(vector bool char __a, vector unsigned char __b) {9724return __builtin_altivec_vsububs((vector unsigned char)__a, __b);9725}97269727static __inline__ vector unsigned char __ATTRS_o_ai9728vec_vsububs(vector unsigned char __a, vector bool char __b) {9729return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);9730}97319732/* vec_vsubshs */97339734static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,9735vector short __b) {9736return __builtin_altivec_vsubshs(__a, __b);9737}97389739static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,9740vector short __b) {9741return __builtin_altivec_vsubshs((vector short)__a, __b);9742}97439744static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,9745vector bool short __b) {9746return __builtin_altivec_vsubshs(__a, (vector short)__b);9747}97489749/* vec_vsubuhs */97509751static __inline__ vector unsigned short __ATTRS_o_ai9752vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {9753return __builtin_altivec_vsubuhs(__a, __b);9754}97559756static __inline__ vector unsigned short __ATTRS_o_ai9757vec_vsubuhs(vector bool short __a, vector unsigned short __b) {9758return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);9759}97609761static __inline__ vector unsigned short __ATTRS_o_ai9762vec_vsubuhs(vector unsigned short __a, vector bool short __b) {9763return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);9764}97659766/* vec_vsubsws */97679768static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,9769vector int __b) {9770return __builtin_altivec_vsubsws(__a, __b);9771}97729773static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,9774vector int __b) {9775return __builtin_altivec_vsubsws((vector int)__a, __b);9776}97779778static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,9779vector bool int __b) {9780return __builtin_altivec_vsubsws(__a, (vector int)__b);9781}97829783/* vec_vsubuws */97849785static __inline__ vector unsigned int __ATTRS_o_ai9786vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {9787return __builtin_altivec_vsubuws(__a, __b);9788}97899790static __inline__ vector unsigned int __ATTRS_o_ai9791vec_vsubuws(vector bool int __a, vector unsigned int __b) {9792return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);9793}97949795static __inline__ vector unsigned int __ATTRS_o_ai9796vec_vsubuws(vector unsigned int __a, vector bool int __b) {9797return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);9798}97999800#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)9801/* vec_vsubuqm */98029803static __inline__ vector signed __int128 __ATTRS_o_ai9804vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {9805return __a - __b;9806}98079808static __inline__ vector unsigned __int128 __ATTRS_o_ai9809vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {9810return __a - __b;9811}98129813/* vec_vsubeuqm */98149815static __inline__ vector signed __int128 __ATTRS_o_ai9816vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,9817vector signed __int128 __c) {9818return __builtin_altivec_vsubeuqm(__a, __b, __c);9819}98209821static __inline__ vector unsigned __int128 __ATTRS_o_ai9822vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,9823vector unsigned __int128 __c) {9824return __builtin_altivec_vsubeuqm(__a, __b, __c);9825}98269827/* vec_vsubcuq */98289829static __inline__ vector signed __int128 __ATTRS_o_ai9830vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {9831return __builtin_altivec_vsubcuq(__a, __b);9832}98339834static __inline__ vector unsigned __int128 __ATTRS_o_ai9835vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {9836return __builtin_altivec_vsubcuq(__a, __b);9837}98389839/* vec_vsubecuq */98409841static __inline__ vector signed __int128 __ATTRS_o_ai9842vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,9843vector signed __int128 __c) {9844return __builtin_altivec_vsubecuq(__a, __b, __c);9845}98469847static __inline__ vector unsigned __int128 __ATTRS_o_ai9848vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,9849vector unsigned __int128 __c) {9850return __builtin_altivec_vsubecuq(__a, __b, __c);9851}9852#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)98539854/* vec_sum4s */98559856static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,9857vector int __b) {9858return __builtin_altivec_vsum4sbs(__a, __b);9859}98609861static __inline__ vector unsigned int __ATTRS_o_ai9862vec_sum4s(vector unsigned char __a, vector unsigned int __b) {9863return __builtin_altivec_vsum4ubs(__a, __b);9864}98659866static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,9867vector int __b) {9868return __builtin_altivec_vsum4shs(__a, __b);9869}98709871/* vec_vsum4sbs */98729873static __inline__ vector int __attribute__((__always_inline__))9874vec_vsum4sbs(vector signed char __a, vector int __b) {9875return __builtin_altivec_vsum4sbs(__a, __b);9876}98779878/* vec_vsum4ubs */98799880static __inline__ vector unsigned int __attribute__((__always_inline__))9881vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {9882return __builtin_altivec_vsum4ubs(__a, __b);9883}98849885/* vec_vsum4shs */98869887static __inline__ vector int __attribute__((__always_inline__))9888vec_vsum4shs(vector signed short __a, vector int __b) {9889return __builtin_altivec_vsum4shs(__a, __b);9890}98919892/* vec_sum2s */98939894/* The vsum2sws instruction has a big-endian bias, so that the second9895input vector and the result always reference big-endian elements98961 and 3 (little-endian element 0 and 2). For ease of porting the9897programmer wants elements 1 and 3 in both cases, so for little9898endian we must perform some permutes. */98999900static __inline__ vector signed int __attribute__((__always_inline__))9901vec_sum2s(vector int __a, vector int __b) {9902#ifdef __LITTLE_ENDIAN__9903vector int __c = (vector signed int)vec_perm(9904__b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,99058, 9, 10, 11));9906__c = __builtin_altivec_vsum2sws(__a, __c);9907return (vector signed int)vec_perm(9908__c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,99098, 9, 10, 11));9910#else9911return __builtin_altivec_vsum2sws(__a, __b);9912#endif9913}99149915/* vec_vsum2sws */99169917static __inline__ vector signed int __attribute__((__always_inline__))9918vec_vsum2sws(vector int __a, vector int __b) {9919#ifdef __LITTLE_ENDIAN__9920vector int __c = (vector signed int)vec_perm(9921__b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,99228, 9, 10, 11));9923__c = __builtin_altivec_vsum2sws(__a, __c);9924return (vector signed int)vec_perm(9925__c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,99268, 9, 10, 11));9927#else9928return __builtin_altivec_vsum2sws(__a, __b);9929#endif9930}99319932/* vec_sums */99339934/* The vsumsws instruction has a big-endian bias, so that the second9935input vector and the result always reference big-endian element 39936(little-endian element 0). For ease of porting the programmer9937wants element 3 in both cases, so for little endian we must perform9938some permutes. */99399940static __inline__ vector signed int __attribute__((__always_inline__))9941vec_sums(vector signed int __a, vector signed int __b) {9942#ifdef __LITTLE_ENDIAN__9943__b = (vector signed int)vec_splat(__b, 3);9944__b = __builtin_altivec_vsumsws(__a, __b);9945return (vector signed int)(0, 0, 0, __b[0]);9946#else9947return __builtin_altivec_vsumsws(__a, __b);9948#endif9949}99509951/* vec_vsumsws */99529953static __inline__ vector signed int __attribute__((__always_inline__))9954vec_vsumsws(vector signed int __a, vector signed int __b) {9955#ifdef __LITTLE_ENDIAN__9956__b = (vector signed int)vec_splat(__b, 3);9957__b = __builtin_altivec_vsumsws(__a, __b);9958return (vector signed int)(0, 0, 0, __b[0]);9959#else9960return __builtin_altivec_vsumsws(__a, __b);9961#endif9962}99639964/* vec_trunc */99659966static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {9967#ifdef __VSX__9968return __builtin_vsx_xvrspiz(__a);9969#else9970return __builtin_altivec_vrfiz(__a);9971#endif9972}99739974#ifdef __VSX__9975static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {9976return __builtin_vsx_xvrdpiz(__a);9977}9978#endif99799980/* vec_vrfiz */99819982static __inline__ vector float __attribute__((__always_inline__))9983vec_vrfiz(vector float __a) {9984return __builtin_altivec_vrfiz(__a);9985}99869987/* vec_unpackh */99889989/* The vector unpack instructions all have a big-endian bias, so for9990little endian we must reverse the meanings of "high" and "low." */99919992static __inline__ vector short __ATTRS_o_ai9993vec_unpackh(vector signed char __a) {9994#ifdef __LITTLE_ENDIAN__9995return __builtin_altivec_vupklsb((vector char)__a);9996#else9997return __builtin_altivec_vupkhsb((vector char)__a);9998#endif9999}1000010001static __inline__ vector bool short __ATTRS_o_ai10002vec_unpackh(vector bool char __a) {10003#ifdef __LITTLE_ENDIAN__10004return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);10005#else10006return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);10007#endif10008}1000910010static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {10011#ifdef __LITTLE_ENDIAN__10012return __builtin_altivec_vupklsh(__a);10013#else10014return __builtin_altivec_vupkhsh(__a);10015#endif10016}1001710018static __inline__ vector bool int __ATTRS_o_ai10019vec_unpackh(vector bool short __a) {10020#ifdef __LITTLE_ENDIAN__10021return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);10022#else10023return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);10024#endif10025}1002610027static __inline__ vector unsigned int __ATTRS_o_ai10028vec_unpackh(vector pixel __a) {10029#ifdef __LITTLE_ENDIAN__10030return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);10031#else10032return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);10033#endif10034}1003510036#ifdef __POWER8_VECTOR__10037static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {10038#ifdef __LITTLE_ENDIAN__10039return __builtin_altivec_vupklsw(__a);10040#else10041return __builtin_altivec_vupkhsw(__a);10042#endif10043}1004410045static __inline__ vector bool long long __ATTRS_o_ai10046vec_unpackh(vector bool int __a) {10047#ifdef __LITTLE_ENDIAN__10048return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);10049#else10050return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);10051#endif10052}10053#endif1005410055/* vec_vupkhsb */1005610057static __inline__ vector short __ATTRS_o_ai10058vec_vupkhsb(vector signed char __a) {10059#ifdef __LITTLE_ENDIAN__10060return __builtin_altivec_vupklsb((vector char)__a);10061#else10062return __builtin_altivec_vupkhsb((vector char)__a);10063#endif10064}1006510066static __inline__ vector bool short __ATTRS_o_ai10067vec_vupkhsb(vector bool char __a) {10068#ifdef __LITTLE_ENDIAN__10069return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);10070#else10071return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);10072#endif10073}1007410075/* vec_vupkhsh */1007610077static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {10078#ifdef __LITTLE_ENDIAN__10079return __builtin_altivec_vupklsh(__a);10080#else10081return __builtin_altivec_vupkhsh(__a);10082#endif10083}1008410085static __inline__ vector bool int __ATTRS_o_ai10086vec_vupkhsh(vector bool short __a) {10087#ifdef __LITTLE_ENDIAN__10088return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);10089#else10090return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);10091#endif10092}1009310094static __inline__ vector unsigned int __ATTRS_o_ai10095vec_vupkhsh(vector pixel __a) {10096#ifdef __LITTLE_ENDIAN__10097return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);10098#else10099return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);10100#endif10101}1010210103/* vec_vupkhsw */1010410105#ifdef __POWER8_VECTOR__10106static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {10107#ifdef __LITTLE_ENDIAN__10108return __builtin_altivec_vupklsw(__a);10109#else10110return __builtin_altivec_vupkhsw(__a);10111#endif10112}1011310114static __inline__ vector bool long long __ATTRS_o_ai10115vec_vupkhsw(vector bool int __a) {10116#ifdef __LITTLE_ENDIAN__10117return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);10118#else10119return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);10120#endif10121}10122#endif1012310124/* vec_unpackl */1012510126static __inline__ vector short __ATTRS_o_ai10127vec_unpackl(vector signed char __a) {10128#ifdef __LITTLE_ENDIAN__10129return __builtin_altivec_vupkhsb((vector char)__a);10130#else10131return __builtin_altivec_vupklsb((vector char)__a);10132#endif10133}1013410135static __inline__ vector bool short __ATTRS_o_ai10136vec_unpackl(vector bool char __a) {10137#ifdef __LITTLE_ENDIAN__10138return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);10139#else10140return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);10141#endif10142}1014310144static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {10145#ifdef __LITTLE_ENDIAN__10146return __builtin_altivec_vupkhsh(__a);10147#else10148return __builtin_altivec_vupklsh(__a);10149#endif10150}1015110152static __inline__ vector bool int __ATTRS_o_ai10153vec_unpackl(vector bool short __a) {10154#ifdef __LITTLE_ENDIAN__10155return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);10156#else10157return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);10158#endif10159}1016010161static __inline__ vector unsigned int __ATTRS_o_ai10162vec_unpackl(vector pixel __a) {10163#ifdef __LITTLE_ENDIAN__10164return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);10165#else10166return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);10167#endif10168}1016910170#ifdef __POWER8_VECTOR__10171static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {10172#ifdef __LITTLE_ENDIAN__10173return __builtin_altivec_vupkhsw(__a);10174#else10175return __builtin_altivec_vupklsw(__a);10176#endif10177}1017810179static __inline__ vector bool long long __ATTRS_o_ai10180vec_unpackl(vector bool int __a) {10181#ifdef __LITTLE_ENDIAN__10182return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);10183#else10184return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);10185#endif10186}10187#endif1018810189/* vec_vupklsb */1019010191static __inline__ vector short __ATTRS_o_ai10192vec_vupklsb(vector signed char __a) {10193#ifdef __LITTLE_ENDIAN__10194return __builtin_altivec_vupkhsb((vector char)__a);10195#else10196return __builtin_altivec_vupklsb((vector char)__a);10197#endif10198}1019910200static __inline__ vector bool short __ATTRS_o_ai10201vec_vupklsb(vector bool char __a) {10202#ifdef __LITTLE_ENDIAN__10203return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);10204#else10205return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);10206#endif10207}1020810209/* vec_vupklsh */1021010211static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {10212#ifdef __LITTLE_ENDIAN__10213return __builtin_altivec_vupkhsh(__a);10214#else10215return __builtin_altivec_vupklsh(__a);10216#endif10217}1021810219static __inline__ vector bool int __ATTRS_o_ai10220vec_vupklsh(vector bool short __a) {10221#ifdef __LITTLE_ENDIAN__10222return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);10223#else10224return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);10225#endif10226}1022710228static __inline__ vector unsigned int __ATTRS_o_ai10229vec_vupklsh(vector pixel __a) {10230#ifdef __LITTLE_ENDIAN__10231return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);10232#else10233return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);10234#endif10235}1023610237/* vec_vupklsw */1023810239#ifdef __POWER8_VECTOR__10240static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {10241#ifdef __LITTLE_ENDIAN__10242return __builtin_altivec_vupkhsw(__a);10243#else10244return __builtin_altivec_vupklsw(__a);10245#endif10246}1024710248static __inline__ vector bool long long __ATTRS_o_ai10249vec_vupklsw(vector bool int __a) {10250#ifdef __LITTLE_ENDIAN__10251return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);10252#else10253return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);10254#endif10255}10256#endif1025710258/* vec_vsx_ld */1025910260#ifdef __VSX__1026110262static __inline__ vector bool int __ATTRS_o_ai10263vec_vsx_ld(int __a, const vector bool int *__b) {10264return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);10265}1026610267static __inline__ vector signed int __ATTRS_o_ai10268vec_vsx_ld(int __a, const vector signed int *__b) {10269return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);10270}1027110272static __inline__ vector signed int __ATTRS_o_ai10273vec_vsx_ld(int __a, const signed int *__b) {10274return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);10275}1027610277static __inline__ vector unsigned int __ATTRS_o_ai10278vec_vsx_ld(int __a, const vector unsigned int *__b) {10279return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);10280}1028110282static __inline__ vector unsigned int __ATTRS_o_ai10283vec_vsx_ld(int __a, const unsigned int *__b) {10284return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);10285}1028610287static __inline__ vector float __ATTRS_o_ai10288vec_vsx_ld(int __a, const vector float *__b) {10289return (vector float)__builtin_vsx_lxvw4x(__a, __b);10290}1029110292static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,10293const float *__b) {10294return (vector float)__builtin_vsx_lxvw4x(__a, __b);10295}1029610297static __inline__ vector signed long long __ATTRS_o_ai10298vec_vsx_ld(int __a, const vector signed long long *__b) {10299return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);10300}1030110302static __inline__ vector unsigned long long __ATTRS_o_ai10303vec_vsx_ld(int __a, const vector unsigned long long *__b) {10304return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);10305}1030610307static __inline__ vector double __ATTRS_o_ai10308vec_vsx_ld(int __a, const vector double *__b) {10309return (vector double)__builtin_vsx_lxvd2x(__a, __b);10310}1031110312static __inline__ vector double __ATTRS_o_ai10313vec_vsx_ld(int __a, const double *__b) {10314return (vector double)__builtin_vsx_lxvd2x(__a, __b);10315}1031610317static __inline__ vector bool short __ATTRS_o_ai10318vec_vsx_ld(int __a, const vector bool short *__b) {10319return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);10320}1032110322static __inline__ vector signed short __ATTRS_o_ai10323vec_vsx_ld(int __a, const vector signed short *__b) {10324return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);10325}1032610327static __inline__ vector signed short __ATTRS_o_ai10328vec_vsx_ld(int __a, const signed short *__b) {10329return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);10330}1033110332static __inline__ vector unsigned short __ATTRS_o_ai10333vec_vsx_ld(int __a, const vector unsigned short *__b) {10334return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);10335}1033610337static __inline__ vector unsigned short __ATTRS_o_ai10338vec_vsx_ld(int __a, const unsigned short *__b) {10339return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);10340}1034110342static __inline__ vector bool char __ATTRS_o_ai10343vec_vsx_ld(int __a, const vector bool char *__b) {10344return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);10345}1034610347static __inline__ vector signed char __ATTRS_o_ai10348vec_vsx_ld(int __a, const vector signed char *__b) {10349return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);10350}1035110352static __inline__ vector signed char __ATTRS_o_ai10353vec_vsx_ld(int __a, const signed char *__b) {10354return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);10355}1035610357static __inline__ vector unsigned char __ATTRS_o_ai10358vec_vsx_ld(int __a, const vector unsigned char *__b) {10359return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);10360}1036110362static __inline__ vector unsigned char __ATTRS_o_ai10363vec_vsx_ld(int __a, const unsigned char *__b) {10364return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);10365}1036610367#endif1036810369/* vec_vsx_st */1037010371#ifdef __VSX__1037210373static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,10374vector bool int *__c) {10375__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10376}1037710378static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,10379signed int *__c) {10380__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10381}1038210383static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,10384unsigned int *__c) {10385__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10386}1038710388static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,10389vector signed int *__c) {10390__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10391}1039210393static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,10394signed int *__c) {10395__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10396}1039710398static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,10399vector unsigned int *__c) {10400__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10401}1040210403static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,10404unsigned int *__c) {10405__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10406}1040710408static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,10409vector float *__c) {10410__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10411}1041210413static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,10414float *__c) {10415__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10416}1041710418static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,10419int __b,10420vector signed long long *__c) {10421__builtin_vsx_stxvd2x((vector double)__a, __b, __c);10422}1042310424static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,10425int __b,10426vector unsigned long long *__c) {10427__builtin_vsx_stxvd2x((vector double)__a, __b, __c);10428}1042910430static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,10431vector double *__c) {10432__builtin_vsx_stxvd2x((vector double)__a, __b, __c);10433}1043410435static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,10436double *__c) {10437__builtin_vsx_stxvd2x((vector double)__a, __b, __c);10438}1043910440static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,10441vector bool short *__c) {10442__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10443}1044410445static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,10446signed short *__c) {10447__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10448}1044910450static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,10451unsigned short *__c) {10452__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10453}10454static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,10455vector signed short *__c) {10456__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10457}1045810459static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,10460signed short *__c) {10461__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10462}1046310464static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,10465int __b,10466vector unsigned short *__c) {10467__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10468}1046910470static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,10471int __b, unsigned short *__c) {10472__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10473}1047410475static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,10476vector bool char *__c) {10477__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10478}1047910480static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,10481signed char *__c) {10482__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10483}1048410485static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,10486unsigned char *__c) {10487__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10488}1048910490static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,10491vector signed char *__c) {10492__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10493}1049410495static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,10496signed char *__c) {10497__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10498}1049910500static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,10501int __b,10502vector unsigned char *__c) {10503__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10504}1050510506static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,10507int __b, unsigned char *__c) {10508__builtin_vsx_stxvw4x((vector int)__a, __b, __c);10509}1051010511#endif1051210513/* vec_xor */1051410515#define __builtin_altivec_vxor vec_xor1051610517static __inline__ vector signed char __ATTRS_o_ai10518vec_xor(vector signed char __a, vector signed char __b) {10519return __a ^ __b;10520}1052110522static __inline__ vector signed char __ATTRS_o_ai10523vec_xor(vector bool char __a, vector signed char __b) {10524return (vector signed char)__a ^ __b;10525}1052610527static __inline__ vector signed char __ATTRS_o_ai10528vec_xor(vector signed char __a, vector bool char __b) {10529return __a ^ (vector signed char)__b;10530}1053110532static __inline__ vector unsigned char __ATTRS_o_ai10533vec_xor(vector unsigned char __a, vector unsigned char __b) {10534return __a ^ __b;10535}1053610537static __inline__ vector unsigned char __ATTRS_o_ai10538vec_xor(vector bool char __a, vector unsigned char __b) {10539return (vector unsigned char)__a ^ __b;10540}1054110542static __inline__ vector unsigned char __ATTRS_o_ai10543vec_xor(vector unsigned char __a, vector bool char __b) {10544return __a ^ (vector unsigned char)__b;10545}1054610547static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,10548vector bool char __b) {10549return __a ^ __b;10550}1055110552static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,10553vector short __b) {10554return __a ^ __b;10555}1055610557static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,10558vector short __b) {10559return (vector short)__a ^ __b;10560}1056110562static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,10563vector bool short __b) {10564return __a ^ (vector short)__b;10565}1056610567static __inline__ vector unsigned short __ATTRS_o_ai10568vec_xor(vector unsigned short __a, vector unsigned short __b) {10569return __a ^ __b;10570}1057110572static __inline__ vector unsigned short __ATTRS_o_ai10573vec_xor(vector bool short __a, vector unsigned short __b) {10574return (vector unsigned short)__a ^ __b;10575}1057610577static __inline__ vector unsigned short __ATTRS_o_ai10578vec_xor(vector unsigned short __a, vector bool short __b) {10579return __a ^ (vector unsigned short)__b;10580}1058110582static __inline__ vector bool short __ATTRS_o_ai10583vec_xor(vector bool short __a, vector bool short __b) {10584return __a ^ __b;10585}1058610587static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,10588vector int __b) {10589return __a ^ __b;10590}1059110592static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,10593vector int __b) {10594return (vector int)__a ^ __b;10595}1059610597static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,10598vector bool int __b) {10599return __a ^ (vector int)__b;10600}1060110602static __inline__ vector unsigned int __ATTRS_o_ai10603vec_xor(vector unsigned int __a, vector unsigned int __b) {10604return __a ^ __b;10605}1060610607static __inline__ vector unsigned int __ATTRS_o_ai10608vec_xor(vector bool int __a, vector unsigned int __b) {10609return (vector unsigned int)__a ^ __b;10610}1061110612static __inline__ vector unsigned int __ATTRS_o_ai10613vec_xor(vector unsigned int __a, vector bool int __b) {10614return __a ^ (vector unsigned int)__b;10615}1061610617static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,10618vector bool int __b) {10619return __a ^ __b;10620}1062110622static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,10623vector float __b) {10624vector unsigned int __res =10625(vector unsigned int)__a ^ (vector unsigned int)__b;10626return (vector float)__res;10627}1062810629static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,10630vector float __b) {10631vector unsigned int __res =10632(vector unsigned int)__a ^ (vector unsigned int)__b;10633return (vector float)__res;10634}1063510636static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,10637vector bool int __b) {10638vector unsigned int __res =10639(vector unsigned int)__a ^ (vector unsigned int)__b;10640return (vector float)__res;10641}1064210643#ifdef __VSX__10644static __inline__ vector signed long long __ATTRS_o_ai10645vec_xor(vector signed long long __a, vector signed long long __b) {10646return __a ^ __b;10647}1064810649static __inline__ vector signed long long __ATTRS_o_ai10650vec_xor(vector bool long long __a, vector signed long long __b) {10651return (vector signed long long)__a ^ __b;10652}1065310654static __inline__ vector signed long long __ATTRS_o_ai10655vec_xor(vector signed long long __a, vector bool long long __b) {10656return __a ^ (vector signed long long)__b;10657}1065810659static __inline__ vector unsigned long long __ATTRS_o_ai10660vec_xor(vector unsigned long long __a, vector unsigned long long __b) {10661return __a ^ __b;10662}1066310664static __inline__ vector unsigned long long __ATTRS_o_ai10665vec_xor(vector bool long long __a, vector unsigned long long __b) {10666return (vector unsigned long long)__a ^ __b;10667}1066810669static __inline__ vector unsigned long long __ATTRS_o_ai10670vec_xor(vector unsigned long long __a, vector bool long long __b) {10671return __a ^ (vector unsigned long long)__b;10672}1067310674static __inline__ vector bool long long __ATTRS_o_ai10675vec_xor(vector bool long long __a, vector bool long long __b) {10676return __a ^ __b;10677}1067810679static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,10680vector double __b) {10681return (vector double)((vector unsigned long long)__a ^10682(vector unsigned long long)__b);10683}1068410685static __inline__ vector double __ATTRS_o_ai10686vec_xor(vector double __a, vector bool long long __b) {10687return (vector double)((vector unsigned long long)__a ^10688(vector unsigned long long)__b);10689}1069010691static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,10692vector double __b) {10693return (vector double)((vector unsigned long long)__a ^10694(vector unsigned long long)__b);10695}10696#endif1069710698/* vec_vxor */1069910700static __inline__ vector signed char __ATTRS_o_ai10701vec_vxor(vector signed char __a, vector signed char __b) {10702return __a ^ __b;10703}1070410705static __inline__ vector signed char __ATTRS_o_ai10706vec_vxor(vector bool char __a, vector signed char __b) {10707return (vector signed char)__a ^ __b;10708}1070910710static __inline__ vector signed char __ATTRS_o_ai10711vec_vxor(vector signed char __a, vector bool char __b) {10712return __a ^ (vector signed char)__b;10713}1071410715static __inline__ vector unsigned char __ATTRS_o_ai10716vec_vxor(vector unsigned char __a, vector unsigned char __b) {10717return __a ^ __b;10718}1071910720static __inline__ vector unsigned char __ATTRS_o_ai10721vec_vxor(vector bool char __a, vector unsigned char __b) {10722return (vector unsigned char)__a ^ __b;10723}1072410725static __inline__ vector unsigned char __ATTRS_o_ai10726vec_vxor(vector unsigned char __a, vector bool char __b) {10727return __a ^ (vector unsigned char)__b;10728}1072910730static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,10731vector bool char __b) {10732return __a ^ __b;10733}1073410735static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,10736vector short __b) {10737return __a ^ __b;10738}1073910740static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,10741vector short __b) {10742return (vector short)__a ^ __b;10743}1074410745static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,10746vector bool short __b) {10747return __a ^ (vector short)__b;10748}1074910750static __inline__ vector unsigned short __ATTRS_o_ai10751vec_vxor(vector unsigned short __a, vector unsigned short __b) {10752return __a ^ __b;10753}1075410755static __inline__ vector unsigned short __ATTRS_o_ai10756vec_vxor(vector bool short __a, vector unsigned short __b) {10757return (vector unsigned short)__a ^ __b;10758}1075910760static __inline__ vector unsigned short __ATTRS_o_ai10761vec_vxor(vector unsigned short __a, vector bool short __b) {10762return __a ^ (vector unsigned short)__b;10763}1076410765static __inline__ vector bool short __ATTRS_o_ai10766vec_vxor(vector bool short __a, vector bool short __b) {10767return __a ^ __b;10768}1076910770static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,10771vector int __b) {10772return __a ^ __b;10773}1077410775static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,10776vector int __b) {10777return (vector int)__a ^ __b;10778}1077910780static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,10781vector bool int __b) {10782return __a ^ (vector int)__b;10783}1078410785static __inline__ vector unsigned int __ATTRS_o_ai10786vec_vxor(vector unsigned int __a, vector unsigned int __b) {10787return __a ^ __b;10788}1078910790static __inline__ vector unsigned int __ATTRS_o_ai10791vec_vxor(vector bool int __a, vector unsigned int __b) {10792return (vector unsigned int)__a ^ __b;10793}1079410795static __inline__ vector unsigned int __ATTRS_o_ai10796vec_vxor(vector unsigned int __a, vector bool int __b) {10797return __a ^ (vector unsigned int)__b;10798}1079910800static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,10801vector bool int __b) {10802return __a ^ __b;10803}1080410805static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,10806vector float __b) {10807vector unsigned int __res =10808(vector unsigned int)__a ^ (vector unsigned int)__b;10809return (vector float)__res;10810}1081110812static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,10813vector float __b) {10814vector unsigned int __res =10815(vector unsigned int)__a ^ (vector unsigned int)__b;10816return (vector float)__res;10817}1081810819static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,10820vector bool int __b) {10821vector unsigned int __res =10822(vector unsigned int)__a ^ (vector unsigned int)__b;10823return (vector float)__res;10824}1082510826#ifdef __VSX__10827static __inline__ vector signed long long __ATTRS_o_ai10828vec_vxor(vector signed long long __a, vector signed long long __b) {10829return __a ^ __b;10830}1083110832static __inline__ vector signed long long __ATTRS_o_ai10833vec_vxor(vector bool long long __a, vector signed long long __b) {10834return (vector signed long long)__a ^ __b;10835}1083610837static __inline__ vector signed long long __ATTRS_o_ai10838vec_vxor(vector signed long long __a, vector bool long long __b) {10839return __a ^ (vector signed long long)__b;10840}1084110842static __inline__ vector unsigned long long __ATTRS_o_ai10843vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {10844return __a ^ __b;10845}1084610847static __inline__ vector unsigned long long __ATTRS_o_ai10848vec_vxor(vector bool long long __a, vector unsigned long long __b) {10849return (vector unsigned long long)__a ^ __b;10850}1085110852static __inline__ vector unsigned long long __ATTRS_o_ai10853vec_vxor(vector unsigned long long __a, vector bool long long __b) {10854return __a ^ (vector unsigned long long)__b;10855}1085610857static __inline__ vector bool long long __ATTRS_o_ai10858vec_vxor(vector bool long long __a, vector bool long long __b) {10859return __a ^ __b;10860}10861#endif1086210863/* ------------------------ extensions for CBEA ----------------------------- */1086410865/* vec_extract */1086610867static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,10868int __b) {10869return __a[__b];10870}1087110872static __inline__ unsigned char __ATTRS_o_ai10873vec_extract(vector unsigned char __a, int __b) {10874return __a[__b];10875}1087610877static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,10878int __b) {10879return __a[__b];10880}1088110882static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,10883int __b) {10884return __a[__b];10885}1088610887static __inline__ unsigned short __ATTRS_o_ai10888vec_extract(vector unsigned short __a, int __b) {10889return __a[__b];10890}1089110892static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,10893int __b) {10894return __a[__b];10895}1089610897static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,10898int __b) {10899return __a[__b];10900}1090110902static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,10903int __b) {10904return __a[__b];10905}1090610907static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,10908int __b) {10909return __a[__b];10910}1091110912#ifdef __VSX__10913static __inline__ signed long long __ATTRS_o_ai10914vec_extract(vector signed long long __a, int __b) {10915return __a[__b];10916}1091710918static __inline__ unsigned long long __ATTRS_o_ai10919vec_extract(vector unsigned long long __a, int __b) {10920return __a[__b];10921}1092210923static __inline__ unsigned long long __ATTRS_o_ai10924vec_extract(vector bool long long __a, int __b) {10925return __a[__b];10926}1092710928static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, int __b) {10929return __a[__b];10930}10931#endif1093210933static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, int __b) {10934return __a[__b];10935}1093610937/* vec_insert */1093810939static __inline__ vector signed char __ATTRS_o_ai10940vec_insert(signed char __a, vector signed char __b, int __c) {10941__b[__c] = __a;10942return __b;10943}1094410945static __inline__ vector unsigned char __ATTRS_o_ai10946vec_insert(unsigned char __a, vector unsigned char __b, int __c) {10947__b[__c] = __a;10948return __b;10949}1095010951static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,10952vector bool char __b,10953int __c) {10954__b[__c] = __a;10955return __b;10956}1095710958static __inline__ vector signed short __ATTRS_o_ai10959vec_insert(signed short __a, vector signed short __b, int __c) {10960__b[__c] = __a;10961return __b;10962}1096310964static __inline__ vector unsigned short __ATTRS_o_ai10965vec_insert(unsigned short __a, vector unsigned short __b, int __c) {10966__b[__c] = __a;10967return __b;10968}1096910970static __inline__ vector bool short __ATTRS_o_ai10971vec_insert(unsigned short __a, vector bool short __b, int __c) {10972__b[__c] = __a;10973return __b;10974}1097510976static __inline__ vector signed int __ATTRS_o_ai10977vec_insert(signed int __a, vector signed int __b, int __c) {10978__b[__c] = __a;10979return __b;10980}1098110982static __inline__ vector unsigned int __ATTRS_o_ai10983vec_insert(unsigned int __a, vector unsigned int __b, int __c) {10984__b[__c] = __a;10985return __b;10986}1098710988static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,10989vector bool int __b,10990int __c) {10991__b[__c] = __a;10992return __b;10993}1099410995#ifdef __VSX__10996static __inline__ vector signed long long __ATTRS_o_ai10997vec_insert(signed long long __a, vector signed long long __b, int __c) {10998__b[__c] = __a;10999return __b;11000}1100111002static __inline__ vector unsigned long long __ATTRS_o_ai11003vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {11004__b[__c] = __a;11005return __b;11006}1100711008static __inline__ vector bool long long __ATTRS_o_ai11009vec_insert(unsigned long long __a, vector bool long long __b, int __c) {11010__b[__c] = __a;11011return __b;11012}11013static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,11014vector double __b,11015int __c) {11016__b[__c] = __a;11017return __b;11018}11019#endif1102011021static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,11022vector float __b,11023int __c) {11024__b[__c] = __a;11025return __b;11026}1102711028/* vec_lvlx */1102911030static __inline__ vector signed char __ATTRS_o_ai11031vec_lvlx(int __a, const signed char *__b) {11032return vec_perm(vec_ld(__a, __b), (vector signed char)(0),11033vec_lvsl(__a, __b));11034}1103511036static __inline__ vector signed char __ATTRS_o_ai11037vec_lvlx(int __a, const vector signed char *__b) {11038return vec_perm(vec_ld(__a, __b), (vector signed char)(0),11039vec_lvsl(__a, (unsigned char *)__b));11040}1104111042static __inline__ vector unsigned char __ATTRS_o_ai11043vec_lvlx(int __a, const unsigned char *__b) {11044return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),11045vec_lvsl(__a, __b));11046}1104711048static __inline__ vector unsigned char __ATTRS_o_ai11049vec_lvlx(int __a, const vector unsigned char *__b) {11050return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),11051vec_lvsl(__a, (unsigned char *)__b));11052}1105311054static __inline__ vector bool char __ATTRS_o_ai11055vec_lvlx(int __a, const vector bool char *__b) {11056return vec_perm(vec_ld(__a, __b), (vector bool char)(0),11057vec_lvsl(__a, (unsigned char *)__b));11058}1105911060static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,11061const short *__b) {11062return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));11063}1106411065static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,11066const vector short *__b) {11067return vec_perm(vec_ld(__a, __b), (vector short)(0),11068vec_lvsl(__a, (unsigned char *)__b));11069}1107011071static __inline__ vector unsigned short __ATTRS_o_ai11072vec_lvlx(int __a, const unsigned short *__b) {11073return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),11074vec_lvsl(__a, __b));11075}1107611077static __inline__ vector unsigned short __ATTRS_o_ai11078vec_lvlx(int __a, const vector unsigned short *__b) {11079return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),11080vec_lvsl(__a, (unsigned char *)__b));11081}1108211083static __inline__ vector bool short __ATTRS_o_ai11084vec_lvlx(int __a, const vector bool short *__b) {11085return vec_perm(vec_ld(__a, __b), (vector bool short)(0),11086vec_lvsl(__a, (unsigned char *)__b));11087}1108811089static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,11090const vector pixel *__b) {11091return vec_perm(vec_ld(__a, __b), (vector pixel)(0),11092vec_lvsl(__a, (unsigned char *)__b));11093}1109411095static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {11096return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));11097}1109811099static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,11100const vector int *__b) {11101return vec_perm(vec_ld(__a, __b), (vector int)(0),11102vec_lvsl(__a, (unsigned char *)__b));11103}1110411105static __inline__ vector unsigned int __ATTRS_o_ai11106vec_lvlx(int __a, const unsigned int *__b) {11107return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),11108vec_lvsl(__a, __b));11109}1111011111static __inline__ vector unsigned int __ATTRS_o_ai11112vec_lvlx(int __a, const vector unsigned int *__b) {11113return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),11114vec_lvsl(__a, (unsigned char *)__b));11115}1111611117static __inline__ vector bool int __ATTRS_o_ai11118vec_lvlx(int __a, const vector bool int *__b) {11119return vec_perm(vec_ld(__a, __b), (vector bool int)(0),11120vec_lvsl(__a, (unsigned char *)__b));11121}1112211123static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,11124const float *__b) {11125return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));11126}1112711128static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,11129const vector float *__b) {11130return vec_perm(vec_ld(__a, __b), (vector float)(0),11131vec_lvsl(__a, (unsigned char *)__b));11132}1113311134/* vec_lvlxl */1113511136static __inline__ vector signed char __ATTRS_o_ai11137vec_lvlxl(int __a, const signed char *__b) {11138return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),11139vec_lvsl(__a, __b));11140}1114111142static __inline__ vector signed char __ATTRS_o_ai11143vec_lvlxl(int __a, const vector signed char *__b) {11144return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),11145vec_lvsl(__a, (unsigned char *)__b));11146}1114711148static __inline__ vector unsigned char __ATTRS_o_ai11149vec_lvlxl(int __a, const unsigned char *__b) {11150return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),11151vec_lvsl(__a, __b));11152}1115311154static __inline__ vector unsigned char __ATTRS_o_ai11155vec_lvlxl(int __a, const vector unsigned char *__b) {11156return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),11157vec_lvsl(__a, (unsigned char *)__b));11158}1115911160static __inline__ vector bool char __ATTRS_o_ai11161vec_lvlxl(int __a, const vector bool char *__b) {11162return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),11163vec_lvsl(__a, (unsigned char *)__b));11164}1116511166static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,11167const short *__b) {11168return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));11169}1117011171static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,11172const vector short *__b) {11173return vec_perm(vec_ldl(__a, __b), (vector short)(0),11174vec_lvsl(__a, (unsigned char *)__b));11175}1117611177static __inline__ vector unsigned short __ATTRS_o_ai11178vec_lvlxl(int __a, const unsigned short *__b) {11179return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),11180vec_lvsl(__a, __b));11181}1118211183static __inline__ vector unsigned short __ATTRS_o_ai11184vec_lvlxl(int __a, const vector unsigned short *__b) {11185return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),11186vec_lvsl(__a, (unsigned char *)__b));11187}1118811189static __inline__ vector bool short __ATTRS_o_ai11190vec_lvlxl(int __a, const vector bool short *__b) {11191return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),11192vec_lvsl(__a, (unsigned char *)__b));11193}1119411195static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,11196const vector pixel *__b) {11197return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),11198vec_lvsl(__a, (unsigned char *)__b));11199}1120011201static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {11202return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));11203}1120411205static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,11206const vector int *__b) {11207return vec_perm(vec_ldl(__a, __b), (vector int)(0),11208vec_lvsl(__a, (unsigned char *)__b));11209}1121011211static __inline__ vector unsigned int __ATTRS_o_ai11212vec_lvlxl(int __a, const unsigned int *__b) {11213return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),11214vec_lvsl(__a, __b));11215}1121611217static __inline__ vector unsigned int __ATTRS_o_ai11218vec_lvlxl(int __a, const vector unsigned int *__b) {11219return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),11220vec_lvsl(__a, (unsigned char *)__b));11221}1122211223static __inline__ vector bool int __ATTRS_o_ai11224vec_lvlxl(int __a, const vector bool int *__b) {11225return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),11226vec_lvsl(__a, (unsigned char *)__b));11227}1122811229static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,11230const float *__b) {11231return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));11232}1123311234static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,11235vector float *__b) {11236return vec_perm(vec_ldl(__a, __b), (vector float)(0),11237vec_lvsl(__a, (unsigned char *)__b));11238}1123911240/* vec_lvrx */1124111242static __inline__ vector signed char __ATTRS_o_ai11243vec_lvrx(int __a, const signed char *__b) {11244return vec_perm((vector signed char)(0), vec_ld(__a, __b),11245vec_lvsl(__a, __b));11246}1124711248static __inline__ vector signed char __ATTRS_o_ai11249vec_lvrx(int __a, const vector signed char *__b) {11250return vec_perm((vector signed char)(0), vec_ld(__a, __b),11251vec_lvsl(__a, (unsigned char *)__b));11252}1125311254static __inline__ vector unsigned char __ATTRS_o_ai11255vec_lvrx(int __a, const unsigned char *__b) {11256return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),11257vec_lvsl(__a, __b));11258}1125911260static __inline__ vector unsigned char __ATTRS_o_ai11261vec_lvrx(int __a, const vector unsigned char *__b) {11262return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),11263vec_lvsl(__a, (unsigned char *)__b));11264}1126511266static __inline__ vector bool char __ATTRS_o_ai11267vec_lvrx(int __a, const vector bool char *__b) {11268return vec_perm((vector bool char)(0), vec_ld(__a, __b),11269vec_lvsl(__a, (unsigned char *)__b));11270}1127111272static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,11273const short *__b) {11274return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));11275}1127611277static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,11278const vector short *__b) {11279return vec_perm((vector short)(0), vec_ld(__a, __b),11280vec_lvsl(__a, (unsigned char *)__b));11281}1128211283static __inline__ vector unsigned short __ATTRS_o_ai11284vec_lvrx(int __a, const unsigned short *__b) {11285return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),11286vec_lvsl(__a, __b));11287}1128811289static __inline__ vector unsigned short __ATTRS_o_ai11290vec_lvrx(int __a, const vector unsigned short *__b) {11291return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),11292vec_lvsl(__a, (unsigned char *)__b));11293}1129411295static __inline__ vector bool short __ATTRS_o_ai11296vec_lvrx(int __a, const vector bool short *__b) {11297return vec_perm((vector bool short)(0), vec_ld(__a, __b),11298vec_lvsl(__a, (unsigned char *)__b));11299}1130011301static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,11302const vector pixel *__b) {11303return vec_perm((vector pixel)(0), vec_ld(__a, __b),11304vec_lvsl(__a, (unsigned char *)__b));11305}1130611307static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {11308return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));11309}1131011311static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,11312const vector int *__b) {11313return vec_perm((vector int)(0), vec_ld(__a, __b),11314vec_lvsl(__a, (unsigned char *)__b));11315}1131611317static __inline__ vector unsigned int __ATTRS_o_ai11318vec_lvrx(int __a, const unsigned int *__b) {11319return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),11320vec_lvsl(__a, __b));11321}1132211323static __inline__ vector unsigned int __ATTRS_o_ai11324vec_lvrx(int __a, const vector unsigned int *__b) {11325return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),11326vec_lvsl(__a, (unsigned char *)__b));11327}1132811329static __inline__ vector bool int __ATTRS_o_ai11330vec_lvrx(int __a, const vector bool int *__b) {11331return vec_perm((vector bool int)(0), vec_ld(__a, __b),11332vec_lvsl(__a, (unsigned char *)__b));11333}1133411335static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,11336const float *__b) {11337return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));11338}1133911340static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,11341const vector float *__b) {11342return vec_perm((vector float)(0), vec_ld(__a, __b),11343vec_lvsl(__a, (unsigned char *)__b));11344}1134511346/* vec_lvrxl */1134711348static __inline__ vector signed char __ATTRS_o_ai11349vec_lvrxl(int __a, const signed char *__b) {11350return vec_perm((vector signed char)(0), vec_ldl(__a, __b),11351vec_lvsl(__a, __b));11352}1135311354static __inline__ vector signed char __ATTRS_o_ai11355vec_lvrxl(int __a, const vector signed char *__b) {11356return vec_perm((vector signed char)(0), vec_ldl(__a, __b),11357vec_lvsl(__a, (unsigned char *)__b));11358}1135911360static __inline__ vector unsigned char __ATTRS_o_ai11361vec_lvrxl(int __a, const unsigned char *__b) {11362return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),11363vec_lvsl(__a, __b));11364}1136511366static __inline__ vector unsigned char __ATTRS_o_ai11367vec_lvrxl(int __a, const vector unsigned char *__b) {11368return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),11369vec_lvsl(__a, (unsigned char *)__b));11370}1137111372static __inline__ vector bool char __ATTRS_o_ai11373vec_lvrxl(int __a, const vector bool char *__b) {11374return vec_perm((vector bool char)(0), vec_ldl(__a, __b),11375vec_lvsl(__a, (unsigned char *)__b));11376}1137711378static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,11379const short *__b) {11380return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));11381}1138211383static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,11384const vector short *__b) {11385return vec_perm((vector short)(0), vec_ldl(__a, __b),11386vec_lvsl(__a, (unsigned char *)__b));11387}1138811389static __inline__ vector unsigned short __ATTRS_o_ai11390vec_lvrxl(int __a, const unsigned short *__b) {11391return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),11392vec_lvsl(__a, __b));11393}1139411395static __inline__ vector unsigned short __ATTRS_o_ai11396vec_lvrxl(int __a, const vector unsigned short *__b) {11397return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),11398vec_lvsl(__a, (unsigned char *)__b));11399}1140011401static __inline__ vector bool short __ATTRS_o_ai11402vec_lvrxl(int __a, const vector bool short *__b) {11403return vec_perm((vector bool short)(0), vec_ldl(__a, __b),11404vec_lvsl(__a, (unsigned char *)__b));11405}1140611407static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,11408const vector pixel *__b) {11409return vec_perm((vector pixel)(0), vec_ldl(__a, __b),11410vec_lvsl(__a, (unsigned char *)__b));11411}1141211413static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {11414return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));11415}1141611417static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,11418const vector int *__b) {11419return vec_perm((vector int)(0), vec_ldl(__a, __b),11420vec_lvsl(__a, (unsigned char *)__b));11421}1142211423static __inline__ vector unsigned int __ATTRS_o_ai11424vec_lvrxl(int __a, const unsigned int *__b) {11425return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),11426vec_lvsl(__a, __b));11427}1142811429static __inline__ vector unsigned int __ATTRS_o_ai11430vec_lvrxl(int __a, const vector unsigned int *__b) {11431return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),11432vec_lvsl(__a, (unsigned char *)__b));11433}1143411435static __inline__ vector bool int __ATTRS_o_ai11436vec_lvrxl(int __a, const vector bool int *__b) {11437return vec_perm((vector bool int)(0), vec_ldl(__a, __b),11438vec_lvsl(__a, (unsigned char *)__b));11439}1144011441static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,11442const float *__b) {11443return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));11444}1144511446static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,11447const vector float *__b) {11448return vec_perm((vector float)(0), vec_ldl(__a, __b),11449vec_lvsl(__a, (unsigned char *)__b));11450}1145111452/* vec_stvlx */1145311454static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,11455signed char *__c) {11456return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11457__c);11458}1145911460static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,11461vector signed char *__c) {11462return vec_st(11463vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11464__b, __c);11465}1146611467static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,11468unsigned char *__c) {11469return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11470__c);11471}1147211473static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,11474vector unsigned char *__c) {11475return vec_st(11476vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11477__b, __c);11478}1147911480static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,11481vector bool char *__c) {11482return vec_st(11483vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11484__b, __c);11485}1148611487static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,11488short *__c) {11489return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11490__c);11491}1149211493static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,11494vector short *__c) {11495return vec_st(11496vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11497__b, __c);11498}1149911500static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,11501int __b, unsigned short *__c) {11502return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11503__c);11504}1150511506static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,11507int __b,11508vector unsigned short *__c) {11509return vec_st(11510vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11511__b, __c);11512}1151311514static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,11515vector bool short *__c) {11516return vec_st(11517vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11518__b, __c);11519}1152011521static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,11522vector pixel *__c) {11523return vec_st(11524vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11525__b, __c);11526}1152711528static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,11529int *__c) {11530return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11531__c);11532}1153311534static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,11535vector int *__c) {11536return vec_st(11537vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11538__b, __c);11539}1154011541static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,11542unsigned int *__c) {11543return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11544__c);11545}1154611547static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,11548vector unsigned int *__c) {11549return vec_st(11550vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11551__b, __c);11552}1155311554static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,11555vector bool int *__c) {11556return vec_st(11557vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11558__b, __c);11559}1156011561static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,11562vector float *__c) {11563return vec_st(11564vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11565__b, __c);11566}1156711568/* vec_stvlxl */1156911570static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,11571signed char *__c) {11572return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11573__c);11574}1157511576static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,11577vector signed char *__c) {11578return vec_stl(11579vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11580__b, __c);11581}1158211583static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,11584int __b, unsigned char *__c) {11585return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11586__c);11587}1158811589static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,11590int __b,11591vector unsigned char *__c) {11592return vec_stl(11593vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11594__b, __c);11595}1159611597static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,11598vector bool char *__c) {11599return vec_stl(11600vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11601__b, __c);11602}1160311604static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,11605short *__c) {11606return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11607__c);11608}1160911610static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,11611vector short *__c) {11612return vec_stl(11613vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11614__b, __c);11615}1161611617static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,11618int __b, unsigned short *__c) {11619return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11620__c);11621}1162211623static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,11624int __b,11625vector unsigned short *__c) {11626return vec_stl(11627vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11628__b, __c);11629}1163011631static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,11632vector bool short *__c) {11633return vec_stl(11634vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11635__b, __c);11636}1163711638static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,11639vector pixel *__c) {11640return vec_stl(11641vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11642__b, __c);11643}1164411645static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,11646int *__c) {11647return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11648__c);11649}1165011651static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,11652vector int *__c) {11653return vec_stl(11654vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11655__b, __c);11656}1165711658static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,11659unsigned int *__c) {11660return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,11661__c);11662}1166311664static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,11665vector unsigned int *__c) {11666return vec_stl(11667vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11668__b, __c);11669}1167011671static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,11672vector bool int *__c) {11673return vec_stl(11674vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11675__b, __c);11676}1167711678static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,11679vector float *__c) {11680return vec_stl(11681vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),11682__b, __c);11683}1168411685/* vec_stvrx */1168611687static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,11688signed char *__c) {11689return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11690__c);11691}1169211693static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,11694vector signed char *__c) {11695return vec_st(11696vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11697__b, __c);11698}1169911700static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,11701unsigned char *__c) {11702return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11703__c);11704}1170511706static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,11707vector unsigned char *__c) {11708return vec_st(11709vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11710__b, __c);11711}1171211713static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,11714vector bool char *__c) {11715return vec_st(11716vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11717__b, __c);11718}1171911720static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,11721short *__c) {11722return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11723__c);11724}1172511726static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,11727vector short *__c) {11728return vec_st(11729vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11730__b, __c);11731}1173211733static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,11734int __b, unsigned short *__c) {11735return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11736__c);11737}1173811739static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,11740int __b,11741vector unsigned short *__c) {11742return vec_st(11743vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11744__b, __c);11745}1174611747static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,11748vector bool short *__c) {11749return vec_st(11750vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11751__b, __c);11752}1175311754static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,11755vector pixel *__c) {11756return vec_st(11757vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11758__b, __c);11759}1176011761static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,11762int *__c) {11763return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11764__c);11765}1176611767static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,11768vector int *__c) {11769return vec_st(11770vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11771__b, __c);11772}1177311774static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,11775unsigned int *__c) {11776return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11777__c);11778}1177911780static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,11781vector unsigned int *__c) {11782return vec_st(11783vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11784__b, __c);11785}1178611787static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,11788vector bool int *__c) {11789return vec_st(11790vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11791__b, __c);11792}1179311794static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,11795vector float *__c) {11796return vec_st(11797vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11798__b, __c);11799}1180011801/* vec_stvrxl */1180211803static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,11804signed char *__c) {11805return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11806__c);11807}1180811809static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,11810vector signed char *__c) {11811return vec_stl(11812vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11813__b, __c);11814}1181511816static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,11817int __b, unsigned char *__c) {11818return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11819__c);11820}1182111822static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,11823int __b,11824vector unsigned char *__c) {11825return vec_stl(11826vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11827__b, __c);11828}1182911830static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,11831vector bool char *__c) {11832return vec_stl(11833vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11834__b, __c);11835}1183611837static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,11838short *__c) {11839return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11840__c);11841}1184211843static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,11844vector short *__c) {11845return vec_stl(11846vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11847__b, __c);11848}1184911850static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,11851int __b, unsigned short *__c) {11852return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11853__c);11854}1185511856static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,11857int __b,11858vector unsigned short *__c) {11859return vec_stl(11860vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11861__b, __c);11862}1186311864static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,11865vector bool short *__c) {11866return vec_stl(11867vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11868__b, __c);11869}1187011871static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,11872vector pixel *__c) {11873return vec_stl(11874vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11875__b, __c);11876}1187711878static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,11879int *__c) {11880return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11881__c);11882}1188311884static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,11885vector int *__c) {11886return vec_stl(11887vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11888__b, __c);11889}1189011891static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,11892unsigned int *__c) {11893return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,11894__c);11895}1189611897static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,11898vector unsigned int *__c) {11899return vec_stl(11900vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11901__b, __c);11902}1190311904static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,11905vector bool int *__c) {11906return vec_stl(11907vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11908__b, __c);11909}1191011911static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,11912vector float *__c) {11913return vec_stl(11914vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),11915__b, __c);11916}1191711918/* vec_promote */1191911920static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,11921int __b) {11922vector signed char __res = (vector signed char)(0);11923__res[__b] = __a;11924return __res;11925}1192611927static __inline__ vector unsigned char __ATTRS_o_ai11928vec_promote(unsigned char __a, int __b) {11929vector unsigned char __res = (vector unsigned char)(0);11930__res[__b] = __a;11931return __res;11932}1193311934static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {11935vector short __res = (vector short)(0);11936__res[__b] = __a;11937return __res;11938}1193911940static __inline__ vector unsigned short __ATTRS_o_ai11941vec_promote(unsigned short __a, int __b) {11942vector unsigned short __res = (vector unsigned short)(0);11943__res[__b] = __a;11944return __res;11945}1194611947static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {11948vector int __res = (vector int)(0);11949__res[__b] = __a;11950return __res;11951}1195211953static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,11954int __b) {11955vector unsigned int __res = (vector unsigned int)(0);11956__res[__b] = __a;11957return __res;11958}1195911960static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {11961vector float __res = (vector float)(0);11962__res[__b] = __a;11963return __res;11964}1196511966/* vec_splats */1196711968static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {11969return (vector signed char)(__a);11970}1197111972static __inline__ vector unsigned char __ATTRS_o_ai11973vec_splats(unsigned char __a) {11974return (vector unsigned char)(__a);11975}1197611977static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {11978return (vector short)(__a);11979}1198011981static __inline__ vector unsigned short __ATTRS_o_ai11982vec_splats(unsigned short __a) {11983return (vector unsigned short)(__a);11984}1198511986static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {11987return (vector int)(__a);11988}1198911990static __inline__ vector unsigned int __ATTRS_o_ai11991vec_splats(unsigned int __a) {11992return (vector unsigned int)(__a);11993}1199411995#ifdef __VSX__11996static __inline__ vector signed long long __ATTRS_o_ai11997vec_splats(signed long long __a) {11998return (vector signed long long)(__a);11999}1200012001static __inline__ vector unsigned long long __ATTRS_o_ai12002vec_splats(unsigned long long __a) {12003return (vector unsigned long long)(__a);12004}1200512006#if defined(__POWER8_VECTOR__) && defined(__powerpc64__)12007static __inline__ vector signed __int128 __ATTRS_o_ai12008vec_splats(signed __int128 __a) {12009return (vector signed __int128)(__a);12010}1201112012static __inline__ vector unsigned __int128 __ATTRS_o_ai12013vec_splats(unsigned __int128 __a) {12014return (vector unsigned __int128)(__a);12015}1201612017#endif1201812019static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {12020return (vector double)(__a);12021}12022#endif1202312024static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {12025return (vector float)(__a);12026}1202712028/* ----------------------------- predicates --------------------------------- */1202912030/* vec_all_eq */1203112032static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,12033vector signed char __b) {12034return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12035(vector char)__b);12036}1203712038static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,12039vector bool char __b) {12040return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12041(vector char)__b);12042}1204312044static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,12045vector unsigned char __b) {12046return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12047(vector char)__b);12048}1204912050static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,12051vector bool char __b) {12052return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12053(vector char)__b);12054}1205512056static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,12057vector signed char __b) {12058return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12059(vector char)__b);12060}1206112062static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,12063vector unsigned char __b) {12064return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12065(vector char)__b);12066}1206712068static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,12069vector bool char __b) {12070return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,12071(vector char)__b);12072}1207312074static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,12075vector short __b) {12076return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);12077}1207812079static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,12080vector bool short __b) {12081return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);12082}1208312084static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,12085vector unsigned short __b) {12086return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12087(vector short)__b);12088}1208912090static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,12091vector bool short __b) {12092return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12093(vector short)__b);12094}1209512096static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,12097vector short __b) {12098return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12099(vector short)__b);12100}1210112102static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,12103vector unsigned short __b) {12104return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12105(vector short)__b);12106}1210712108static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,12109vector bool short __b) {12110return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12111(vector short)__b);12112}1211312114static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,12115vector pixel __b) {12116return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,12117(vector short)__b);12118}1211912120static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {12121return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);12122}1212312124static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,12125vector bool int __b) {12126return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);12127}1212812129static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,12130vector unsigned int __b) {12131return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,12132(vector int)__b);12133}1213412135static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,12136vector bool int __b) {12137return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,12138(vector int)__b);12139}1214012141static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,12142vector int __b) {12143return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,12144(vector int)__b);12145}1214612147static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,12148vector unsigned int __b) {12149return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,12150(vector int)__b);12151}1215212153static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,12154vector bool int __b) {12155return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,12156(vector int)__b);12157}1215812159#ifdef __POWER8_VECTOR__12160static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,12161vector signed long long __b) {12162return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);12163}1216412165static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,12166vector bool long long __b) {12167return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, (vector long long)__b);12168}1216912170static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,12171vector unsigned long long __b) {12172return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,12173(vector long long)__b);12174}1217512176static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,12177vector bool long long __b) {12178return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,12179(vector long long)__b);12180}1218112182static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,12183vector long long __b) {12184return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,12185(vector long long)__b);12186}1218712188static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,12189vector unsigned long long __b) {12190return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,12191(vector long long)__b);12192}1219312194static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,12195vector bool long long __b) {12196return __builtin_altivec_vcmpequd_p(__CR6_LT, (vector long long)__a,12197(vector long long)__b);12198}12199#endif1220012201static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,12202vector float __b) {12203#ifdef __VSX__12204return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);12205#else12206return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);12207#endif12208}1220912210#ifdef __VSX__12211static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,12212vector double __b) {12213return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);12214}12215#endif1221612217/* vec_all_ge */1221812219static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,12220vector signed char __b) {12221return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);12222}1222312224static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,12225vector bool char __b) {12226return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);12227}1222812229static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,12230vector unsigned char __b) {12231return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);12232}1223312234static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,12235vector bool char __b) {12236return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);12237}1223812239static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,12240vector signed char __b) {12241return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,12242(vector unsigned char)__a);12243}1224412245static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,12246vector unsigned char __b) {12247return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);12248}1224912250static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,12251vector bool char __b) {12252return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,12253(vector unsigned char)__a);12254}1225512256static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,12257vector short __b) {12258return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);12259}1226012261static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,12262vector bool short __b) {12263return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);12264}1226512266static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,12267vector unsigned short __b) {12268return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);12269}1227012271static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,12272vector bool short __b) {12273return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,12274__a);12275}1227612277static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,12278vector short __b) {12279return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,12280(vector unsigned short)__a);12281}1228212283static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,12284vector unsigned short __b) {12285return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,12286(vector unsigned short)__a);12287}1228812289static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,12290vector bool short __b) {12291return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,12292(vector unsigned short)__a);12293}1229412295static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {12296return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);12297}1229812299static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,12300vector bool int __b) {12301return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);12302}1230312304static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,12305vector unsigned int __b) {12306return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);12307}1230812309static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,12310vector bool int __b) {12311return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);12312}1231312314static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,12315vector int __b) {12316return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,12317(vector unsigned int)__a);12318}1231912320static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,12321vector unsigned int __b) {12322return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);12323}1232412325static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,12326vector bool int __b) {12327return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,12328(vector unsigned int)__a);12329}1233012331#ifdef __POWER8_VECTOR__12332static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,12333vector signed long long __b) {12334return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);12335}12336static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,12337vector bool long long __b) {12338return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,12339__a);12340}1234112342static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,12343vector unsigned long long __b) {12344return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);12345}1234612347static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,12348vector bool long long __b) {12349return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,12350__a);12351}1235212353static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,12354vector signed long long __b) {12355return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,12356(vector unsigned long long)__a);12357}1235812359static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,12360vector unsigned long long __b) {12361return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,12362(vector unsigned long long)__a);12363}1236412365static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,12366vector bool long long __b) {12367return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,12368(vector unsigned long long)__a);12369}12370#endif1237112372static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,12373vector float __b) {12374#ifdef __VSX__12375return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);12376#else12377return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);12378#endif12379}1238012381#ifdef __VSX__12382static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,12383vector double __b) {12384return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);12385}12386#endif1238712388/* vec_all_gt */1238912390static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,12391vector signed char __b) {12392return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);12393}1239412395static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,12396vector bool char __b) {12397return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);12398}1239912400static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,12401vector unsigned char __b) {12402return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);12403}1240412405static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,12406vector bool char __b) {12407return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);12408}1240912410static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,12411vector signed char __b) {12412return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,12413(vector unsigned char)__b);12414}1241512416static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,12417vector unsigned char __b) {12418return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);12419}1242012421static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,12422vector bool char __b) {12423return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,12424(vector unsigned char)__b);12425}1242612427static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,12428vector short __b) {12429return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);12430}1243112432static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,12433vector bool short __b) {12434return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);12435}1243612437static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,12438vector unsigned short __b) {12439return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);12440}1244112442static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,12443vector bool short __b) {12444return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,12445(vector unsigned short)__b);12446}1244712448static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,12449vector short __b) {12450return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,12451(vector unsigned short)__b);12452}1245312454static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,12455vector unsigned short __b) {12456return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,12457__b);12458}1245912460static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,12461vector bool short __b) {12462return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,12463(vector unsigned short)__b);12464}1246512466static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {12467return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);12468}1246912470static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,12471vector bool int __b) {12472return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);12473}1247412475static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,12476vector unsigned int __b) {12477return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);12478}1247912480static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,12481vector bool int __b) {12482return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);12483}1248412485static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,12486vector int __b) {12487return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,12488(vector unsigned int)__b);12489}1249012491static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,12492vector unsigned int __b) {12493return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);12494}1249512496static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,12497vector bool int __b) {12498return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,12499(vector unsigned int)__b);12500}1250112502#ifdef __POWER8_VECTOR__12503static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,12504vector signed long long __b) {12505return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);12506}12507static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,12508vector bool long long __b) {12509return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,12510(vector signed long long)__b);12511}1251212513static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,12514vector unsigned long long __b) {12515return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);12516}1251712518static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,12519vector bool long long __b) {12520return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,12521(vector unsigned long long)__b);12522}1252312524static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,12525vector signed long long __b) {12526return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,12527(vector unsigned long long)__b);12528}1252912530static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,12531vector unsigned long long __b) {12532return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,12533__b);12534}1253512536static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,12537vector bool long long __b) {12538return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,12539(vector unsigned long long)__b);12540}12541#endif1254212543static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,12544vector float __b) {12545#ifdef __VSX__12546return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);12547#else12548return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);12549#endif12550}1255112552#ifdef __VSX__12553static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,12554vector double __b) {12555return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);12556}12557#endif1255812559/* vec_all_in */1256012561static __inline__ int __attribute__((__always_inline__))12562vec_all_in(vector float __a, vector float __b) {12563return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);12564}1256512566/* vec_all_le */1256712568static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,12569vector signed char __b) {12570return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);12571}1257212573static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,12574vector bool char __b) {12575return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);12576}1257712578static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,12579vector unsigned char __b) {12580return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);12581}1258212583static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,12584vector bool char __b) {12585return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);12586}1258712588static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,12589vector signed char __b) {12590return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,12591(vector unsigned char)__b);12592}1259312594static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,12595vector unsigned char __b) {12596return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);12597}1259812599static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,12600vector bool char __b) {12601return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,12602(vector unsigned char)__b);12603}1260412605static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,12606vector short __b) {12607return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);12608}1260912610static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,12611vector bool short __b) {12612return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);12613}1261412615static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,12616vector unsigned short __b) {12617return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);12618}1261912620static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,12621vector bool short __b) {12622return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,12623(vector unsigned short)__b);12624}1262512626static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,12627vector short __b) {12628return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,12629(vector unsigned short)__b);12630}1263112632static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,12633vector unsigned short __b) {12634return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,12635__b);12636}1263712638static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,12639vector bool short __b) {12640return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,12641(vector unsigned short)__b);12642}1264312644static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {12645return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);12646}1264712648static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,12649vector bool int __b) {12650return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);12651}1265212653static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,12654vector unsigned int __b) {12655return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);12656}1265712658static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,12659vector bool int __b) {12660return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);12661}1266212663static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,12664vector int __b) {12665return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,12666(vector unsigned int)__b);12667}1266812669static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,12670vector unsigned int __b) {12671return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);12672}1267312674static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,12675vector bool int __b) {12676return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,12677(vector unsigned int)__b);12678}1267912680#ifdef __POWER8_VECTOR__12681static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,12682vector signed long long __b) {12683return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);12684}1268512686static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,12687vector unsigned long long __b) {12688return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);12689}1269012691static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,12692vector bool long long __b) {12693return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,12694(vector signed long long)__b);12695}1269612697static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,12698vector bool long long __b) {12699return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,12700(vector unsigned long long)__b);12701}1270212703static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,12704vector signed long long __b) {12705return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,12706(vector unsigned long long)__b);12707}1270812709static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,12710vector unsigned long long __b) {12711return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,12712__b);12713}1271412715static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,12716vector bool long long __b) {12717return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,12718(vector unsigned long long)__b);12719}12720#endif1272112722static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,12723vector float __b) {12724#ifdef __VSX__12725return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);12726#else12727return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);12728#endif12729}1273012731#ifdef __VSX__12732static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,12733vector double __b) {12734return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);12735}12736#endif1273712738/* vec_all_lt */1273912740static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,12741vector signed char __b) {12742return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);12743}1274412745static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,12746vector bool char __b) {12747return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);12748}1274912750static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,12751vector unsigned char __b) {12752return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);12753}1275412755static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,12756vector bool char __b) {12757return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);12758}1275912760static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,12761vector signed char __b) {12762return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,12763(vector unsigned char)__a);12764}1276512766static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,12767vector unsigned char __b) {12768return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);12769}1277012771static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,12772vector bool char __b) {12773return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,12774(vector unsigned char)__a);12775}1277612777static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,12778vector short __b) {12779return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);12780}1278112782static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,12783vector bool short __b) {12784return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);12785}1278612787static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,12788vector unsigned short __b) {12789return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);12790}1279112792static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,12793vector bool short __b) {12794return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,12795__a);12796}1279712798static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,12799vector short __b) {12800return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,12801(vector unsigned short)__a);12802}1280312804static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,12805vector unsigned short __b) {12806return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,12807(vector unsigned short)__a);12808}1280912810static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,12811vector bool short __b) {12812return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,12813(vector unsigned short)__a);12814}1281512816static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {12817return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);12818}1281912820static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,12821vector bool int __b) {12822return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);12823}1282412825static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,12826vector unsigned int __b) {12827return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);12828}1282912830static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,12831vector bool int __b) {12832return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);12833}1283412835static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,12836vector int __b) {12837return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,12838(vector unsigned int)__a);12839}1284012841static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,12842vector unsigned int __b) {12843return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);12844}1284512846static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,12847vector bool int __b) {12848return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,12849(vector unsigned int)__a);12850}1285112852#ifdef __POWER8_VECTOR__12853static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,12854vector signed long long __b) {12855return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);12856}1285712858static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,12859vector unsigned long long __b) {12860return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);12861}1286212863static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,12864vector bool long long __b) {12865return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,12866__a);12867}1286812869static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,12870vector bool long long __b) {12871return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,12872__a);12873}1287412875static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,12876vector signed long long __b) {12877return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,12878(vector unsigned long long)__a);12879}1288012881static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,12882vector unsigned long long __b) {12883return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,12884(vector unsigned long long)__a);12885}1288612887static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,12888vector bool long long __b) {12889return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,12890(vector unsigned long long)__a);12891}12892#endif1289312894static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,12895vector float __b) {12896#ifdef __VSX__12897return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);12898#else12899return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);12900#endif12901}1290212903#ifdef __VSX__12904static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,12905vector double __b) {12906return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);12907}12908#endif1290912910/* vec_all_nan */1291112912static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {12913#ifdef __VSX__12914return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);12915#else12916return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);12917#endif12918}1291912920#ifdef __VSX__12921static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {12922return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);12923}12924#endif1292512926/* vec_all_ne */1292712928static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,12929vector signed char __b) {12930return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12931(vector char)__b);12932}1293312934static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,12935vector bool char __b) {12936return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12937(vector char)__b);12938}1293912940static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,12941vector unsigned char __b) {12942return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12943(vector char)__b);12944}1294512946static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,12947vector bool char __b) {12948return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12949(vector char)__b);12950}1295112952static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,12953vector signed char __b) {12954return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12955(vector char)__b);12956}1295712958static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,12959vector unsigned char __b) {12960return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12961(vector char)__b);12962}1296312964static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,12965vector bool char __b) {12966return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,12967(vector char)__b);12968}1296912970static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,12971vector short __b) {12972return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);12973}1297412975static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,12976vector bool short __b) {12977return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);12978}1297912980static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,12981vector unsigned short __b) {12982return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,12983(vector short)__b);12984}1298512986static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,12987vector bool short __b) {12988return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,12989(vector short)__b);12990}1299112992static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,12993vector short __b) {12994return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,12995(vector short)__b);12996}1299712998static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,12999vector unsigned short __b) {13000return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,13001(vector short)__b);13002}1300313004static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,13005vector bool short __b) {13006return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,13007(vector short)__b);13008}1300913010static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,13011vector pixel __b) {13012return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,13013(vector short)__b);13014}1301513016static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {13017return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);13018}1301913020static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,13021vector bool int __b) {13022return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);13023}1302413025static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,13026vector unsigned int __b) {13027return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,13028(vector int)__b);13029}1303013031static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,13032vector bool int __b) {13033return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,13034(vector int)__b);13035}1303613037static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,13038vector int __b) {13039return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,13040(vector int)__b);13041}1304213043static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,13044vector unsigned int __b) {13045return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,13046(vector int)__b);13047}1304813049static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,13050vector bool int __b) {13051return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,13052(vector int)__b);13053}1305413055#ifdef __POWER8_VECTOR__13056static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,13057vector signed long long __b) {13058return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);13059}1306013061static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,13062vector unsigned long long __b) {13063return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,13064(vector long long)__b);13065}1306613067static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,13068vector bool long long __b) {13069return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,13070(vector signed long long)__b);13071}1307213073static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,13074vector bool long long __b) {13075return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,13076(vector signed long long)__b);13077}1307813079static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,13080vector signed long long __b) {13081return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,13082(vector signed long long)__b);13083}1308413085static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,13086vector unsigned long long __b) {13087return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,13088(vector signed long long)__b);13089}1309013091static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,13092vector bool long long __b) {13093return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,13094(vector signed long long)__b);13095}13096#endif1309713098static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,13099vector float __b) {13100#ifdef __VSX__13101return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);13102#else13103return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);13104#endif13105}1310613107#ifdef __VSX__13108static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,13109vector double __b) {13110return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);13111}13112#endif1311313114/* vec_all_nge */1311513116static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,13117vector float __b) {13118#ifdef __VSX__13119return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);13120#else13121return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);13122#endif13123}1312413125#ifdef __VSX__13126static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,13127vector double __b) {13128return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);13129}13130#endif1313113132/* vec_all_ngt */1313313134static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,13135vector float __b) {13136#ifdef __VSX__13137return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);13138#else13139return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);13140#endif13141}1314213143#ifdef __VSX__13144static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,13145vector double __b) {13146return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);13147}13148#endif1314913150/* vec_all_nle */1315113152static __inline__ int __attribute__((__always_inline__))13153vec_all_nle(vector float __a, vector float __b) {13154return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);13155}1315613157/* vec_all_nlt */1315813159static __inline__ int __attribute__((__always_inline__))13160vec_all_nlt(vector float __a, vector float __b) {13161return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);13162}1316313164/* vec_all_numeric */1316513166static __inline__ int __attribute__((__always_inline__))13167vec_all_numeric(vector float __a) {13168return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);13169}1317013171/* vec_any_eq */1317213173static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,13174vector signed char __b) {13175return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13176(vector char)__b);13177}1317813179static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,13180vector bool char __b) {13181return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13182(vector char)__b);13183}1318413185static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,13186vector unsigned char __b) {13187return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13188(vector char)__b);13189}1319013191static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,13192vector bool char __b) {13193return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13194(vector char)__b);13195}1319613197static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,13198vector signed char __b) {13199return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13200(vector char)__b);13201}1320213203static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,13204vector unsigned char __b) {13205return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13206(vector char)__b);13207}1320813209static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,13210vector bool char __b) {13211return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,13212(vector char)__b);13213}1321413215static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,13216vector short __b) {13217return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);13218}1321913220static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,13221vector bool short __b) {13222return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);13223}1322413225static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,13226vector unsigned short __b) {13227return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13228(vector short)__b);13229}1323013231static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,13232vector bool short __b) {13233return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13234(vector short)__b);13235}1323613237static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,13238vector short __b) {13239return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13240(vector short)__b);13241}1324213243static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,13244vector unsigned short __b) {13245return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13246(vector short)__b);13247}1324813249static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,13250vector bool short __b) {13251return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13252(vector short)__b);13253}1325413255static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,13256vector pixel __b) {13257return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,13258(vector short)__b);13259}1326013261static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {13262return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);13263}1326413265static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,13266vector bool int __b) {13267return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);13268}1326913270static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,13271vector unsigned int __b) {13272return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,13273(vector int)__b);13274}1327513276static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,13277vector bool int __b) {13278return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,13279(vector int)__b);13280}1328113282static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,13283vector int __b) {13284return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,13285(vector int)__b);13286}1328713288static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,13289vector unsigned int __b) {13290return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,13291(vector int)__b);13292}1329313294static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,13295vector bool int __b) {13296return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,13297(vector int)__b);13298}1329913300#ifdef __POWER8_VECTOR__13301static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,13302vector signed long long __b) {13303return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);13304}1330513306static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,13307vector unsigned long long __b) {13308return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,13309(vector long long)__b);13310}1331113312static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,13313vector bool long long __b) {13314return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,13315(vector signed long long)__b);13316}1331713318static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,13319vector bool long long __b) {13320return __builtin_altivec_vcmpequd_p(13321__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);13322}1332313324static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,13325vector signed long long __b) {13326return __builtin_altivec_vcmpequd_p(13327__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);13328}1332913330static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,13331vector unsigned long long __b) {13332return __builtin_altivec_vcmpequd_p(13333__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);13334}1333513336static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,13337vector bool long long __b) {13338return __builtin_altivec_vcmpequd_p(13339__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);13340}13341#endif1334213343static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,13344vector float __b) {13345#ifdef __VSX__13346return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);13347#else13348return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);13349#endif13350}1335113352#ifdef __VSX__13353static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,13354vector double __b) {13355return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);13356}13357#endif1335813359/* vec_any_ge */1336013361static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,13362vector signed char __b) {13363return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);13364}1336513366static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,13367vector bool char __b) {13368return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,13369__a);13370}1337113372static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,13373vector unsigned char __b) {13374return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);13375}1337613377static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,13378vector bool char __b) {13379return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,13380__a);13381}1338213383static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,13384vector signed char __b) {13385return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,13386(vector unsigned char)__a);13387}1338813389static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,13390vector unsigned char __b) {13391return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,13392(vector unsigned char)__a);13393}1339413395static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,13396vector bool char __b) {13397return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,13398(vector unsigned char)__a);13399}1340013401static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,13402vector short __b) {13403return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);13404}1340513406static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,13407vector bool short __b) {13408return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);13409}1341013411static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,13412vector unsigned short __b) {13413return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);13414}1341513416static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,13417vector bool short __b) {13418return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,13419__a);13420}1342113422static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,13423vector short __b) {13424return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,13425(vector unsigned short)__a);13426}1342713428static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,13429vector unsigned short __b) {13430return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,13431(vector unsigned short)__a);13432}1343313434static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,13435vector bool short __b) {13436return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,13437(vector unsigned short)__a);13438}1343913440static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {13441return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);13442}1344313444static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,13445vector bool int __b) {13446return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);13447}1344813449static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,13450vector unsigned int __b) {13451return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);13452}1345313454static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,13455vector bool int __b) {13456return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,13457__a);13458}1345913460static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,13461vector int __b) {13462return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,13463(vector unsigned int)__a);13464}1346513466static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,13467vector unsigned int __b) {13468return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,13469(vector unsigned int)__a);13470}1347113472static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,13473vector bool int __b) {13474return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,13475(vector unsigned int)__a);13476}1347713478#ifdef __POWER8_VECTOR__13479static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,13480vector signed long long __b) {13481return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);13482}1348313484static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,13485vector unsigned long long __b) {13486return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);13487}1348813489static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,13490vector bool long long __b) {13491return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,13492(vector signed long long)__b, __a);13493}1349413495static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,13496vector bool long long __b) {13497return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13498(vector unsigned long long)__b, __a);13499}1350013501static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,13502vector signed long long __b) {13503return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13504(vector unsigned long long)__b,13505(vector unsigned long long)__a);13506}1350713508static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,13509vector unsigned long long __b) {13510return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,13511(vector unsigned long long)__a);13512}1351313514static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,13515vector bool long long __b) {13516return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13517(vector unsigned long long)__b,13518(vector unsigned long long)__a);13519}13520#endif1352113522static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,13523vector float __b) {13524#ifdef __VSX__13525return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);13526#else13527return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);13528#endif13529}1353013531#ifdef __VSX__13532static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,13533vector double __b) {13534return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);13535}13536#endif1353713538/* vec_any_gt */1353913540static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,13541vector signed char __b) {13542return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);13543}1354413545static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,13546vector bool char __b) {13547return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,13548(vector signed char)__b);13549}1355013551static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,13552vector unsigned char __b) {13553return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);13554}1355513556static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,13557vector bool char __b) {13558return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,13559(vector unsigned char)__b);13560}1356113562static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,13563vector signed char __b) {13564return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,13565(vector unsigned char)__b);13566}1356713568static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,13569vector unsigned char __b) {13570return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,13571__b);13572}1357313574static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,13575vector bool char __b) {13576return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,13577(vector unsigned char)__b);13578}1357913580static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,13581vector short __b) {13582return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);13583}1358413585static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,13586vector bool short __b) {13587return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);13588}1358913590static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,13591vector unsigned short __b) {13592return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);13593}1359413595static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,13596vector bool short __b) {13597return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,13598(vector unsigned short)__b);13599}1360013601static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,13602vector short __b) {13603return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,13604(vector unsigned short)__b);13605}1360613607static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,13608vector unsigned short __b) {13609return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,13610__b);13611}1361213613static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,13614vector bool short __b) {13615return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,13616(vector unsigned short)__b);13617}1361813619static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {13620return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);13621}1362213623static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,13624vector bool int __b) {13625return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);13626}1362713628static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,13629vector unsigned int __b) {13630return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);13631}1363213633static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,13634vector bool int __b) {13635return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,13636(vector unsigned int)__b);13637}1363813639static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,13640vector int __b) {13641return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,13642(vector unsigned int)__b);13643}1364413645static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,13646vector unsigned int __b) {13647return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,13648__b);13649}1365013651static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,13652vector bool int __b) {13653return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,13654(vector unsigned int)__b);13655}1365613657#ifdef __POWER8_VECTOR__13658static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,13659vector signed long long __b) {13660return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);13661}1366213663static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,13664vector unsigned long long __b) {13665return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);13666}1366713668static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,13669vector bool long long __b) {13670return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,13671(vector signed long long)__b);13672}1367313674static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,13675vector bool long long __b) {13676return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,13677(vector unsigned long long)__b);13678}1367913680static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,13681vector signed long long __b) {13682return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,13683(vector unsigned long long)__a,13684(vector unsigned long long)__b);13685}1368613687static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,13688vector unsigned long long __b) {13689return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,13690(vector unsigned long long)__a, __b);13691}1369213693static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,13694vector bool long long __b) {13695return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,13696(vector unsigned long long)__a,13697(vector unsigned long long)__b);13698}13699#endif1370013701static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,13702vector float __b) {13703#ifdef __VSX__13704return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);13705#else13706return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);13707#endif13708}1370913710#ifdef __VSX__13711static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,13712vector double __b) {13713return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);13714}13715#endif1371613717/* vec_any_le */1371813719static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,13720vector signed char __b) {13721return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);13722}1372313724static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,13725vector bool char __b) {13726return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,13727(vector signed char)__b);13728}1372913730static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,13731vector unsigned char __b) {13732return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);13733}1373413735static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,13736vector bool char __b) {13737return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,13738(vector unsigned char)__b);13739}1374013741static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,13742vector signed char __b) {13743return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,13744(vector unsigned char)__b);13745}1374613747static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,13748vector unsigned char __b) {13749return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,13750__b);13751}1375213753static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,13754vector bool char __b) {13755return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,13756(vector unsigned char)__b);13757}1375813759static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,13760vector short __b) {13761return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);13762}1376313764static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,13765vector bool short __b) {13766return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);13767}1376813769static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,13770vector unsigned short __b) {13771return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);13772}1377313774static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,13775vector bool short __b) {13776return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,13777(vector unsigned short)__b);13778}1377913780static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,13781vector short __b) {13782return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,13783(vector unsigned short)__b);13784}1378513786static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,13787vector unsigned short __b) {13788return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,13789__b);13790}1379113792static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,13793vector bool short __b) {13794return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,13795(vector unsigned short)__b);13796}1379713798static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {13799return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);13800}1380113802static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,13803vector bool int __b) {13804return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);13805}1380613807static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,13808vector unsigned int __b) {13809return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);13810}1381113812static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,13813vector bool int __b) {13814return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,13815(vector unsigned int)__b);13816}1381713818static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,13819vector int __b) {13820return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,13821(vector unsigned int)__b);13822}1382313824static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,13825vector unsigned int __b) {13826return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,13827__b);13828}1382913830static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,13831vector bool int __b) {13832return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,13833(vector unsigned int)__b);13834}1383513836#ifdef __POWER8_VECTOR__13837static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,13838vector signed long long __b) {13839return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);13840}1384113842static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,13843vector unsigned long long __b) {13844return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);13845}1384613847static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,13848vector bool long long __b) {13849return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,13850(vector signed long long)__b);13851}1385213853static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,13854vector bool long long __b) {13855return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,13856(vector unsigned long long)__b);13857}1385813859static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,13860vector signed long long __b) {13861return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13862(vector unsigned long long)__a,13863(vector unsigned long long)__b);13864}1386513866static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,13867vector unsigned long long __b) {13868return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13869(vector unsigned long long)__a, __b);13870}1387113872static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,13873vector bool long long __b) {13874return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,13875(vector unsigned long long)__a,13876(vector unsigned long long)__b);13877}13878#endif1387913880static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,13881vector float __b) {13882#ifdef __VSX__13883return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);13884#else13885return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);13886#endif13887}1388813889#ifdef __VSX__13890static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,13891vector double __b) {13892return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);13893}13894#endif1389513896/* vec_any_lt */1389713898static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,13899vector signed char __b) {13900return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);13901}1390213903static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,13904vector bool char __b) {13905return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,13906__a);13907}1390813909static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,13910vector unsigned char __b) {13911return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);13912}1391313914static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,13915vector bool char __b) {13916return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,13917__a);13918}1391913920static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,13921vector signed char __b) {13922return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,13923(vector unsigned char)__a);13924}1392513926static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,13927vector unsigned char __b) {13928return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,13929(vector unsigned char)__a);13930}1393113932static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,13933vector bool char __b) {13934return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,13935(vector unsigned char)__a);13936}1393713938static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,13939vector short __b) {13940return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);13941}1394213943static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,13944vector bool short __b) {13945return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);13946}1394713948static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,13949vector unsigned short __b) {13950return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);13951}1395213953static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,13954vector bool short __b) {13955return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,13956__a);13957}1395813959static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,13960vector short __b) {13961return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,13962(vector unsigned short)__a);13963}1396413965static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,13966vector unsigned short __b) {13967return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,13968(vector unsigned short)__a);13969}1397013971static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,13972vector bool short __b) {13973return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,13974(vector unsigned short)__a);13975}1397613977static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {13978return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);13979}1398013981static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,13982vector bool int __b) {13983return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);13984}1398513986static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,13987vector unsigned int __b) {13988return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);13989}1399013991static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,13992vector bool int __b) {13993return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,13994__a);13995}1399613997static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,13998vector int __b) {13999return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,14000(vector unsigned int)__a);14001}1400214003static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,14004vector unsigned int __b) {14005return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,14006(vector unsigned int)__a);14007}1400814009static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,14010vector bool int __b) {14011return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,14012(vector unsigned int)__a);14013}1401414015#ifdef __POWER8_VECTOR__14016static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,14017vector signed long long __b) {14018return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);14019}1402014021static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,14022vector unsigned long long __b) {14023return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);14024}1402514026static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,14027vector bool long long __b) {14028return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,14029(vector signed long long)__b, __a);14030}1403114032static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,14033vector bool long long __b) {14034return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,14035(vector unsigned long long)__b, __a);14036}1403714038static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,14039vector signed long long __b) {14040return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,14041(vector unsigned long long)__b,14042(vector unsigned long long)__a);14043}1404414045static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,14046vector unsigned long long __b) {14047return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,14048(vector unsigned long long)__a);14049}1405014051static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,14052vector bool long long __b) {14053return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,14054(vector unsigned long long)__b,14055(vector unsigned long long)__a);14056}14057#endif1405814059static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,14060vector float __b) {14061#ifdef __VSX__14062return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);14063#else14064return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);14065#endif14066}1406714068#ifdef __VSX__14069static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,14070vector double __b) {14071return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);14072}14073#endif1407414075/* vec_any_nan */1407614077static __inline__ int __attribute__((__always_inline__))14078vec_any_nan(vector float __a) {14079return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);14080}1408114082/* vec_any_ne */1408314084static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,14085vector signed char __b) {14086return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14087(vector char)__b);14088}1408914090static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,14091vector bool char __b) {14092return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14093(vector char)__b);14094}1409514096static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,14097vector unsigned char __b) {14098return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14099(vector char)__b);14100}1410114102static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,14103vector bool char __b) {14104return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14105(vector char)__b);14106}1410714108static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,14109vector signed char __b) {14110return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14111(vector char)__b);14112}1411314114static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,14115vector unsigned char __b) {14116return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14117(vector char)__b);14118}1411914120static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,14121vector bool char __b) {14122return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,14123(vector char)__b);14124}1412514126static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,14127vector short __b) {14128return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);14129}1413014131static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,14132vector bool short __b) {14133return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);14134}1413514136static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,14137vector unsigned short __b) {14138return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14139(vector short)__b);14140}1414114142static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,14143vector bool short __b) {14144return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14145(vector short)__b);14146}1414714148static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,14149vector short __b) {14150return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14151(vector short)__b);14152}1415314154static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,14155vector unsigned short __b) {14156return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14157(vector short)__b);14158}1415914160static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,14161vector bool short __b) {14162return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14163(vector short)__b);14164}1416514166static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,14167vector pixel __b) {14168return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,14169(vector short)__b);14170}1417114172static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {14173return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);14174}1417514176static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,14177vector bool int __b) {14178return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);14179}1418014181static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,14182vector unsigned int __b) {14183return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,14184(vector int)__b);14185}1418614187static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,14188vector bool int __b) {14189return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,14190(vector int)__b);14191}1419214193static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,14194vector int __b) {14195return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,14196(vector int)__b);14197}1419814199static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,14200vector unsigned int __b) {14201return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,14202(vector int)__b);14203}1420414205static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,14206vector bool int __b) {14207return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,14208(vector int)__b);14209}1421014211#ifdef __POWER8_VECTOR__14212static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,14213vector signed long long __b) {14214return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);14215}1421614217static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,14218vector unsigned long long __b) {14219return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, (vector long long)__a,14220(vector long long)__b);14221}1422214223static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,14224vector bool long long __b) {14225return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a,14226(vector signed long long)__b);14227}1422814229static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,14230vector bool long long __b) {14231return __builtin_altivec_vcmpequd_p(14232__CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);14233}1423414235static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,14236vector signed long long __b) {14237return __builtin_altivec_vcmpequd_p(14238__CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);14239}1424014241static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,14242vector unsigned long long __b) {14243return __builtin_altivec_vcmpequd_p(14244__CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);14245}1424614247static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,14248vector bool long long __b) {14249return __builtin_altivec_vcmpequd_p(14250__CR6_LT_REV, (vector signed long long)__a, (vector signed long long)__b);14251}14252#endif1425314254static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,14255vector float __b) {14256#ifdef __VSX__14257return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);14258#else14259return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);14260#endif14261}1426214263#ifdef __VSX__14264static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,14265vector double __b) {14266return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);14267}14268#endif1426914270/* vec_any_nge */1427114272static __inline__ int __attribute__((__always_inline__))14273vec_any_nge(vector float __a, vector float __b) {14274return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);14275}1427614277/* vec_any_ngt */1427814279static __inline__ int __attribute__((__always_inline__))14280vec_any_ngt(vector float __a, vector float __b) {14281return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);14282}1428314284/* vec_any_nle */1428514286static __inline__ int __attribute__((__always_inline__))14287vec_any_nle(vector float __a, vector float __b) {14288return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);14289}1429014291/* vec_any_nlt */1429214293static __inline__ int __attribute__((__always_inline__))14294vec_any_nlt(vector float __a, vector float __b) {14295return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);14296}1429714298/* vec_any_numeric */1429914300static __inline__ int __attribute__((__always_inline__))14301vec_any_numeric(vector float __a) {14302return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);14303}1430414305/* vec_any_out */1430614307static __inline__ int __attribute__((__always_inline__))14308vec_any_out(vector float __a, vector float __b) {14309return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);14310}1431114312/* Power 8 Crypto functions14313Note: We diverge from the current GCC implementation with regard14314to cryptography and related functions as follows:14315- Only the SHA and AES instructions and builtins are disabled by -mno-crypto14316- The remaining ones are only available on Power8 and up so14317require -mpower8-vector14318The justification for this is that export requirements require that14319Category:Vector.Crypto is optional (i.e. compliant hardware may not provide14320support). As a result, we need to be able to turn off support for those.14321The remaining ones (currently controlled by -mcrypto for GCC) still14322need to be provided on compliant hardware even if Vector.Crypto is not14323provided.14324*/14325#ifdef __CRYPTO__14326#define vec_sbox_be __builtin_altivec_crypto_vsbox14327#define vec_cipher_be __builtin_altivec_crypto_vcipher14328#define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast14329#define vec_ncipher_be __builtin_altivec_crypto_vncipher14330#define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast1433114332static __inline__ vector unsigned long long __attribute__((__always_inline__))14333__builtin_crypto_vsbox(vector unsigned long long __a) {14334return __builtin_altivec_crypto_vsbox(__a);14335}1433614337static __inline__ vector unsigned long long __attribute__((__always_inline__))14338__builtin_crypto_vcipher(vector unsigned long long __a,14339vector unsigned long long __b) {14340return __builtin_altivec_crypto_vcipher(__a, __b);14341}1434214343static __inline__ vector unsigned long long __attribute__((__always_inline__))14344__builtin_crypto_vcipherlast(vector unsigned long long __a,14345vector unsigned long long __b) {14346return __builtin_altivec_crypto_vcipherlast(__a, __b);14347}1434814349static __inline__ vector unsigned long long __attribute__((__always_inline__))14350__builtin_crypto_vncipher(vector unsigned long long __a,14351vector unsigned long long __b) {14352return __builtin_altivec_crypto_vncipher(__a, __b);14353}1435414355static __inline__ vector unsigned long long __attribute__((__always_inline__))14356__builtin_crypto_vncipherlast(vector unsigned long long __a,14357vector unsigned long long __b) {14358return __builtin_altivec_crypto_vncipherlast(__a, __b);14359}1436014361#define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad14362#define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw1436314364#define vec_shasigma_be(X, Y, Z) \14365_Generic((X), vector unsigned int \14366: __builtin_crypto_vshasigmaw, vector unsigned long long \14367: __builtin_crypto_vshasigmad)((X), (Y), (Z))14368#endif1436914370#ifdef __POWER8_VECTOR__14371static __inline__ vector unsigned char __ATTRS_o_ai14372__builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,14373vector unsigned char __c) {14374return __builtin_altivec_crypto_vpermxor(__a, __b, __c);14375}1437614377static __inline__ vector unsigned short __ATTRS_o_ai14378__builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,14379vector unsigned short __c) {14380return (vector unsigned short)__builtin_altivec_crypto_vpermxor(14381(vector unsigned char)__a, (vector unsigned char)__b,14382(vector unsigned char)__c);14383}1438414385static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(14386vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {14387return (vector unsigned int)__builtin_altivec_crypto_vpermxor(14388(vector unsigned char)__a, (vector unsigned char)__b,14389(vector unsigned char)__c);14390}1439114392static __inline__ vector unsigned long long __ATTRS_o_ai14393__builtin_crypto_vpermxor(vector unsigned long long __a,14394vector unsigned long long __b,14395vector unsigned long long __c) {14396return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(14397(vector unsigned char)__a, (vector unsigned char)__b,14398(vector unsigned char)__c);14399}1440014401static __inline__ vector unsigned char __ATTRS_o_ai14402__builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {14403return __builtin_altivec_crypto_vpmsumb(__a, __b);14404}1440514406static __inline__ vector unsigned short __ATTRS_o_ai14407__builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {14408return __builtin_altivec_crypto_vpmsumh(__a, __b);14409}1441014411static __inline__ vector unsigned int __ATTRS_o_ai14412__builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {14413return __builtin_altivec_crypto_vpmsumw(__a, __b);14414}1441514416static __inline__ vector unsigned long long __ATTRS_o_ai14417__builtin_crypto_vpmsumb(vector unsigned long long __a,14418vector unsigned long long __b) {14419return __builtin_altivec_crypto_vpmsumd(__a, __b);14420}1442114422static __inline__ vector signed char __ATTRS_o_ai14423vec_vgbbd(vector signed char __a) {14424return __builtin_altivec_vgbbd((vector unsigned char)__a);14425}1442614427#define vec_pmsum_be __builtin_crypto_vpmsumb14428#define vec_gb __builtin_altivec_vgbbd1442914430static __inline__ vector unsigned char __ATTRS_o_ai14431vec_vgbbd(vector unsigned char __a) {14432return __builtin_altivec_vgbbd(__a);14433}1443414435static __inline__ vector long long __ATTRS_o_ai14436vec_vbpermq(vector signed char __a, vector signed char __b) {14437return __builtin_altivec_vbpermq((vector unsigned char)__a,14438(vector unsigned char)__b);14439}1444014441static __inline__ vector long long __ATTRS_o_ai14442vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {14443return __builtin_altivec_vbpermq(__a, __b);14444}1444514446#ifdef __powerpc64__14447static __inline__ vector unsigned long long __attribute__((__always_inline__))14448vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {14449return __builtin_altivec_vbpermq((vector unsigned char)__a,14450(vector unsigned char)__b);14451}14452#endif14453#endif1445414455#undef __ATTRS_o_ai1445614457#endif /* __ALTIVEC_H */144581445914460