Path: blob/main/contrib/llvm-project/clang/lib/Headers/altivec.h
109934 views
/*===---- altivec.h - Standard header for type generic math ---------------===*\1*2* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3* See https://llvm.org/LICENSE.txt for license information.4* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5*6\*===----------------------------------------------------------------------===*/78#ifndef __ALTIVEC_H9#define __ALTIVEC_H1011#ifndef __ALTIVEC__12#error "AltiVec support not enabled"13#endif1415/* Constants for mapping CR6 bits to predicate result. */1617#define __CR6_EQ 018#define __CR6_EQ_REV 119#define __CR6_LT 220#define __CR6_LT_REV 321#define __CR6_GT 422#define __CR6_GT_REV 523#define __CR6_SO 624#define __CR6_SO_REV 72526/* Constants for vec_test_data_class */27#define __VEC_CLASS_FP_SUBNORMAL_N (1 << 0)28#define __VEC_CLASS_FP_SUBNORMAL_P (1 << 1)29#define __VEC_CLASS_FP_SUBNORMAL (__VEC_CLASS_FP_SUBNORMAL_P | \30__VEC_CLASS_FP_SUBNORMAL_N)31#define __VEC_CLASS_FP_ZERO_N (1<<2)32#define __VEC_CLASS_FP_ZERO_P (1<<3)33#define __VEC_CLASS_FP_ZERO (__VEC_CLASS_FP_ZERO_P | \34__VEC_CLASS_FP_ZERO_N)35#define __VEC_CLASS_FP_INFINITY_N (1<<4)36#define __VEC_CLASS_FP_INFINITY_P (1<<5)37#define __VEC_CLASS_FP_INFINITY (__VEC_CLASS_FP_INFINITY_P | \38__VEC_CLASS_FP_INFINITY_N)39#define __VEC_CLASS_FP_NAN (1<<6)40#define __VEC_CLASS_FP_NOT_NORMAL (__VEC_CLASS_FP_NAN | \41__VEC_CLASS_FP_SUBNORMAL | \42__VEC_CLASS_FP_ZERO | \43__VEC_CLASS_FP_INFINITY)4445#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))4647#include <stddef.h>4849static __inline__ vector signed char __ATTRS_o_ai vec_perm(50vector signed char __a, vector signed char __b, vector unsigned char __c);5152static __inline__ vector unsigned char __ATTRS_o_ai53vec_perm(vector unsigned char __a, vector unsigned char __b,54vector unsigned char __c);5556static __inline__ vector bool char __ATTRS_o_ai57vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c);5859static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,60vector signed short __b,61vector unsigned char __c);6263static __inline__ vector unsigned short __ATTRS_o_ai64vec_perm(vector unsigned short __a, vector unsigned short __b,65vector unsigned char __c);6667static __inline__ vector bool short __ATTRS_o_ai vec_perm(68vector bool short __a, vector bool short __b, vector unsigned char __c);6970static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,71vector pixel __b,72vector unsigned char __c);7374static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,75vector signed int __b,76vector unsigned char __c);7778static __inline__ vector unsigned int __ATTRS_o_ai vec_perm(79vector unsigned int __a, vector unsigned int __b, vector unsigned char __c);8081static __inline__ vector bool int __ATTRS_o_ai82vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c);8384static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,85vector float __b,86vector unsigned char __c);8788#ifdef __VSX__89static __inline__ vector long long __ATTRS_o_ai90vec_perm(vector signed long long __a, vector signed long long __b,91vector unsigned char __c);9293static __inline__ vector unsigned long long __ATTRS_o_ai94vec_perm(vector unsigned long long __a, vector unsigned long long __b,95vector unsigned char __c);9697static __inline__ vector bool long long __ATTRS_o_ai98vec_perm(vector bool long long __a, vector bool long long __b,99vector unsigned char __c);100101static __inline__ vector double __ATTRS_o_ai vec_perm(vector double __a,102vector double __b,103vector unsigned char __c);104#endif105106static __inline__ vector unsigned char __ATTRS_o_ai107vec_xor(vector unsigned char __a, vector unsigned char __b);108109/* vec_abs */110111#define __builtin_altivec_abs_v16qi vec_abs112#define __builtin_altivec_abs_v8hi vec_abs113#define __builtin_altivec_abs_v4si vec_abs114115static __inline__ vector signed char __ATTRS_o_ai116vec_abs(vector signed char __a) {117return __builtin_altivec_vmaxsb(__a, -__a);118}119120static __inline__ vector signed short __ATTRS_o_ai121vec_abs(vector signed short __a) {122return __builtin_altivec_vmaxsh(__a, -__a);123}124125static __inline__ vector signed int __ATTRS_o_ai126vec_abs(vector signed int __a) {127return __builtin_altivec_vmaxsw(__a, -__a);128}129130#ifdef __POWER8_VECTOR__131static __inline__ vector signed long long __ATTRS_o_ai132vec_abs(vector signed long long __a) {133return __builtin_altivec_vmaxsd(__a, -__a);134}135#endif136137static __inline__ vector float __ATTRS_o_ai vec_abs(vector float __a) {138#ifdef __VSX__139return __builtin_vsx_xvabssp(__a);140#else141vector unsigned int __res =142(vector unsigned int)__a & (vector unsigned int)(0x7FFFFFFF);143return (vector float)__res;144#endif145}146147#ifdef __VSX__148static __inline__ vector double __ATTRS_o_ai vec_abs(vector double __a) {149return __builtin_vsx_xvabsdp(__a);150}151#endif152153/* vec_abss */154#define __builtin_altivec_abss_v16qi vec_abss155#define __builtin_altivec_abss_v8hi vec_abss156#define __builtin_altivec_abss_v4si vec_abss157158static __inline__ vector signed char __ATTRS_o_ai159vec_abss(vector signed char __a) {160return __builtin_altivec_vmaxsb(161__a, __builtin_altivec_vsubsbs((vector signed char)(0), __a));162}163164static __inline__ vector signed short __ATTRS_o_ai165vec_abss(vector signed short __a) {166return __builtin_altivec_vmaxsh(167__a, __builtin_altivec_vsubshs((vector signed short)(0), __a));168}169170static __inline__ vector signed int __ATTRS_o_ai171vec_abss(vector signed int __a) {172return __builtin_altivec_vmaxsw(173__a, __builtin_altivec_vsubsws((vector signed int)(0), __a));174}175176/* vec_absd */177#if defined(__POWER9_VECTOR__)178179static __inline__ vector unsigned char __ATTRS_o_ai180vec_absd(vector unsigned char __a, vector unsigned char __b) {181return __builtin_altivec_vabsdub(__a, __b);182}183184static __inline__ vector unsigned short __ATTRS_o_ai185vec_absd(vector unsigned short __a, vector unsigned short __b) {186return __builtin_altivec_vabsduh(__a, __b);187}188189static __inline__ vector unsigned int __ATTRS_o_ai190vec_absd(vector unsigned int __a, vector unsigned int __b) {191return __builtin_altivec_vabsduw(__a, __b);192}193194#endif /* End __POWER9_VECTOR__ */195196/* vec_add */197198static __inline__ vector signed char __ATTRS_o_ai199vec_add(vector signed char __a, vector signed char __b) {200return __a + __b;201}202203static __inline__ vector signed char __ATTRS_o_ai204vec_add(vector bool char __a, vector signed char __b) {205return (vector signed char)__a + __b;206}207208static __inline__ vector signed char __ATTRS_o_ai209vec_add(vector signed char __a, vector bool char __b) {210return __a + (vector signed char)__b;211}212213static __inline__ vector unsigned char __ATTRS_o_ai214vec_add(vector unsigned char __a, vector unsigned char __b) {215return __a + __b;216}217218static __inline__ vector unsigned char __ATTRS_o_ai219vec_add(vector bool char __a, vector unsigned char __b) {220return (vector unsigned char)__a + __b;221}222223static __inline__ vector unsigned char __ATTRS_o_ai224vec_add(vector unsigned char __a, vector bool char __b) {225return __a + (vector unsigned char)__b;226}227228static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,229vector short __b) {230return __a + __b;231}232233static __inline__ vector short __ATTRS_o_ai vec_add(vector bool short __a,234vector short __b) {235return (vector short)__a + __b;236}237238static __inline__ vector short __ATTRS_o_ai vec_add(vector short __a,239vector bool short __b) {240return __a + (vector short)__b;241}242243static __inline__ vector unsigned short __ATTRS_o_ai244vec_add(vector unsigned short __a, vector unsigned short __b) {245return __a + __b;246}247248static __inline__ vector unsigned short __ATTRS_o_ai249vec_add(vector bool short __a, vector unsigned short __b) {250return (vector unsigned short)__a + __b;251}252253static __inline__ vector unsigned short __ATTRS_o_ai254vec_add(vector unsigned short __a, vector bool short __b) {255return __a + (vector unsigned short)__b;256}257258static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,259vector int __b) {260return __a + __b;261}262263static __inline__ vector int __ATTRS_o_ai vec_add(vector bool int __a,264vector int __b) {265return (vector int)__a + __b;266}267268static __inline__ vector int __ATTRS_o_ai vec_add(vector int __a,269vector bool int __b) {270return __a + (vector int)__b;271}272273static __inline__ vector unsigned int __ATTRS_o_ai274vec_add(vector unsigned int __a, vector unsigned int __b) {275return __a + __b;276}277278static __inline__ vector unsigned int __ATTRS_o_ai279vec_add(vector bool int __a, vector unsigned int __b) {280return (vector unsigned int)__a + __b;281}282283static __inline__ vector unsigned int __ATTRS_o_ai284vec_add(vector unsigned int __a, vector bool int __b) {285return __a + (vector unsigned int)__b;286}287288#ifdef __POWER8_VECTOR__289static __inline__ vector signed long long __ATTRS_o_ai290vec_add(vector signed long long __a, vector signed long long __b) {291return __a + __b;292}293294static __inline__ vector unsigned long long __ATTRS_o_ai295vec_add(vector unsigned long long __a, vector unsigned long long __b) {296return __a + __b;297}298299#ifdef __SIZEOF_INT128__300static __inline__ vector signed __int128 __ATTRS_o_ai301vec_add(vector signed __int128 __a, vector signed __int128 __b) {302return __a + __b;303}304305static __inline__ vector unsigned __int128 __ATTRS_o_ai306vec_add(vector unsigned __int128 __a, vector unsigned __int128 __b) {307return __a + __b;308}309#endif310311static __inline__ vector unsigned char __attribute__((__always_inline__))312vec_add_u128(vector unsigned char __a, vector unsigned char __b) {313return (vector unsigned char)__builtin_altivec_vadduqm(__a, __b);314}315#elif defined(__VSX__)316static __inline__ vector signed long long __ATTRS_o_ai317vec_add(vector signed long long __a, vector signed long long __b) {318#ifdef __LITTLE_ENDIAN__319// Little endian systems on CPU's prior to Power8 don't really exist320// so scalarizing is fine.321return __a + __b;322#else323vector unsigned int __res =324(vector unsigned int)__a + (vector unsigned int)__b;325vector unsigned int __carry = __builtin_altivec_vaddcuw(326(vector unsigned int)__a, (vector unsigned int)__b);327__carry = (vector unsigned int)__builtin_shufflevector(328(vector unsigned char)__carry, (vector unsigned char)__carry, 0, 0, 0, 7,3290, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0);330return (vector signed long long)(__res + __carry);331#endif332}333334static __inline__ vector unsigned long long __ATTRS_o_ai335vec_add(vector unsigned long long __a, vector unsigned long long __b) {336return (vector unsigned long long)vec_add((vector signed long long)__a,337(vector signed long long)__b);338}339#endif // __POWER8_VECTOR__340341static __inline__ vector float __ATTRS_o_ai vec_add(vector float __a,342vector float __b) {343return __a + __b;344}345346#ifdef __VSX__347static __inline__ vector double __ATTRS_o_ai vec_add(vector double __a,348vector double __b) {349return __a + __b;350}351#endif // __VSX__352353/* vec_adde */354355#ifdef __POWER8_VECTOR__356#ifdef __SIZEOF_INT128__357static __inline__ vector signed __int128 __ATTRS_o_ai358vec_adde(vector signed __int128 __a, vector signed __int128 __b,359vector signed __int128 __c) {360return (vector signed __int128)__builtin_altivec_vaddeuqm(361(vector unsigned __int128)__a, (vector unsigned __int128)__b,362(vector unsigned __int128)__c);363}364365static __inline__ vector unsigned __int128 __ATTRS_o_ai366vec_adde(vector unsigned __int128 __a, vector unsigned __int128 __b,367vector unsigned __int128 __c) {368return __builtin_altivec_vaddeuqm(__a, __b, __c);369}370#endif371372static __inline__ vector unsigned char __attribute__((__always_inline__))373vec_adde_u128(vector unsigned char __a, vector unsigned char __b,374vector unsigned char __c) {375return (vector unsigned char)__builtin_altivec_vaddeuqm_c(376(vector unsigned char)__a, (vector unsigned char)__b,377(vector unsigned char)__c);378}379#endif380381static __inline__ vector signed int __ATTRS_o_ai382vec_adde(vector signed int __a, vector signed int __b,383vector signed int __c) {384vector signed int __mask = {1, 1, 1, 1};385vector signed int __carry = __c & __mask;386return vec_add(vec_add(__a, __b), __carry);387}388389static __inline__ vector unsigned int __ATTRS_o_ai390vec_adde(vector unsigned int __a, vector unsigned int __b,391vector unsigned int __c) {392vector unsigned int __mask = {1, 1, 1, 1};393vector unsigned int __carry = __c & __mask;394return vec_add(vec_add(__a, __b), __carry);395}396397/* vec_addec */398399#ifdef __POWER8_VECTOR__400#ifdef __SIZEOF_INT128__401static __inline__ vector signed __int128 __ATTRS_o_ai402vec_addec(vector signed __int128 __a, vector signed __int128 __b,403vector signed __int128 __c) {404return (vector signed __int128)__builtin_altivec_vaddecuq(405(vector unsigned __int128)__a, (vector unsigned __int128)__b,406(vector unsigned __int128)__c);407}408409static __inline__ vector unsigned __int128 __ATTRS_o_ai410vec_addec(vector unsigned __int128 __a, vector unsigned __int128 __b,411vector unsigned __int128 __c) {412return __builtin_altivec_vaddecuq(__a, __b, __c);413}414#endif415416static __inline__ vector unsigned char __attribute__((__always_inline__))417vec_addec_u128(vector unsigned char __a, vector unsigned char __b,418vector unsigned char __c) {419return (vector unsigned char)__builtin_altivec_vaddecuq_c(420(vector unsigned char)__a, (vector unsigned char)__b,421(vector unsigned char)__c);422}423424#ifdef __powerpc64__425static __inline__ vector signed int __ATTRS_o_ai426vec_addec(vector signed int __a, vector signed int __b,427vector signed int __c) {428429signed int __result[4];430for (int i = 0; i < 4; i++) {431unsigned int __tempa = (unsigned int) __a[i];432unsigned int __tempb = (unsigned int) __b[i];433unsigned int __tempc = (unsigned int) __c[i];434__tempc = __tempc & 0x00000001;435unsigned long long __longa = (unsigned long long) __tempa;436unsigned long long __longb = (unsigned long long) __tempb;437unsigned long long __longc = (unsigned long long) __tempc;438unsigned long long __sum = __longa + __longb + __longc;439unsigned long long __res = (__sum >> 32) & 0x01;440unsigned long long __tempres = (unsigned int) __res;441__result[i] = (signed int) __tempres;442}443444vector signed int ret = { __result[0], __result[1], __result[2], __result[3] };445return ret;446}447448static __inline__ vector unsigned int __ATTRS_o_ai449vec_addec(vector unsigned int __a, vector unsigned int __b,450vector unsigned int __c) {451452unsigned int __result[4];453for (int i = 0; i < 4; i++) {454unsigned int __tempc = __c[i] & 1;455unsigned long long __longa = (unsigned long long) __a[i];456unsigned long long __longb = (unsigned long long) __b[i];457unsigned long long __longc = (unsigned long long) __tempc;458unsigned long long __sum = __longa + __longb + __longc;459unsigned long long __res = (__sum >> 32) & 0x01;460unsigned long long __tempres = (unsigned int) __res;461__result[i] = (signed int) __tempres;462}463464vector unsigned int ret = { __result[0], __result[1], __result[2], __result[3] };465return ret;466}467#endif // __powerpc64__468#endif // __POWER8_VECTOR__469470/* vec_vaddubm */471472#define __builtin_altivec_vaddubm vec_vaddubm473474static __inline__ vector signed char __ATTRS_o_ai475vec_vaddubm(vector signed char __a, vector signed char __b) {476return __a + __b;477}478479static __inline__ vector signed char __ATTRS_o_ai480vec_vaddubm(vector bool char __a, vector signed char __b) {481return (vector signed char)__a + __b;482}483484static __inline__ vector signed char __ATTRS_o_ai485vec_vaddubm(vector signed char __a, vector bool char __b) {486return __a + (vector signed char)__b;487}488489static __inline__ vector unsigned char __ATTRS_o_ai490vec_vaddubm(vector unsigned char __a, vector unsigned char __b) {491return __a + __b;492}493494static __inline__ vector unsigned char __ATTRS_o_ai495vec_vaddubm(vector bool char __a, vector unsigned char __b) {496return (vector unsigned char)__a + __b;497}498499static __inline__ vector unsigned char __ATTRS_o_ai500vec_vaddubm(vector unsigned char __a, vector bool char __b) {501return __a + (vector unsigned char)__b;502}503504/* vec_vadduhm */505506#define __builtin_altivec_vadduhm vec_vadduhm507508static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,509vector short __b) {510return __a + __b;511}512513static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector bool short __a,514vector short __b) {515return (vector short)__a + __b;516}517518static __inline__ vector short __ATTRS_o_ai vec_vadduhm(vector short __a,519vector bool short __b) {520return __a + (vector short)__b;521}522523static __inline__ vector unsigned short __ATTRS_o_ai524vec_vadduhm(vector unsigned short __a, vector unsigned short __b) {525return __a + __b;526}527528static __inline__ vector unsigned short __ATTRS_o_ai529vec_vadduhm(vector bool short __a, vector unsigned short __b) {530return (vector unsigned short)__a + __b;531}532533static __inline__ vector unsigned short __ATTRS_o_ai534vec_vadduhm(vector unsigned short __a, vector bool short __b) {535return __a + (vector unsigned short)__b;536}537538/* vec_vadduwm */539540#define __builtin_altivec_vadduwm vec_vadduwm541542static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,543vector int __b) {544return __a + __b;545}546547static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector bool int __a,548vector int __b) {549return (vector int)__a + __b;550}551552static __inline__ vector int __ATTRS_o_ai vec_vadduwm(vector int __a,553vector bool int __b) {554return __a + (vector int)__b;555}556557static __inline__ vector unsigned int __ATTRS_o_ai558vec_vadduwm(vector unsigned int __a, vector unsigned int __b) {559return __a + __b;560}561562static __inline__ vector unsigned int __ATTRS_o_ai563vec_vadduwm(vector bool int __a, vector unsigned int __b) {564return (vector unsigned int)__a + __b;565}566567static __inline__ vector unsigned int __ATTRS_o_ai568vec_vadduwm(vector unsigned int __a, vector bool int __b) {569return __a + (vector unsigned int)__b;570}571572/* vec_vaddfp */573574#define __builtin_altivec_vaddfp vec_vaddfp575576static __inline__ vector float __attribute__((__always_inline__))577vec_vaddfp(vector float __a, vector float __b) {578return __a + __b;579}580581/* vec_addc */582583static __inline__ vector signed int __ATTRS_o_ai584vec_addc(vector signed int __a, vector signed int __b) {585return (vector signed int)__builtin_altivec_vaddcuw((vector unsigned int)__a,586(vector unsigned int)__b);587}588589static __inline__ vector unsigned int __ATTRS_o_ai590vec_addc(vector unsigned int __a, vector unsigned int __b) {591return __builtin_altivec_vaddcuw(__a, __b);592}593594#ifdef __POWER8_VECTOR__595#ifdef __SIZEOF_INT128__596static __inline__ vector signed __int128 __ATTRS_o_ai597vec_addc(vector signed __int128 __a, vector signed __int128 __b) {598return (vector signed __int128)__builtin_altivec_vaddcuq(599(vector unsigned __int128)__a, (vector unsigned __int128)__b);600}601602static __inline__ vector unsigned __int128 __ATTRS_o_ai603vec_addc(vector unsigned __int128 __a, vector unsigned __int128 __b) {604return __builtin_altivec_vaddcuq(__a, __b);605}606#endif607608static __inline__ vector unsigned char __attribute__((__always_inline__))609vec_addc_u128(vector unsigned char __a, vector unsigned char __b) {610return (vector unsigned char)__builtin_altivec_vaddcuq_c(611(vector unsigned char)__a, (vector unsigned char)__b);612}613#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)614615/* vec_vaddcuw */616617static __inline__ vector unsigned int __attribute__((__always_inline__))618vec_vaddcuw(vector unsigned int __a, vector unsigned int __b) {619return __builtin_altivec_vaddcuw(__a, __b);620}621622/* vec_adds */623624static __inline__ vector signed char __ATTRS_o_ai625vec_adds(vector signed char __a, vector signed char __b) {626return __builtin_altivec_vaddsbs(__a, __b);627}628629static __inline__ vector signed char __ATTRS_o_ai630vec_adds(vector bool char __a, vector signed char __b) {631return __builtin_altivec_vaddsbs((vector signed char)__a, __b);632}633634static __inline__ vector signed char __ATTRS_o_ai635vec_adds(vector signed char __a, vector bool char __b) {636return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);637}638639static __inline__ vector unsigned char __ATTRS_o_ai640vec_adds(vector unsigned char __a, vector unsigned char __b) {641return __builtin_altivec_vaddubs(__a, __b);642}643644static __inline__ vector unsigned char __ATTRS_o_ai645vec_adds(vector bool char __a, vector unsigned char __b) {646return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);647}648649static __inline__ vector unsigned char __ATTRS_o_ai650vec_adds(vector unsigned char __a, vector bool char __b) {651return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);652}653654static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,655vector short __b) {656return __builtin_altivec_vaddshs(__a, __b);657}658659static __inline__ vector short __ATTRS_o_ai vec_adds(vector bool short __a,660vector short __b) {661return __builtin_altivec_vaddshs((vector short)__a, __b);662}663664static __inline__ vector short __ATTRS_o_ai vec_adds(vector short __a,665vector bool short __b) {666return __builtin_altivec_vaddshs(__a, (vector short)__b);667}668669static __inline__ vector unsigned short __ATTRS_o_ai670vec_adds(vector unsigned short __a, vector unsigned short __b) {671return __builtin_altivec_vadduhs(__a, __b);672}673674static __inline__ vector unsigned short __ATTRS_o_ai675vec_adds(vector bool short __a, vector unsigned short __b) {676return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);677}678679static __inline__ vector unsigned short __ATTRS_o_ai680vec_adds(vector unsigned short __a, vector bool short __b) {681return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);682}683684static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,685vector int __b) {686return __builtin_altivec_vaddsws(__a, __b);687}688689static __inline__ vector int __ATTRS_o_ai vec_adds(vector bool int __a,690vector int __b) {691return __builtin_altivec_vaddsws((vector int)__a, __b);692}693694static __inline__ vector int __ATTRS_o_ai vec_adds(vector int __a,695vector bool int __b) {696return __builtin_altivec_vaddsws(__a, (vector int)__b);697}698699static __inline__ vector unsigned int __ATTRS_o_ai700vec_adds(vector unsigned int __a, vector unsigned int __b) {701return __builtin_altivec_vadduws(__a, __b);702}703704static __inline__ vector unsigned int __ATTRS_o_ai705vec_adds(vector bool int __a, vector unsigned int __b) {706return __builtin_altivec_vadduws((vector unsigned int)__a, __b);707}708709static __inline__ vector unsigned int __ATTRS_o_ai710vec_adds(vector unsigned int __a, vector bool int __b) {711return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);712}713714/* vec_vaddsbs */715716static __inline__ vector signed char __ATTRS_o_ai717vec_vaddsbs(vector signed char __a, vector signed char __b) {718return __builtin_altivec_vaddsbs(__a, __b);719}720721static __inline__ vector signed char __ATTRS_o_ai722vec_vaddsbs(vector bool char __a, vector signed char __b) {723return __builtin_altivec_vaddsbs((vector signed char)__a, __b);724}725726static __inline__ vector signed char __ATTRS_o_ai727vec_vaddsbs(vector signed char __a, vector bool char __b) {728return __builtin_altivec_vaddsbs(__a, (vector signed char)__b);729}730731/* vec_vaddubs */732733static __inline__ vector unsigned char __ATTRS_o_ai734vec_vaddubs(vector unsigned char __a, vector unsigned char __b) {735return __builtin_altivec_vaddubs(__a, __b);736}737738static __inline__ vector unsigned char __ATTRS_o_ai739vec_vaddubs(vector bool char __a, vector unsigned char __b) {740return __builtin_altivec_vaddubs((vector unsigned char)__a, __b);741}742743static __inline__ vector unsigned char __ATTRS_o_ai744vec_vaddubs(vector unsigned char __a, vector bool char __b) {745return __builtin_altivec_vaddubs(__a, (vector unsigned char)__b);746}747748/* vec_vaddshs */749750static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,751vector short __b) {752return __builtin_altivec_vaddshs(__a, __b);753}754755static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector bool short __a,756vector short __b) {757return __builtin_altivec_vaddshs((vector short)__a, __b);758}759760static __inline__ vector short __ATTRS_o_ai vec_vaddshs(vector short __a,761vector bool short __b) {762return __builtin_altivec_vaddshs(__a, (vector short)__b);763}764765/* vec_vadduhs */766767static __inline__ vector unsigned short __ATTRS_o_ai768vec_vadduhs(vector unsigned short __a, vector unsigned short __b) {769return __builtin_altivec_vadduhs(__a, __b);770}771772static __inline__ vector unsigned short __ATTRS_o_ai773vec_vadduhs(vector bool short __a, vector unsigned short __b) {774return __builtin_altivec_vadduhs((vector unsigned short)__a, __b);775}776777static __inline__ vector unsigned short __ATTRS_o_ai778vec_vadduhs(vector unsigned short __a, vector bool short __b) {779return __builtin_altivec_vadduhs(__a, (vector unsigned short)__b);780}781782/* vec_vaddsws */783784static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,785vector int __b) {786return __builtin_altivec_vaddsws(__a, __b);787}788789static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector bool int __a,790vector int __b) {791return __builtin_altivec_vaddsws((vector int)__a, __b);792}793794static __inline__ vector int __ATTRS_o_ai vec_vaddsws(vector int __a,795vector bool int __b) {796return __builtin_altivec_vaddsws(__a, (vector int)__b);797}798799/* vec_vadduws */800801static __inline__ vector unsigned int __ATTRS_o_ai802vec_vadduws(vector unsigned int __a, vector unsigned int __b) {803return __builtin_altivec_vadduws(__a, __b);804}805806static __inline__ vector unsigned int __ATTRS_o_ai807vec_vadduws(vector bool int __a, vector unsigned int __b) {808return __builtin_altivec_vadduws((vector unsigned int)__a, __b);809}810811static __inline__ vector unsigned int __ATTRS_o_ai812vec_vadduws(vector unsigned int __a, vector bool int __b) {813return __builtin_altivec_vadduws(__a, (vector unsigned int)__b);814}815816#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \817defined(__SIZEOF_INT128__)818/* vec_vadduqm */819820static __inline__ vector signed __int128 __ATTRS_o_ai821vec_vadduqm(vector signed __int128 __a, vector signed __int128 __b) {822return __a + __b;823}824825static __inline__ vector unsigned __int128 __ATTRS_o_ai826vec_vadduqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {827return __a + __b;828}829830/* vec_vaddeuqm */831832static __inline__ vector signed __int128 __ATTRS_o_ai833vec_vaddeuqm(vector signed __int128 __a, vector signed __int128 __b,834vector signed __int128 __c) {835return (vector signed __int128)__builtin_altivec_vaddeuqm(836(vector unsigned __int128)__a, (vector unsigned __int128)__b,837(vector unsigned __int128)__c);838}839840static __inline__ vector unsigned __int128 __ATTRS_o_ai841vec_vaddeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,842vector unsigned __int128 __c) {843return __builtin_altivec_vaddeuqm(__a, __b, __c);844}845846/* vec_vaddcuq */847848static __inline__ vector signed __int128 __ATTRS_o_ai849vec_vaddcuq(vector signed __int128 __a, vector signed __int128 __b) {850return (vector signed __int128)__builtin_altivec_vaddcuq(851(vector unsigned __int128)__a, (vector unsigned __int128)__b);852}853854static __inline__ vector unsigned __int128 __ATTRS_o_ai855vec_vaddcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {856return __builtin_altivec_vaddcuq(__a, __b);857}858859/* vec_vaddecuq */860861static __inline__ vector signed __int128 __ATTRS_o_ai862vec_vaddecuq(vector signed __int128 __a, vector signed __int128 __b,863vector signed __int128 __c) {864return (vector signed __int128)__builtin_altivec_vaddecuq(865(vector unsigned __int128)__a, (vector unsigned __int128)__b,866(vector unsigned __int128)__c);867}868869static __inline__ vector unsigned __int128 __ATTRS_o_ai870vec_vaddecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,871vector unsigned __int128 __c) {872return __builtin_altivec_vaddecuq(__a, __b, __c);873}874#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__)875876/* vec_and */877878#define __builtin_altivec_vand vec_and879880static __inline__ vector signed char __ATTRS_o_ai881vec_and(vector signed char __a, vector signed char __b) {882return __a & __b;883}884885static __inline__ vector signed char __ATTRS_o_ai886vec_and(vector bool char __a, vector signed char __b) {887return (vector signed char)__a & __b;888}889890static __inline__ vector signed char __ATTRS_o_ai891vec_and(vector signed char __a, vector bool char __b) {892return __a & (vector signed char)__b;893}894895static __inline__ vector unsigned char __ATTRS_o_ai896vec_and(vector unsigned char __a, vector unsigned char __b) {897return __a & __b;898}899900static __inline__ vector unsigned char __ATTRS_o_ai901vec_and(vector bool char __a, vector unsigned char __b) {902return (vector unsigned char)__a & __b;903}904905static __inline__ vector unsigned char __ATTRS_o_ai906vec_and(vector unsigned char __a, vector bool char __b) {907return __a & (vector unsigned char)__b;908}909910static __inline__ vector bool char __ATTRS_o_ai vec_and(vector bool char __a,911vector bool char __b) {912return __a & __b;913}914915static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,916vector short __b) {917return __a & __b;918}919920static __inline__ vector short __ATTRS_o_ai vec_and(vector bool short __a,921vector short __b) {922return (vector short)__a & __b;923}924925static __inline__ vector short __ATTRS_o_ai vec_and(vector short __a,926vector bool short __b) {927return __a & (vector short)__b;928}929930static __inline__ vector unsigned short __ATTRS_o_ai931vec_and(vector unsigned short __a, vector unsigned short __b) {932return __a & __b;933}934935static __inline__ vector unsigned short __ATTRS_o_ai936vec_and(vector bool short __a, vector unsigned short __b) {937return (vector unsigned short)__a & __b;938}939940static __inline__ vector unsigned short __ATTRS_o_ai941vec_and(vector unsigned short __a, vector bool short __b) {942return __a & (vector unsigned short)__b;943}944945static __inline__ vector bool short __ATTRS_o_ai946vec_and(vector bool short __a, vector bool short __b) {947return __a & __b;948}949950static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,951vector int __b) {952return __a & __b;953}954955static __inline__ vector int __ATTRS_o_ai vec_and(vector bool int __a,956vector int __b) {957return (vector int)__a & __b;958}959960static __inline__ vector int __ATTRS_o_ai vec_and(vector int __a,961vector bool int __b) {962return __a & (vector int)__b;963}964965static __inline__ vector unsigned int __ATTRS_o_ai966vec_and(vector unsigned int __a, vector unsigned int __b) {967return __a & __b;968}969970static __inline__ vector unsigned int __ATTRS_o_ai971vec_and(vector bool int __a, vector unsigned int __b) {972return (vector unsigned int)__a & __b;973}974975static __inline__ vector unsigned int __ATTRS_o_ai976vec_and(vector unsigned int __a, vector bool int __b) {977return __a & (vector unsigned int)__b;978}979980static __inline__ vector bool int __ATTRS_o_ai vec_and(vector bool int __a,981vector bool int __b) {982return __a & __b;983}984985static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,986vector float __b) {987vector unsigned int __res =988(vector unsigned int)__a & (vector unsigned int)__b;989return (vector float)__res;990}991992static __inline__ vector float __ATTRS_o_ai vec_and(vector bool int __a,993vector float __b) {994vector unsigned int __res =995(vector unsigned int)__a & (vector unsigned int)__b;996return (vector float)__res;997}998999static __inline__ vector float __ATTRS_o_ai vec_and(vector float __a,1000vector bool int __b) {1001vector unsigned int __res =1002(vector unsigned int)__a & (vector unsigned int)__b;1003return (vector float)__res;1004}10051006#ifdef __VSX__1007static __inline__ vector double __ATTRS_o_ai vec_and(vector bool long long __a,1008vector double __b) {1009vector unsigned long long __res =1010(vector unsigned long long)__a & (vector unsigned long long)__b;1011return (vector double)__res;1012}10131014static __inline__ vector double __ATTRS_o_ai1015vec_and(vector double __a, vector bool long long __b) {1016vector unsigned long long __res =1017(vector unsigned long long)__a & (vector unsigned long long)__b;1018return (vector double)__res;1019}10201021static __inline__ vector double __ATTRS_o_ai vec_and(vector double __a,1022vector double __b) {1023vector unsigned long long __res =1024(vector unsigned long long)__a & (vector unsigned long long)__b;1025return (vector double)__res;1026}10271028static __inline__ vector signed long long __ATTRS_o_ai1029vec_and(vector signed long long __a, vector signed long long __b) {1030return __a & __b;1031}10321033static __inline__ vector signed long long __ATTRS_o_ai1034vec_and(vector bool long long __a, vector signed long long __b) {1035return (vector signed long long)__a & __b;1036}10371038static __inline__ vector signed long long __ATTRS_o_ai1039vec_and(vector signed long long __a, vector bool long long __b) {1040return __a & (vector signed long long)__b;1041}10421043static __inline__ vector unsigned long long __ATTRS_o_ai1044vec_and(vector unsigned long long __a, vector unsigned long long __b) {1045return __a & __b;1046}10471048static __inline__ vector unsigned long long __ATTRS_o_ai1049vec_and(vector bool long long __a, vector unsigned long long __b) {1050return (vector unsigned long long)__a & __b;1051}10521053static __inline__ vector unsigned long long __ATTRS_o_ai1054vec_and(vector unsigned long long __a, vector bool long long __b) {1055return __a & (vector unsigned long long)__b;1056}10571058static __inline__ vector bool long long __ATTRS_o_ai1059vec_and(vector bool long long __a, vector bool long long __b) {1060return __a & __b;1061}1062#endif10631064/* vec_vand */10651066static __inline__ vector signed char __ATTRS_o_ai1067vec_vand(vector signed char __a, vector signed char __b) {1068return __a & __b;1069}10701071static __inline__ vector signed char __ATTRS_o_ai1072vec_vand(vector bool char __a, vector signed char __b) {1073return (vector signed char)__a & __b;1074}10751076static __inline__ vector signed char __ATTRS_o_ai1077vec_vand(vector signed char __a, vector bool char __b) {1078return __a & (vector signed char)__b;1079}10801081static __inline__ vector unsigned char __ATTRS_o_ai1082vec_vand(vector unsigned char __a, vector unsigned char __b) {1083return __a & __b;1084}10851086static __inline__ vector unsigned char __ATTRS_o_ai1087vec_vand(vector bool char __a, vector unsigned char __b) {1088return (vector unsigned char)__a & __b;1089}10901091static __inline__ vector unsigned char __ATTRS_o_ai1092vec_vand(vector unsigned char __a, vector bool char __b) {1093return __a & (vector unsigned char)__b;1094}10951096static __inline__ vector bool char __ATTRS_o_ai vec_vand(vector bool char __a,1097vector bool char __b) {1098return __a & __b;1099}11001101static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,1102vector short __b) {1103return __a & __b;1104}11051106static __inline__ vector short __ATTRS_o_ai vec_vand(vector bool short __a,1107vector short __b) {1108return (vector short)__a & __b;1109}11101111static __inline__ vector short __ATTRS_o_ai vec_vand(vector short __a,1112vector bool short __b) {1113return __a & (vector short)__b;1114}11151116static __inline__ vector unsigned short __ATTRS_o_ai1117vec_vand(vector unsigned short __a, vector unsigned short __b) {1118return __a & __b;1119}11201121static __inline__ vector unsigned short __ATTRS_o_ai1122vec_vand(vector bool short __a, vector unsigned short __b) {1123return (vector unsigned short)__a & __b;1124}11251126static __inline__ vector unsigned short __ATTRS_o_ai1127vec_vand(vector unsigned short __a, vector bool short __b) {1128return __a & (vector unsigned short)__b;1129}11301131static __inline__ vector bool short __ATTRS_o_ai1132vec_vand(vector bool short __a, vector bool short __b) {1133return __a & __b;1134}11351136static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,1137vector int __b) {1138return __a & __b;1139}11401141static __inline__ vector int __ATTRS_o_ai vec_vand(vector bool int __a,1142vector int __b) {1143return (vector int)__a & __b;1144}11451146static __inline__ vector int __ATTRS_o_ai vec_vand(vector int __a,1147vector bool int __b) {1148return __a & (vector int)__b;1149}11501151static __inline__ vector unsigned int __ATTRS_o_ai1152vec_vand(vector unsigned int __a, vector unsigned int __b) {1153return __a & __b;1154}11551156static __inline__ vector unsigned int __ATTRS_o_ai1157vec_vand(vector bool int __a, vector unsigned int __b) {1158return (vector unsigned int)__a & __b;1159}11601161static __inline__ vector unsigned int __ATTRS_o_ai1162vec_vand(vector unsigned int __a, vector bool int __b) {1163return __a & (vector unsigned int)__b;1164}11651166static __inline__ vector bool int __ATTRS_o_ai vec_vand(vector bool int __a,1167vector bool int __b) {1168return __a & __b;1169}11701171static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,1172vector float __b) {1173vector unsigned int __res =1174(vector unsigned int)__a & (vector unsigned int)__b;1175return (vector float)__res;1176}11771178static __inline__ vector float __ATTRS_o_ai vec_vand(vector bool int __a,1179vector float __b) {1180vector unsigned int __res =1181(vector unsigned int)__a & (vector unsigned int)__b;1182return (vector float)__res;1183}11841185static __inline__ vector float __ATTRS_o_ai vec_vand(vector float __a,1186vector bool int __b) {1187vector unsigned int __res =1188(vector unsigned int)__a & (vector unsigned int)__b;1189return (vector float)__res;1190}11911192#ifdef __VSX__1193static __inline__ vector signed long long __ATTRS_o_ai1194vec_vand(vector signed long long __a, vector signed long long __b) {1195return __a & __b;1196}11971198static __inline__ vector signed long long __ATTRS_o_ai1199vec_vand(vector bool long long __a, vector signed long long __b) {1200return (vector signed long long)__a & __b;1201}12021203static __inline__ vector signed long long __ATTRS_o_ai1204vec_vand(vector signed long long __a, vector bool long long __b) {1205return __a & (vector signed long long)__b;1206}12071208static __inline__ vector unsigned long long __ATTRS_o_ai1209vec_vand(vector unsigned long long __a, vector unsigned long long __b) {1210return __a & __b;1211}12121213static __inline__ vector unsigned long long __ATTRS_o_ai1214vec_vand(vector bool long long __a, vector unsigned long long __b) {1215return (vector unsigned long long)__a & __b;1216}12171218static __inline__ vector unsigned long long __ATTRS_o_ai1219vec_vand(vector unsigned long long __a, vector bool long long __b) {1220return __a & (vector unsigned long long)__b;1221}12221223static __inline__ vector bool long long __ATTRS_o_ai1224vec_vand(vector bool long long __a, vector bool long long __b) {1225return __a & __b;1226}1227#endif12281229/* vec_andc */12301231#define __builtin_altivec_vandc vec_andc12321233static __inline__ vector signed char __ATTRS_o_ai1234vec_andc(vector signed char __a, vector signed char __b) {1235return __a & ~__b;1236}12371238static __inline__ vector signed char __ATTRS_o_ai1239vec_andc(vector bool char __a, vector signed char __b) {1240return (vector signed char)__a & ~__b;1241}12421243static __inline__ vector signed char __ATTRS_o_ai1244vec_andc(vector signed char __a, vector bool char __b) {1245return __a & ~(vector signed char)__b;1246}12471248static __inline__ vector unsigned char __ATTRS_o_ai1249vec_andc(vector unsigned char __a, vector unsigned char __b) {1250return __a & ~__b;1251}12521253static __inline__ vector unsigned char __ATTRS_o_ai1254vec_andc(vector bool char __a, vector unsigned char __b) {1255return (vector unsigned char)__a & ~__b;1256}12571258static __inline__ vector unsigned char __ATTRS_o_ai1259vec_andc(vector unsigned char __a, vector bool char __b) {1260return __a & ~(vector unsigned char)__b;1261}12621263static __inline__ vector bool char __ATTRS_o_ai vec_andc(vector bool char __a,1264vector bool char __b) {1265return __a & ~__b;1266}12671268static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,1269vector short __b) {1270return __a & ~__b;1271}12721273static __inline__ vector short __ATTRS_o_ai vec_andc(vector bool short __a,1274vector short __b) {1275return (vector short)__a & ~__b;1276}12771278static __inline__ vector short __ATTRS_o_ai vec_andc(vector short __a,1279vector bool short __b) {1280return __a & ~(vector short)__b;1281}12821283static __inline__ vector unsigned short __ATTRS_o_ai1284vec_andc(vector unsigned short __a, vector unsigned short __b) {1285return __a & ~__b;1286}12871288static __inline__ vector unsigned short __ATTRS_o_ai1289vec_andc(vector bool short __a, vector unsigned short __b) {1290return (vector unsigned short)__a & ~__b;1291}12921293static __inline__ vector unsigned short __ATTRS_o_ai1294vec_andc(vector unsigned short __a, vector bool short __b) {1295return __a & ~(vector unsigned short)__b;1296}12971298static __inline__ vector bool short __ATTRS_o_ai1299vec_andc(vector bool short __a, vector bool short __b) {1300return __a & ~__b;1301}13021303static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,1304vector int __b) {1305return __a & ~__b;1306}13071308static __inline__ vector int __ATTRS_o_ai vec_andc(vector bool int __a,1309vector int __b) {1310return (vector int)__a & ~__b;1311}13121313static __inline__ vector int __ATTRS_o_ai vec_andc(vector int __a,1314vector bool int __b) {1315return __a & ~(vector int)__b;1316}13171318static __inline__ vector unsigned int __ATTRS_o_ai1319vec_andc(vector unsigned int __a, vector unsigned int __b) {1320return __a & ~__b;1321}13221323static __inline__ vector unsigned int __ATTRS_o_ai1324vec_andc(vector bool int __a, vector unsigned int __b) {1325return (vector unsigned int)__a & ~__b;1326}13271328static __inline__ vector unsigned int __ATTRS_o_ai1329vec_andc(vector unsigned int __a, vector bool int __b) {1330return __a & ~(vector unsigned int)__b;1331}13321333static __inline__ vector bool int __ATTRS_o_ai vec_andc(vector bool int __a,1334vector bool int __b) {1335return __a & ~__b;1336}13371338static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,1339vector float __b) {1340vector unsigned int __res =1341(vector unsigned int)__a & ~(vector unsigned int)__b;1342return (vector float)__res;1343}13441345static __inline__ vector float __ATTRS_o_ai vec_andc(vector bool int __a,1346vector float __b) {1347vector unsigned int __res =1348(vector unsigned int)__a & ~(vector unsigned int)__b;1349return (vector float)__res;1350}13511352static __inline__ vector float __ATTRS_o_ai vec_andc(vector float __a,1353vector bool int __b) {1354vector unsigned int __res =1355(vector unsigned int)__a & ~(vector unsigned int)__b;1356return (vector float)__res;1357}13581359#ifdef __VSX__1360static __inline__ vector double __ATTRS_o_ai vec_andc(vector bool long long __a,1361vector double __b) {1362vector unsigned long long __res =1363(vector unsigned long long)__a & ~(vector unsigned long long)__b;1364return (vector double)__res;1365}13661367static __inline__ vector double __ATTRS_o_ai1368vec_andc(vector double __a, vector bool long long __b) {1369vector unsigned long long __res =1370(vector unsigned long long)__a & ~(vector unsigned long long)__b;1371return (vector double)__res;1372}13731374static __inline__ vector double __ATTRS_o_ai vec_andc(vector double __a,1375vector double __b) {1376vector unsigned long long __res =1377(vector unsigned long long)__a & ~(vector unsigned long long)__b;1378return (vector double)__res;1379}13801381static __inline__ vector signed long long __ATTRS_o_ai1382vec_andc(vector signed long long __a, vector signed long long __b) {1383return __a & ~__b;1384}13851386static __inline__ vector signed long long __ATTRS_o_ai1387vec_andc(vector bool long long __a, vector signed long long __b) {1388return (vector signed long long)__a & ~__b;1389}13901391static __inline__ vector signed long long __ATTRS_o_ai1392vec_andc(vector signed long long __a, vector bool long long __b) {1393return __a & ~(vector signed long long)__b;1394}13951396static __inline__ vector unsigned long long __ATTRS_o_ai1397vec_andc(vector unsigned long long __a, vector unsigned long long __b) {1398return __a & ~__b;1399}14001401static __inline__ vector unsigned long long __ATTRS_o_ai1402vec_andc(vector bool long long __a, vector unsigned long long __b) {1403return (vector unsigned long long)__a & ~__b;1404}14051406static __inline__ vector unsigned long long __ATTRS_o_ai1407vec_andc(vector unsigned long long __a, vector bool long long __b) {1408return __a & ~(vector unsigned long long)__b;1409}14101411static __inline__ vector bool long long __ATTRS_o_ai1412vec_andc(vector bool long long __a, vector bool long long __b) {1413return __a & ~__b;1414}1415#endif14161417/* vec_vandc */14181419static __inline__ vector signed char __ATTRS_o_ai1420vec_vandc(vector signed char __a, vector signed char __b) {1421return __a & ~__b;1422}14231424static __inline__ vector signed char __ATTRS_o_ai1425vec_vandc(vector bool char __a, vector signed char __b) {1426return (vector signed char)__a & ~__b;1427}14281429static __inline__ vector signed char __ATTRS_o_ai1430vec_vandc(vector signed char __a, vector bool char __b) {1431return __a & ~(vector signed char)__b;1432}14331434static __inline__ vector unsigned char __ATTRS_o_ai1435vec_vandc(vector unsigned char __a, vector unsigned char __b) {1436return __a & ~__b;1437}14381439static __inline__ vector unsigned char __ATTRS_o_ai1440vec_vandc(vector bool char __a, vector unsigned char __b) {1441return (vector unsigned char)__a & ~__b;1442}14431444static __inline__ vector unsigned char __ATTRS_o_ai1445vec_vandc(vector unsigned char __a, vector bool char __b) {1446return __a & ~(vector unsigned char)__b;1447}14481449static __inline__ vector bool char __ATTRS_o_ai1450vec_vandc(vector bool char __a, vector bool char __b) {1451return __a & ~__b;1452}14531454static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,1455vector short __b) {1456return __a & ~__b;1457}14581459static __inline__ vector short __ATTRS_o_ai vec_vandc(vector bool short __a,1460vector short __b) {1461return (vector short)__a & ~__b;1462}14631464static __inline__ vector short __ATTRS_o_ai vec_vandc(vector short __a,1465vector bool short __b) {1466return __a & ~(vector short)__b;1467}14681469static __inline__ vector unsigned short __ATTRS_o_ai1470vec_vandc(vector unsigned short __a, vector unsigned short __b) {1471return __a & ~__b;1472}14731474static __inline__ vector unsigned short __ATTRS_o_ai1475vec_vandc(vector bool short __a, vector unsigned short __b) {1476return (vector unsigned short)__a & ~__b;1477}14781479static __inline__ vector unsigned short __ATTRS_o_ai1480vec_vandc(vector unsigned short __a, vector bool short __b) {1481return __a & ~(vector unsigned short)__b;1482}14831484static __inline__ vector bool short __ATTRS_o_ai1485vec_vandc(vector bool short __a, vector bool short __b) {1486return __a & ~__b;1487}14881489static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,1490vector int __b) {1491return __a & ~__b;1492}14931494static __inline__ vector int __ATTRS_o_ai vec_vandc(vector bool int __a,1495vector int __b) {1496return (vector int)__a & ~__b;1497}14981499static __inline__ vector int __ATTRS_o_ai vec_vandc(vector int __a,1500vector bool int __b) {1501return __a & ~(vector int)__b;1502}15031504static __inline__ vector unsigned int __ATTRS_o_ai1505vec_vandc(vector unsigned int __a, vector unsigned int __b) {1506return __a & ~__b;1507}15081509static __inline__ vector unsigned int __ATTRS_o_ai1510vec_vandc(vector bool int __a, vector unsigned int __b) {1511return (vector unsigned int)__a & ~__b;1512}15131514static __inline__ vector unsigned int __ATTRS_o_ai1515vec_vandc(vector unsigned int __a, vector bool int __b) {1516return __a & ~(vector unsigned int)__b;1517}15181519static __inline__ vector bool int __ATTRS_o_ai vec_vandc(vector bool int __a,1520vector bool int __b) {1521return __a & ~__b;1522}15231524static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,1525vector float __b) {1526vector unsigned int __res =1527(vector unsigned int)__a & ~(vector unsigned int)__b;1528return (vector float)__res;1529}15301531static __inline__ vector float __ATTRS_o_ai vec_vandc(vector bool int __a,1532vector float __b) {1533vector unsigned int __res =1534(vector unsigned int)__a & ~(vector unsigned int)__b;1535return (vector float)__res;1536}15371538static __inline__ vector float __ATTRS_o_ai vec_vandc(vector float __a,1539vector bool int __b) {1540vector unsigned int __res =1541(vector unsigned int)__a & ~(vector unsigned int)__b;1542return (vector float)__res;1543}15441545#ifdef __VSX__1546static __inline__ vector signed long long __ATTRS_o_ai1547vec_vandc(vector signed long long __a, vector signed long long __b) {1548return __a & ~__b;1549}15501551static __inline__ vector signed long long __ATTRS_o_ai1552vec_vandc(vector bool long long __a, vector signed long long __b) {1553return (vector signed long long)__a & ~__b;1554}15551556static __inline__ vector signed long long __ATTRS_o_ai1557vec_vandc(vector signed long long __a, vector bool long long __b) {1558return __a & ~(vector signed long long)__b;1559}15601561static __inline__ vector unsigned long long __ATTRS_o_ai1562vec_vandc(vector unsigned long long __a, vector unsigned long long __b) {1563return __a & ~__b;1564}15651566static __inline__ vector unsigned long long __ATTRS_o_ai1567vec_vandc(vector bool long long __a, vector unsigned long long __b) {1568return (vector unsigned long long)__a & ~__b;1569}15701571static __inline__ vector unsigned long long __ATTRS_o_ai1572vec_vandc(vector unsigned long long __a, vector bool long long __b) {1573return __a & ~(vector unsigned long long)__b;1574}15751576static __inline__ vector bool long long __ATTRS_o_ai1577vec_vandc(vector bool long long __a, vector bool long long __b) {1578return __a & ~__b;1579}1580#endif15811582/* vec_avg */15831584static __inline__ vector signed char __ATTRS_o_ai1585vec_avg(vector signed char __a, vector signed char __b) {1586return __builtin_altivec_vavgsb(__a, __b);1587}15881589static __inline__ vector unsigned char __ATTRS_o_ai1590vec_avg(vector unsigned char __a, vector unsigned char __b) {1591return __builtin_altivec_vavgub(__a, __b);1592}15931594static __inline__ vector short __ATTRS_o_ai vec_avg(vector short __a,1595vector short __b) {1596return __builtin_altivec_vavgsh(__a, __b);1597}15981599static __inline__ vector unsigned short __ATTRS_o_ai1600vec_avg(vector unsigned short __a, vector unsigned short __b) {1601return __builtin_altivec_vavguh(__a, __b);1602}16031604static __inline__ vector int __ATTRS_o_ai vec_avg(vector int __a,1605vector int __b) {1606return __builtin_altivec_vavgsw(__a, __b);1607}16081609static __inline__ vector unsigned int __ATTRS_o_ai1610vec_avg(vector unsigned int __a, vector unsigned int __b) {1611return __builtin_altivec_vavguw(__a, __b);1612}16131614/* vec_vavgsb */16151616static __inline__ vector signed char __attribute__((__always_inline__))1617vec_vavgsb(vector signed char __a, vector signed char __b) {1618return __builtin_altivec_vavgsb(__a, __b);1619}16201621/* vec_vavgub */16221623static __inline__ vector unsigned char __attribute__((__always_inline__))1624vec_vavgub(vector unsigned char __a, vector unsigned char __b) {1625return __builtin_altivec_vavgub(__a, __b);1626}16271628/* vec_vavgsh */16291630static __inline__ vector short __attribute__((__always_inline__))1631vec_vavgsh(vector short __a, vector short __b) {1632return __builtin_altivec_vavgsh(__a, __b);1633}16341635/* vec_vavguh */16361637static __inline__ vector unsigned short __attribute__((__always_inline__))1638vec_vavguh(vector unsigned short __a, vector unsigned short __b) {1639return __builtin_altivec_vavguh(__a, __b);1640}16411642/* vec_vavgsw */16431644static __inline__ vector int __attribute__((__always_inline__))1645vec_vavgsw(vector int __a, vector int __b) {1646return __builtin_altivec_vavgsw(__a, __b);1647}16481649/* vec_vavguw */16501651static __inline__ vector unsigned int __attribute__((__always_inline__))1652vec_vavguw(vector unsigned int __a, vector unsigned int __b) {1653return __builtin_altivec_vavguw(__a, __b);1654}16551656/* vec_ceil */16571658static __inline__ vector float __ATTRS_o_ai vec_ceil(vector float __a) {1659#ifdef __VSX__1660return __builtin_vsx_xvrspip(__a);1661#else1662return __builtin_altivec_vrfip(__a);1663#endif1664}16651666#ifdef __VSX__1667static __inline__ vector double __ATTRS_o_ai vec_ceil(vector double __a) {1668return __builtin_vsx_xvrdpip(__a);1669}1670#endif16711672/* vec_roundp */1673static __inline__ vector float __ATTRS_o_ai vec_roundp(vector float __a) {1674return vec_ceil(__a);1675}16761677#ifdef __VSX__1678static __inline__ vector double __ATTRS_o_ai vec_roundp(vector double __a) {1679return vec_ceil(__a);1680}1681#endif16821683/* vec_vrfip */16841685static __inline__ vector float __attribute__((__always_inline__))1686vec_vrfip(vector float __a) {1687return __builtin_altivec_vrfip(__a);1688}16891690/* vec_cmpb */16911692static __inline__ vector int __attribute__((__always_inline__))1693vec_cmpb(vector float __a, vector float __b) {1694return __builtin_altivec_vcmpbfp(__a, __b);1695}16961697/* vec_vcmpbfp */16981699static __inline__ vector int __attribute__((__always_inline__))1700vec_vcmpbfp(vector float __a, vector float __b) {1701return __builtin_altivec_vcmpbfp(__a, __b);1702}17031704/* vec_cmpeq */17051706static __inline__ vector bool char __ATTRS_o_ai1707vec_cmpeq(vector signed char __a, vector signed char __b) {1708return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,1709(vector char)__b);1710}17111712static __inline__ vector bool char __ATTRS_o_ai1713vec_cmpeq(vector unsigned char __a, vector unsigned char __b) {1714return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,1715(vector char)__b);1716}17171718static __inline__ vector bool char __ATTRS_o_ai1719vec_cmpeq(vector bool char __a, vector bool char __b) {1720return (vector bool char)__builtin_altivec_vcmpequb((vector char)__a,1721(vector char)__b);1722}17231724static __inline__ vector bool short __ATTRS_o_ai vec_cmpeq(vector short __a,1725vector short __b) {1726return (vector bool short)__builtin_altivec_vcmpequh(__a, __b);1727}17281729static __inline__ vector bool short __ATTRS_o_ai1730vec_cmpeq(vector unsigned short __a, vector unsigned short __b) {1731return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,1732(vector short)__b);1733}17341735static __inline__ vector bool short __ATTRS_o_ai1736vec_cmpeq(vector bool short __a, vector bool short __b) {1737return (vector bool short)__builtin_altivec_vcmpequh((vector short)__a,1738(vector short)__b);1739}17401741static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector int __a,1742vector int __b) {1743return (vector bool int)__builtin_altivec_vcmpequw(__a, __b);1744}17451746static __inline__ vector bool int __ATTRS_o_ai1747vec_cmpeq(vector unsigned int __a, vector unsigned int __b) {1748return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,1749(vector int)__b);1750}17511752static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector bool int __a,1753vector bool int __b) {1754return (vector bool int)__builtin_altivec_vcmpequw((vector int)__a,1755(vector int)__b);1756}17571758#ifdef __POWER8_VECTOR__1759static __inline__ vector bool long long __ATTRS_o_ai1760vec_cmpeq(vector signed long long __a, vector signed long long __b) {1761return (vector bool long long)__builtin_altivec_vcmpequd(__a, __b);1762}17631764static __inline__ vector bool long long __ATTRS_o_ai1765vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {1766return (vector bool long long)__builtin_altivec_vcmpequd(1767(vector long long)__a, (vector long long)__b);1768}17691770static __inline__ vector bool long long __ATTRS_o_ai1771vec_cmpeq(vector bool long long __a, vector bool long long __b) {1772return (vector bool long long)__builtin_altivec_vcmpequd(1773(vector long long)__a, (vector long long)__b);1774}1775#elif defined(__VSX__)1776static __inline__ vector bool long long __ATTRS_o_ai1777vec_cmpeq(vector signed long long __a, vector signed long long __b) {1778vector bool int __wordcmp =1779vec_cmpeq((vector signed int)__a, (vector signed int)__b);1780#ifdef __LITTLE_ENDIAN__1781__wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 3, 0, 1, 2);1782return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 1,17831, 3, 3);1784#else1785__wordcmp &= __builtin_shufflevector(__wordcmp, __wordcmp, 1, 2, 3, 0);1786return (vector bool long long)__builtin_shufflevector(__wordcmp, __wordcmp, 0,17870, 2, 2);1788#endif1789}17901791static __inline__ vector bool long long __ATTRS_o_ai1792vec_cmpeq(vector unsigned long long __a, vector unsigned long long __b) {1793return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);1794}17951796static __inline__ vector bool long long __ATTRS_o_ai1797vec_cmpeq(vector bool long long __a, vector bool long long __b) {1798return vec_cmpeq((vector signed long long)__a, (vector signed long long)__b);1799}1800#endif18011802static __inline__ vector bool int __ATTRS_o_ai vec_cmpeq(vector float __a,1803vector float __b) {1804#ifdef __VSX__1805return (vector bool int)__builtin_vsx_xvcmpeqsp(__a, __b);1806#else1807return (vector bool int)__builtin_altivec_vcmpeqfp(__a, __b);1808#endif1809}18101811#ifdef __VSX__1812static __inline__ vector bool long long __ATTRS_o_ai1813vec_cmpeq(vector double __a, vector double __b) {1814return (vector bool long long)__builtin_vsx_xvcmpeqdp(__a, __b);1815}1816#endif18171818#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)1819static __inline__ vector bool __int128 __ATTRS_o_ai1820vec_cmpeq(vector signed __int128 __a, vector signed __int128 __b) {1821return (vector bool __int128)__builtin_altivec_vcmpequq(1822(vector unsigned __int128)__a, (vector unsigned __int128)__b);1823}18241825static __inline__ vector bool __int128 __ATTRS_o_ai1826vec_cmpeq(vector unsigned __int128 __a, vector unsigned __int128 __b) {1827return (vector bool __int128)__builtin_altivec_vcmpequq(1828(vector unsigned __int128)__a, (vector unsigned __int128)__b);1829}18301831static __inline__ vector bool __int128 __ATTRS_o_ai1832vec_cmpeq(vector bool __int128 __a, vector bool __int128 __b) {1833return (vector bool __int128)__builtin_altivec_vcmpequq(1834(vector unsigned __int128)__a, (vector unsigned __int128)__b);1835}1836#endif18371838#ifdef __POWER9_VECTOR__1839/* vec_cmpne */18401841static __inline__ vector bool char __ATTRS_o_ai1842vec_cmpne(vector bool char __a, vector bool char __b) {1843return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,1844(vector char)__b);1845}18461847static __inline__ vector bool char __ATTRS_o_ai1848vec_cmpne(vector signed char __a, vector signed char __b) {1849return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,1850(vector char)__b);1851}18521853static __inline__ vector bool char __ATTRS_o_ai1854vec_cmpne(vector unsigned char __a, vector unsigned char __b) {1855return (vector bool char)__builtin_altivec_vcmpneb((vector char)__a,1856(vector char)__b);1857}18581859static __inline__ vector bool short __ATTRS_o_ai1860vec_cmpne(vector bool short __a, vector bool short __b) {1861return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,1862(vector short)__b);1863}18641865static __inline__ vector bool short __ATTRS_o_ai1866vec_cmpne(vector signed short __a, vector signed short __b) {1867return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,1868(vector short)__b);1869}18701871static __inline__ vector bool short __ATTRS_o_ai1872vec_cmpne(vector unsigned short __a, vector unsigned short __b) {1873return (vector bool short)__builtin_altivec_vcmpneh((vector short)__a,1874(vector short)__b);1875}18761877static __inline__ vector bool int __ATTRS_o_ai1878vec_cmpne(vector bool int __a, vector bool int __b) {1879return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,1880(vector int)__b);1881}18821883static __inline__ vector bool int __ATTRS_o_ai1884vec_cmpne(vector signed int __a, vector signed int __b) {1885return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,1886(vector int)__b);1887}18881889static __inline__ vector bool int __ATTRS_o_ai1890vec_cmpne(vector unsigned int __a, vector unsigned int __b) {1891return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,1892(vector int)__b);1893}18941895static __inline__ vector bool int __ATTRS_o_ai1896vec_cmpne(vector float __a, vector float __b) {1897return (vector bool int)__builtin_altivec_vcmpnew((vector int)__a,1898(vector int)__b);1899}19001901#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)1902static __inline__ vector bool __int128 __ATTRS_o_ai1903vec_cmpne(vector unsigned __int128 __a, vector unsigned __int128 __b) {1904return (vector bool __int128)~(__builtin_altivec_vcmpequq(1905(vector unsigned __int128)__a, (vector unsigned __int128)__b));1906}19071908static __inline__ vector bool __int128 __ATTRS_o_ai1909vec_cmpne(vector signed __int128 __a, vector signed __int128 __b) {1910return (vector bool __int128)~(__builtin_altivec_vcmpequq(1911(vector unsigned __int128)__a, (vector unsigned __int128)__b));1912}19131914static __inline__ vector bool __int128 __ATTRS_o_ai1915vec_cmpne(vector bool __int128 __a, vector bool __int128 __b) {1916return (vector bool __int128)~(__builtin_altivec_vcmpequq(1917(vector unsigned __int128)__a, (vector unsigned __int128)__b));1918}1919#endif19201921/* vec_cmpnez */19221923static __inline__ vector bool char __ATTRS_o_ai1924vec_cmpnez(vector signed char __a, vector signed char __b) {1925return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,1926(vector char)__b);1927}19281929static __inline__ vector bool char __ATTRS_o_ai1930vec_cmpnez(vector unsigned char __a, vector unsigned char __b) {1931return (vector bool char)__builtin_altivec_vcmpnezb((vector char)__a,1932(vector char)__b);1933}19341935static __inline__ vector bool short __ATTRS_o_ai1936vec_cmpnez(vector signed short __a, vector signed short __b) {1937return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,1938(vector short)__b);1939}19401941static __inline__ vector bool short __ATTRS_o_ai1942vec_cmpnez(vector unsigned short __a, vector unsigned short __b) {1943return (vector bool short)__builtin_altivec_vcmpnezh((vector short)__a,1944(vector short)__b);1945}19461947static __inline__ vector bool int __ATTRS_o_ai1948vec_cmpnez(vector signed int __a, vector signed int __b) {1949return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,1950(vector int)__b);1951}19521953static __inline__ vector bool int __ATTRS_o_ai1954vec_cmpnez(vector unsigned int __a, vector unsigned int __b) {1955return (vector bool int)__builtin_altivec_vcmpnezw((vector int)__a,1956(vector int)__b);1957}19581959static __inline__ signed int __ATTRS_o_ai1960vec_cntlz_lsbb(vector signed char __a) {1961#ifdef __LITTLE_ENDIAN__1962return __builtin_altivec_vctzlsbb((vector unsigned char)__a);1963#else1964return __builtin_altivec_vclzlsbb((vector unsigned char)__a);1965#endif1966}19671968static __inline__ signed int __ATTRS_o_ai1969vec_cntlz_lsbb(vector unsigned char __a) {1970#ifdef __LITTLE_ENDIAN__1971return __builtin_altivec_vctzlsbb((vector unsigned char)__a);1972#else1973return __builtin_altivec_vclzlsbb(__a);1974#endif1975}19761977static __inline__ signed int __ATTRS_o_ai1978vec_cnttz_lsbb(vector signed char __a) {1979#ifdef __LITTLE_ENDIAN__1980return __builtin_altivec_vclzlsbb((vector unsigned char)__a);1981#else1982return __builtin_altivec_vctzlsbb((vector unsigned char)__a);1983#endif1984}19851986static __inline__ signed int __ATTRS_o_ai1987vec_cnttz_lsbb(vector unsigned char __a) {1988#ifdef __LITTLE_ENDIAN__1989return __builtin_altivec_vclzlsbb(__a);1990#else1991return __builtin_altivec_vctzlsbb(__a);1992#endif1993}19941995static __inline__ vector unsigned int __ATTRS_o_ai1996vec_parity_lsbb(vector unsigned int __a) {1997return __builtin_altivec_vprtybw(__a);1998}19992000static __inline__ vector unsigned int __ATTRS_o_ai2001vec_parity_lsbb(vector signed int __a) {2002return __builtin_altivec_vprtybw((vector unsigned int)__a);2003}20042005#ifdef __SIZEOF_INT128__2006static __inline__ vector unsigned __int128 __ATTRS_o_ai2007vec_parity_lsbb(vector unsigned __int128 __a) {2008return __builtin_altivec_vprtybq(__a);2009}20102011static __inline__ vector unsigned __int128 __ATTRS_o_ai2012vec_parity_lsbb(vector signed __int128 __a) {2013return __builtin_altivec_vprtybq((vector unsigned __int128)__a);2014}2015#endif20162017static __inline__ vector unsigned long long __ATTRS_o_ai2018vec_parity_lsbb(vector unsigned long long __a) {2019return __builtin_altivec_vprtybd(__a);2020}20212022static __inline__ vector unsigned long long __ATTRS_o_ai2023vec_parity_lsbb(vector signed long long __a) {2024return __builtin_altivec_vprtybd((vector unsigned long long)__a);2025}20262027#else2028/* vec_cmpne */20292030static __inline__ vector bool char __ATTRS_o_ai2031vec_cmpne(vector bool char __a, vector bool char __b) {2032return ~(vec_cmpeq(__a, __b));2033}20342035static __inline__ vector bool char __ATTRS_o_ai2036vec_cmpne(vector signed char __a, vector signed char __b) {2037return ~(vec_cmpeq(__a, __b));2038}20392040static __inline__ vector bool char __ATTRS_o_ai2041vec_cmpne(vector unsigned char __a, vector unsigned char __b) {2042return ~(vec_cmpeq(__a, __b));2043}20442045static __inline__ vector bool short __ATTRS_o_ai2046vec_cmpne(vector bool short __a, vector bool short __b) {2047return ~(vec_cmpeq(__a, __b));2048}20492050static __inline__ vector bool short __ATTRS_o_ai2051vec_cmpne(vector signed short __a, vector signed short __b) {2052return ~(vec_cmpeq(__a, __b));2053}20542055static __inline__ vector bool short __ATTRS_o_ai2056vec_cmpne(vector unsigned short __a, vector unsigned short __b) {2057return ~(vec_cmpeq(__a, __b));2058}20592060static __inline__ vector bool int __ATTRS_o_ai2061vec_cmpne(vector bool int __a, vector bool int __b) {2062return ~(vec_cmpeq(__a, __b));2063}20642065static __inline__ vector bool int __ATTRS_o_ai2066vec_cmpne(vector signed int __a, vector signed int __b) {2067return ~(vec_cmpeq(__a, __b));2068}20692070static __inline__ vector bool int __ATTRS_o_ai2071vec_cmpne(vector unsigned int __a, vector unsigned int __b) {2072return ~(vec_cmpeq(__a, __b));2073}20742075static __inline__ vector bool int __ATTRS_o_ai2076vec_cmpne(vector float __a, vector float __b) {2077return ~(vec_cmpeq(__a, __b));2078}2079#endif20802081#ifdef __POWER8_VECTOR__2082static __inline__ vector bool long long __ATTRS_o_ai2083vec_cmpne(vector bool long long __a, vector bool long long __b) {2084return (vector bool long long)2085~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));2086}20872088static __inline__ vector bool long long __ATTRS_o_ai2089vec_cmpne(vector signed long long __a, vector signed long long __b) {2090return (vector bool long long)2091~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));2092}20932094static __inline__ vector bool long long __ATTRS_o_ai2095vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {2096return (vector bool long long)2097~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));2098}2099#elif defined(__VSX__)2100static __inline__ vector bool long long __ATTRS_o_ai2101vec_cmpne(vector bool long long __a, vector bool long long __b) {2102return (vector bool long long)~(2103vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));2104}21052106static __inline__ vector bool long long __ATTRS_o_ai2107vec_cmpne(vector signed long long __a, vector signed long long __b) {2108return (vector bool long long)~(2109vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));2110}21112112static __inline__ vector bool long long __ATTRS_o_ai2113vec_cmpne(vector unsigned long long __a, vector unsigned long long __b) {2114return (vector bool long long)~(2115vec_cmpeq((vector signed long long)__a, (vector signed long long)__b));2116}2117#endif21182119#ifdef __VSX__2120static __inline__ vector bool long long __ATTRS_o_ai2121vec_cmpne(vector double __a, vector double __b) {2122return (vector bool long long)2123~(__builtin_altivec_vcmpequd((vector long long)__a, (vector long long)__b));2124}2125#endif21262127/* vec_cmpgt */21282129static __inline__ vector bool char __ATTRS_o_ai2130vec_cmpgt(vector signed char __a, vector signed char __b) {2131return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);2132}21332134static __inline__ vector bool char __ATTRS_o_ai2135vec_cmpgt(vector unsigned char __a, vector unsigned char __b) {2136return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);2137}21382139static __inline__ vector bool short __ATTRS_o_ai vec_cmpgt(vector short __a,2140vector short __b) {2141return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);2142}21432144static __inline__ vector bool short __ATTRS_o_ai2145vec_cmpgt(vector unsigned short __a, vector unsigned short __b) {2146return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);2147}21482149static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector int __a,2150vector int __b) {2151return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);2152}21532154static __inline__ vector bool int __ATTRS_o_ai2155vec_cmpgt(vector unsigned int __a, vector unsigned int __b) {2156return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);2157}21582159#ifdef __POWER8_VECTOR__2160static __inline__ vector bool long long __ATTRS_o_ai2161vec_cmpgt(vector signed long long __a, vector signed long long __b) {2162return (vector bool long long)__builtin_altivec_vcmpgtsd(__a, __b);2163}21642165static __inline__ vector bool long long __ATTRS_o_ai2166vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {2167return (vector bool long long)__builtin_altivec_vcmpgtud(__a, __b);2168}2169#elif defined(__VSX__)2170static __inline__ vector bool long long __ATTRS_o_ai2171vec_cmpgt(vector signed long long __a, vector signed long long __b) {2172vector signed int __sgtw = (vector signed int)vec_cmpgt(2173(vector signed int)__a, (vector signed int)__b);2174vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(2175(vector unsigned int)__a, (vector unsigned int)__b);2176vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(2177(vector signed int)__a, (vector signed int)__b);2178#ifdef __LITTLE_ENDIAN__2179__ugtw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;2180__sgtw |= (vector signed int)__ugtw;2181return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 1, 1, 3,21823);2183#else2184__ugtw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;2185__sgtw |= (vector signed int)__ugtw;2186return (vector bool long long)__builtin_shufflevector(__sgtw, __sgtw, 0, 0, 2,21872);2188#endif2189}21902191static __inline__ vector bool long long __ATTRS_o_ai2192vec_cmpgt(vector unsigned long long __a, vector unsigned long long __b) {2193vector unsigned int __ugtw = (vector unsigned int)vec_cmpgt(2194(vector unsigned int)__a, (vector unsigned int)__b);2195vector unsigned int __eqw = (vector unsigned int)vec_cmpeq(2196(vector signed int)__a, (vector signed int)__b);2197#ifdef __LITTLE_ENDIAN__2198__eqw = __builtin_shufflevector(__ugtw, __ugtw, 3, 0, 1, 2) & __eqw;2199__ugtw |= __eqw;2200return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 1, 1, 3,22013);2202#else2203__eqw = __builtin_shufflevector(__ugtw, __ugtw, 1, 2, 3, 0) & __eqw;2204__ugtw |= __eqw;2205return (vector bool long long)__builtin_shufflevector(__ugtw, __ugtw, 0, 0, 2,22062);2207#endif2208}2209#endif22102211static __inline__ vector bool int __ATTRS_o_ai vec_cmpgt(vector float __a,2212vector float __b) {2213#ifdef __VSX__2214return (vector bool int)__builtin_vsx_xvcmpgtsp(__a, __b);2215#else2216return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);2217#endif2218}22192220#ifdef __VSX__2221static __inline__ vector bool long long __ATTRS_o_ai2222vec_cmpgt(vector double __a, vector double __b) {2223return (vector bool long long)__builtin_vsx_xvcmpgtdp(__a, __b);2224}2225#endif22262227#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)2228static __inline__ vector bool __int128 __ATTRS_o_ai2229vec_cmpgt(vector signed __int128 __a, vector signed __int128 __b) {2230return (vector bool __int128)__builtin_altivec_vcmpgtsq(__a, __b);2231}22322233static __inline__ vector bool __int128 __ATTRS_o_ai2234vec_cmpgt(vector unsigned __int128 __a, vector unsigned __int128 __b) {2235return (vector bool __int128)__builtin_altivec_vcmpgtuq(__a, __b);2236}2237#endif22382239/* vec_cmpge */22402241static __inline__ vector bool char __ATTRS_o_ai2242vec_cmpge(vector signed char __a, vector signed char __b) {2243return ~(vec_cmpgt(__b, __a));2244}22452246static __inline__ vector bool char __ATTRS_o_ai2247vec_cmpge(vector unsigned char __a, vector unsigned char __b) {2248return ~(vec_cmpgt(__b, __a));2249}22502251static __inline__ vector bool short __ATTRS_o_ai2252vec_cmpge(vector signed short __a, vector signed short __b) {2253return ~(vec_cmpgt(__b, __a));2254}22552256static __inline__ vector bool short __ATTRS_o_ai2257vec_cmpge(vector unsigned short __a, vector unsigned short __b) {2258return ~(vec_cmpgt(__b, __a));2259}22602261static __inline__ vector bool int __ATTRS_o_ai2262vec_cmpge(vector signed int __a, vector signed int __b) {2263return ~(vec_cmpgt(__b, __a));2264}22652266static __inline__ vector bool int __ATTRS_o_ai2267vec_cmpge(vector unsigned int __a, vector unsigned int __b) {2268return ~(vec_cmpgt(__b, __a));2269}22702271static __inline__ vector bool int __ATTRS_o_ai vec_cmpge(vector float __a,2272vector float __b) {2273#ifdef __VSX__2274return (vector bool int)__builtin_vsx_xvcmpgesp(__a, __b);2275#else2276return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);2277#endif2278}22792280#ifdef __VSX__2281static __inline__ vector bool long long __ATTRS_o_ai2282vec_cmpge(vector double __a, vector double __b) {2283return (vector bool long long)__builtin_vsx_xvcmpgedp(__a, __b);2284}22852286static __inline__ vector bool long long __ATTRS_o_ai2287vec_cmpge(vector signed long long __a, vector signed long long __b) {2288return ~(vec_cmpgt(__b, __a));2289}22902291static __inline__ vector bool long long __ATTRS_o_ai2292vec_cmpge(vector unsigned long long __a, vector unsigned long long __b) {2293return ~(vec_cmpgt(__b, __a));2294}2295#endif22962297#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)2298static __inline__ vector bool __int128 __ATTRS_o_ai2299vec_cmpge(vector signed __int128 __a, vector signed __int128 __b) {2300return ~(vec_cmpgt(__b, __a));2301}23022303static __inline__ vector bool __int128 __ATTRS_o_ai2304vec_cmpge(vector unsigned __int128 __a, vector unsigned __int128 __b) {2305return ~(vec_cmpgt(__b, __a));2306}2307#endif23082309/* vec_vcmpgefp */23102311static __inline__ vector bool int __attribute__((__always_inline__))2312vec_vcmpgefp(vector float __a, vector float __b) {2313return (vector bool int)__builtin_altivec_vcmpgefp(__a, __b);2314}23152316/* vec_vcmpgtsb */23172318static __inline__ vector bool char __attribute__((__always_inline__))2319vec_vcmpgtsb(vector signed char __a, vector signed char __b) {2320return (vector bool char)__builtin_altivec_vcmpgtsb(__a, __b);2321}23222323/* vec_vcmpgtub */23242325static __inline__ vector bool char __attribute__((__always_inline__))2326vec_vcmpgtub(vector unsigned char __a, vector unsigned char __b) {2327return (vector bool char)__builtin_altivec_vcmpgtub(__a, __b);2328}23292330/* vec_vcmpgtsh */23312332static __inline__ vector bool short __attribute__((__always_inline__))2333vec_vcmpgtsh(vector short __a, vector short __b) {2334return (vector bool short)__builtin_altivec_vcmpgtsh(__a, __b);2335}23362337/* vec_vcmpgtuh */23382339static __inline__ vector bool short __attribute__((__always_inline__))2340vec_vcmpgtuh(vector unsigned short __a, vector unsigned short __b) {2341return (vector bool short)__builtin_altivec_vcmpgtuh(__a, __b);2342}23432344/* vec_vcmpgtsw */23452346static __inline__ vector bool int __attribute__((__always_inline__))2347vec_vcmpgtsw(vector int __a, vector int __b) {2348return (vector bool int)__builtin_altivec_vcmpgtsw(__a, __b);2349}23502351/* vec_vcmpgtuw */23522353static __inline__ vector bool int __attribute__((__always_inline__))2354vec_vcmpgtuw(vector unsigned int __a, vector unsigned int __b) {2355return (vector bool int)__builtin_altivec_vcmpgtuw(__a, __b);2356}23572358/* vec_vcmpgtfp */23592360static __inline__ vector bool int __attribute__((__always_inline__))2361vec_vcmpgtfp(vector float __a, vector float __b) {2362return (vector bool int)__builtin_altivec_vcmpgtfp(__a, __b);2363}23642365/* vec_cmple */23662367static __inline__ vector bool char __ATTRS_o_ai2368vec_cmple(vector signed char __a, vector signed char __b) {2369return vec_cmpge(__b, __a);2370}23712372static __inline__ vector bool char __ATTRS_o_ai2373vec_cmple(vector unsigned char __a, vector unsigned char __b) {2374return vec_cmpge(__b, __a);2375}23762377static __inline__ vector bool short __ATTRS_o_ai2378vec_cmple(vector signed short __a, vector signed short __b) {2379return vec_cmpge(__b, __a);2380}23812382static __inline__ vector bool short __ATTRS_o_ai2383vec_cmple(vector unsigned short __a, vector unsigned short __b) {2384return vec_cmpge(__b, __a);2385}23862387static __inline__ vector bool int __ATTRS_o_ai2388vec_cmple(vector signed int __a, vector signed int __b) {2389return vec_cmpge(__b, __a);2390}23912392static __inline__ vector bool int __ATTRS_o_ai2393vec_cmple(vector unsigned int __a, vector unsigned int __b) {2394return vec_cmpge(__b, __a);2395}23962397static __inline__ vector bool int __ATTRS_o_ai vec_cmple(vector float __a,2398vector float __b) {2399return vec_cmpge(__b, __a);2400}24012402#ifdef __VSX__2403static __inline__ vector bool long long __ATTRS_o_ai2404vec_cmple(vector double __a, vector double __b) {2405return vec_cmpge(__b, __a);2406}24072408static __inline__ vector bool long long __ATTRS_o_ai2409vec_cmple(vector signed long long __a, vector signed long long __b) {2410return vec_cmpge(__b, __a);2411}24122413static __inline__ vector bool long long __ATTRS_o_ai2414vec_cmple(vector unsigned long long __a, vector unsigned long long __b) {2415return vec_cmpge(__b, __a);2416}2417#endif24182419#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)2420static __inline__ vector bool __int128 __ATTRS_o_ai2421vec_cmple(vector signed __int128 __a, vector signed __int128 __b) {2422return vec_cmpge(__b, __a);2423}24242425static __inline__ vector bool __int128 __ATTRS_o_ai2426vec_cmple(vector unsigned __int128 __a, vector unsigned __int128 __b) {2427return vec_cmpge(__b, __a);2428}2429#endif24302431/* vec_cmplt */24322433static __inline__ vector bool char __ATTRS_o_ai2434vec_cmplt(vector signed char __a, vector signed char __b) {2435return vec_cmpgt(__b, __a);2436}24372438static __inline__ vector bool char __ATTRS_o_ai2439vec_cmplt(vector unsigned char __a, vector unsigned char __b) {2440return vec_cmpgt(__b, __a);2441}24422443static __inline__ vector bool short __ATTRS_o_ai vec_cmplt(vector short __a,2444vector short __b) {2445return vec_cmpgt(__b, __a);2446}24472448static __inline__ vector bool short __ATTRS_o_ai2449vec_cmplt(vector unsigned short __a, vector unsigned short __b) {2450return vec_cmpgt(__b, __a);2451}24522453static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector int __a,2454vector int __b) {2455return vec_cmpgt(__b, __a);2456}24572458static __inline__ vector bool int __ATTRS_o_ai2459vec_cmplt(vector unsigned int __a, vector unsigned int __b) {2460return vec_cmpgt(__b, __a);2461}24622463static __inline__ vector bool int __ATTRS_o_ai vec_cmplt(vector float __a,2464vector float __b) {2465return vec_cmpgt(__b, __a);2466}24672468#ifdef __VSX__2469static __inline__ vector bool long long __ATTRS_o_ai2470vec_cmplt(vector double __a, vector double __b) {2471return vec_cmpgt(__b, __a);2472}2473#endif24742475#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)2476static __inline__ vector bool __int128 __ATTRS_o_ai2477vec_cmplt(vector signed __int128 __a, vector signed __int128 __b) {2478return vec_cmpgt(__b, __a);2479}24802481static __inline__ vector bool __int128 __ATTRS_o_ai2482vec_cmplt(vector unsigned __int128 __a, vector unsigned __int128 __b) {2483return vec_cmpgt(__b, __a);2484}2485#endif24862487#ifdef __VSX__2488static __inline__ vector bool long long __ATTRS_o_ai2489vec_cmplt(vector signed long long __a, vector signed long long __b) {2490return vec_cmpgt(__b, __a);2491}24922493static __inline__ vector bool long long __ATTRS_o_ai2494vec_cmplt(vector unsigned long long __a, vector unsigned long long __b) {2495return vec_cmpgt(__b, __a);2496}2497#endif24982499#ifdef __POWER8_VECTOR__2500/* vec_popcnt */25012502static __inline__ vector unsigned char __ATTRS_o_ai2503vec_popcnt(vector signed char __a) {2504return (vector unsigned char)__builtin_altivec_vpopcntb(2505(vector unsigned char)__a);2506}2507static __inline__ vector unsigned char __ATTRS_o_ai2508vec_popcnt(vector unsigned char __a) {2509return __builtin_altivec_vpopcntb(__a);2510}2511static __inline__ vector unsigned short __ATTRS_o_ai2512vec_popcnt(vector signed short __a) {2513return (vector unsigned short)__builtin_altivec_vpopcnth(2514(vector unsigned short)__a);2515}2516static __inline__ vector unsigned short __ATTRS_o_ai2517vec_popcnt(vector unsigned short __a) {2518return __builtin_altivec_vpopcnth(__a);2519}2520static __inline__ vector unsigned int __ATTRS_o_ai2521vec_popcnt(vector signed int __a) {2522return __builtin_altivec_vpopcntw((vector unsigned int)__a);2523}2524static __inline__ vector unsigned int __ATTRS_o_ai2525vec_popcnt(vector unsigned int __a) {2526return __builtin_altivec_vpopcntw(__a);2527}2528static __inline__ vector unsigned long long __ATTRS_o_ai2529vec_popcnt(vector signed long long __a) {2530return __builtin_altivec_vpopcntd((vector unsigned long long)__a);2531}2532static __inline__ vector unsigned long long __ATTRS_o_ai2533vec_popcnt(vector unsigned long long __a) {2534return __builtin_altivec_vpopcntd(__a);2535}25362537#define vec_vclz vec_cntlz2538/* vec_cntlz */25392540static __inline__ vector signed char __ATTRS_o_ai2541vec_cntlz(vector signed char __a) {2542return (vector signed char)__builtin_altivec_vclzb((vector unsigned char)__a);2543}2544static __inline__ vector unsigned char __ATTRS_o_ai2545vec_cntlz(vector unsigned char __a) {2546return __builtin_altivec_vclzb(__a);2547}2548static __inline__ vector signed short __ATTRS_o_ai2549vec_cntlz(vector signed short __a) {2550return (vector signed short)__builtin_altivec_vclzh(2551(vector unsigned short)__a);2552}2553static __inline__ vector unsigned short __ATTRS_o_ai2554vec_cntlz(vector unsigned short __a) {2555return __builtin_altivec_vclzh(__a);2556}2557static __inline__ vector signed int __ATTRS_o_ai2558vec_cntlz(vector signed int __a) {2559return (vector signed int)__builtin_altivec_vclzw((vector unsigned int)__a);2560}2561static __inline__ vector unsigned int __ATTRS_o_ai2562vec_cntlz(vector unsigned int __a) {2563return __builtin_altivec_vclzw(__a);2564}2565static __inline__ vector signed long long __ATTRS_o_ai2566vec_cntlz(vector signed long long __a) {2567return (vector signed long long)__builtin_altivec_vclzd(2568(vector unsigned long long)__a);2569}2570static __inline__ vector unsigned long long __ATTRS_o_ai2571vec_cntlz(vector unsigned long long __a) {2572return __builtin_altivec_vclzd(__a);2573}2574#endif25752576#ifdef __POWER9_VECTOR__25772578/* vec_cnttz */25792580static __inline__ vector signed char __ATTRS_o_ai2581vec_cnttz(vector signed char __a) {2582return (vector signed char)__builtin_altivec_vctzb((vector unsigned char)__a);2583}2584static __inline__ vector unsigned char __ATTRS_o_ai2585vec_cnttz(vector unsigned char __a) {2586return __builtin_altivec_vctzb(__a);2587}2588static __inline__ vector signed short __ATTRS_o_ai2589vec_cnttz(vector signed short __a) {2590return (vector signed short)__builtin_altivec_vctzh(2591(vector unsigned short)__a);2592}2593static __inline__ vector unsigned short __ATTRS_o_ai2594vec_cnttz(vector unsigned short __a) {2595return __builtin_altivec_vctzh(__a);2596}2597static __inline__ vector signed int __ATTRS_o_ai2598vec_cnttz(vector signed int __a) {2599return (vector signed int)__builtin_altivec_vctzw((vector unsigned int)__a);2600}2601static __inline__ vector unsigned int __ATTRS_o_ai2602vec_cnttz(vector unsigned int __a) {2603return __builtin_altivec_vctzw(__a);2604}2605static __inline__ vector signed long long __ATTRS_o_ai2606vec_cnttz(vector signed long long __a) {2607return (vector signed long long)__builtin_altivec_vctzd(2608(vector unsigned long long)__a);2609}2610static __inline__ vector unsigned long long __ATTRS_o_ai2611vec_cnttz(vector unsigned long long __a) {2612return __builtin_altivec_vctzd(__a);2613}26142615/* vec_first_match_index */26162617static __inline__ unsigned __ATTRS_o_ai2618vec_first_match_index(vector signed char __a, vector signed char __b) {2619vector unsigned long long __res =2620#ifdef __LITTLE_ENDIAN__2621vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2622#else2623vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2624#endif2625if (__res[0] == 64) {2626return (__res[1] + 64) >> 3;2627}2628return __res[0] >> 3;2629}26302631static __inline__ unsigned __ATTRS_o_ai2632vec_first_match_index(vector unsigned char __a, vector unsigned char __b) {2633vector unsigned long long __res =2634#ifdef __LITTLE_ENDIAN__2635vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2636#else2637vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2638#endif2639if (__res[0] == 64) {2640return (__res[1] + 64) >> 3;2641}2642return __res[0] >> 3;2643}26442645static __inline__ unsigned __ATTRS_o_ai2646vec_first_match_index(vector signed short __a, vector signed short __b) {2647vector unsigned long long __res =2648#ifdef __LITTLE_ENDIAN__2649vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2650#else2651vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2652#endif2653if (__res[0] == 64) {2654return (__res[1] + 64) >> 4;2655}2656return __res[0] >> 4;2657}26582659static __inline__ unsigned __ATTRS_o_ai2660vec_first_match_index(vector unsigned short __a, vector unsigned short __b) {2661vector unsigned long long __res =2662#ifdef __LITTLE_ENDIAN__2663vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2664#else2665vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2666#endif2667if (__res[0] == 64) {2668return (__res[1] + 64) >> 4;2669}2670return __res[0] >> 4;2671}26722673static __inline__ unsigned __ATTRS_o_ai2674vec_first_match_index(vector signed int __a, vector signed int __b) {2675vector unsigned long long __res =2676#ifdef __LITTLE_ENDIAN__2677vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2678#else2679vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2680#endif2681if (__res[0] == 64) {2682return (__res[1] + 64) >> 5;2683}2684return __res[0] >> 5;2685}26862687static __inline__ unsigned __ATTRS_o_ai2688vec_first_match_index(vector unsigned int __a, vector unsigned int __b) {2689vector unsigned long long __res =2690#ifdef __LITTLE_ENDIAN__2691vec_cnttz((vector unsigned long long)vec_cmpeq(__a, __b));2692#else2693vec_cntlz((vector unsigned long long)vec_cmpeq(__a, __b));2694#endif2695if (__res[0] == 64) {2696return (__res[1] + 64) >> 5;2697}2698return __res[0] >> 5;2699}27002701/* vec_first_match_or_eos_index */27022703static __inline__ unsigned __ATTRS_o_ai2704vec_first_match_or_eos_index(vector signed char __a, vector signed char __b) {2705/* Compare the result of the comparison of two vectors with either and OR the2706result. Either the elements are equal or one will equal the comparison2707result if either is zero.2708*/2709vector bool char __tmp1 = vec_cmpeq(__a, __b);2710vector bool char __tmp2 = __tmp1 |2711vec_cmpeq((vector signed char)__tmp1, __a) |2712vec_cmpeq((vector signed char)__tmp1, __b);27132714vector unsigned long long __res =2715#ifdef __LITTLE_ENDIAN__2716vec_cnttz((vector unsigned long long)__tmp2);2717#else2718vec_cntlz((vector unsigned long long)__tmp2);2719#endif2720if (__res[0] == 64) {2721return (__res[1] + 64) >> 3;2722}2723return __res[0] >> 3;2724}27252726static __inline__ unsigned __ATTRS_o_ai2727vec_first_match_or_eos_index(vector unsigned char __a,2728vector unsigned char __b) {2729vector bool char __tmp1 = vec_cmpeq(__a, __b);2730vector bool char __tmp2 = __tmp1 |2731vec_cmpeq((vector unsigned char)__tmp1, __a) |2732vec_cmpeq((vector unsigned char)__tmp1, __b);27332734vector unsigned long long __res =2735#ifdef __LITTLE_ENDIAN__2736vec_cnttz((vector unsigned long long)__tmp2);2737#else2738vec_cntlz((vector unsigned long long)__tmp2);2739#endif2740if (__res[0] == 64) {2741return (__res[1] + 64) >> 3;2742}2743return __res[0] >> 3;2744}27452746static __inline__ unsigned __ATTRS_o_ai2747vec_first_match_or_eos_index(vector signed short __a, vector signed short __b) {2748vector bool short __tmp1 = vec_cmpeq(__a, __b);2749vector bool short __tmp2 = __tmp1 |2750vec_cmpeq((vector signed short)__tmp1, __a) |2751vec_cmpeq((vector signed short)__tmp1, __b);27522753vector unsigned long long __res =2754#ifdef __LITTLE_ENDIAN__2755vec_cnttz((vector unsigned long long)__tmp2);2756#else2757vec_cntlz((vector unsigned long long)__tmp2);2758#endif2759if (__res[0] == 64) {2760return (__res[1] + 64) >> 4;2761}2762return __res[0] >> 4;2763}27642765static __inline__ unsigned __ATTRS_o_ai2766vec_first_match_or_eos_index(vector unsigned short __a,2767vector unsigned short __b) {2768vector bool short __tmp1 = vec_cmpeq(__a, __b);2769vector bool short __tmp2 = __tmp1 |2770vec_cmpeq((vector unsigned short)__tmp1, __a) |2771vec_cmpeq((vector unsigned short)__tmp1, __b);27722773vector unsigned long long __res =2774#ifdef __LITTLE_ENDIAN__2775vec_cnttz((vector unsigned long long)__tmp2);2776#else2777vec_cntlz((vector unsigned long long)__tmp2);2778#endif2779if (__res[0] == 64) {2780return (__res[1] + 64) >> 4;2781}2782return __res[0] >> 4;2783}27842785static __inline__ unsigned __ATTRS_o_ai2786vec_first_match_or_eos_index(vector signed int __a, vector signed int __b) {2787vector bool int __tmp1 = vec_cmpeq(__a, __b);2788vector bool int __tmp2 = __tmp1 | vec_cmpeq((vector signed int)__tmp1, __a) |2789vec_cmpeq((vector signed int)__tmp1, __b);27902791vector unsigned long long __res =2792#ifdef __LITTLE_ENDIAN__2793vec_cnttz((vector unsigned long long)__tmp2);2794#else2795vec_cntlz((vector unsigned long long)__tmp2);2796#endif2797if (__res[0] == 64) {2798return (__res[1] + 64) >> 5;2799}2800return __res[0] >> 5;2801}28022803static __inline__ unsigned __ATTRS_o_ai2804vec_first_match_or_eos_index(vector unsigned int __a, vector unsigned int __b) {2805vector bool int __tmp1 = vec_cmpeq(__a, __b);2806vector bool int __tmp2 = __tmp1 |2807vec_cmpeq((vector unsigned int)__tmp1, __a) |2808vec_cmpeq((vector unsigned int)__tmp1, __b);28092810vector unsigned long long __res =2811#ifdef __LITTLE_ENDIAN__2812vec_cnttz((vector unsigned long long)__tmp2);2813#else2814vec_cntlz((vector unsigned long long)__tmp2);2815#endif2816if (__res[0] == 64) {2817return (__res[1] + 64) >> 5;2818}2819return __res[0] >> 5;2820}28212822/* vec_first_mismatch_index */28232824static __inline__ unsigned __ATTRS_o_ai2825vec_first_mismatch_index(vector signed char __a, vector signed char __b) {2826vector unsigned long long __res =2827#ifdef __LITTLE_ENDIAN__2828vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2829#else2830vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2831#endif2832if (__res[0] == 64) {2833return (__res[1] + 64) >> 3;2834}2835return __res[0] >> 3;2836}28372838static __inline__ unsigned __ATTRS_o_ai2839vec_first_mismatch_index(vector unsigned char __a, vector unsigned char __b) {2840vector unsigned long long __res =2841#ifdef __LITTLE_ENDIAN__2842vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2843#else2844vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2845#endif2846if (__res[0] == 64) {2847return (__res[1] + 64) >> 3;2848}2849return __res[0] >> 3;2850}28512852static __inline__ unsigned __ATTRS_o_ai2853vec_first_mismatch_index(vector signed short __a, vector signed short __b) {2854vector unsigned long long __res =2855#ifdef __LITTLE_ENDIAN__2856vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2857#else2858vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2859#endif2860if (__res[0] == 64) {2861return (__res[1] + 64) >> 4;2862}2863return __res[0] >> 4;2864}28652866static __inline__ unsigned __ATTRS_o_ai2867vec_first_mismatch_index(vector unsigned short __a, vector unsigned short __b) {2868vector unsigned long long __res =2869#ifdef __LITTLE_ENDIAN__2870vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2871#else2872vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2873#endif2874if (__res[0] == 64) {2875return (__res[1] + 64) >> 4;2876}2877return __res[0] >> 4;2878}28792880static __inline__ unsigned __ATTRS_o_ai2881vec_first_mismatch_index(vector signed int __a, vector signed int __b) {2882vector unsigned long long __res =2883#ifdef __LITTLE_ENDIAN__2884vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2885#else2886vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2887#endif2888if (__res[0] == 64) {2889return (__res[1] + 64) >> 5;2890}2891return __res[0] >> 5;2892}28932894static __inline__ unsigned __ATTRS_o_ai2895vec_first_mismatch_index(vector unsigned int __a, vector unsigned int __b) {2896vector unsigned long long __res =2897#ifdef __LITTLE_ENDIAN__2898vec_cnttz((vector unsigned long long)vec_cmpne(__a, __b));2899#else2900vec_cntlz((vector unsigned long long)vec_cmpne(__a, __b));2901#endif2902if (__res[0] == 64) {2903return (__res[1] + 64) >> 5;2904}2905return __res[0] >> 5;2906}29072908/* vec_first_mismatch_or_eos_index */29092910static __inline__ unsigned __ATTRS_o_ai2911vec_first_mismatch_or_eos_index(vector signed char __a,2912vector signed char __b) {2913vector unsigned long long __res =2914#ifdef __LITTLE_ENDIAN__2915vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2916#else2917vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2918#endif2919if (__res[0] == 64) {2920return (__res[1] + 64) >> 3;2921}2922return __res[0] >> 3;2923}29242925static __inline__ unsigned __ATTRS_o_ai2926vec_first_mismatch_or_eos_index(vector unsigned char __a,2927vector unsigned char __b) {2928vector unsigned long long __res =2929#ifdef __LITTLE_ENDIAN__2930vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2931#else2932vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2933#endif2934if (__res[0] == 64) {2935return (__res[1] + 64) >> 3;2936}2937return __res[0] >> 3;2938}29392940static __inline__ unsigned __ATTRS_o_ai2941vec_first_mismatch_or_eos_index(vector signed short __a,2942vector signed short __b) {2943vector unsigned long long __res =2944#ifdef __LITTLE_ENDIAN__2945vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2946#else2947vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2948#endif2949if (__res[0] == 64) {2950return (__res[1] + 64) >> 4;2951}2952return __res[0] >> 4;2953}29542955static __inline__ unsigned __ATTRS_o_ai2956vec_first_mismatch_or_eos_index(vector unsigned short __a,2957vector unsigned short __b) {2958vector unsigned long long __res =2959#ifdef __LITTLE_ENDIAN__2960vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2961#else2962vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2963#endif2964if (__res[0] == 64) {2965return (__res[1] + 64) >> 4;2966}2967return __res[0] >> 4;2968}29692970static __inline__ unsigned __ATTRS_o_ai2971vec_first_mismatch_or_eos_index(vector signed int __a, vector signed int __b) {2972vector unsigned long long __res =2973#ifdef __LITTLE_ENDIAN__2974vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2975#else2976vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2977#endif2978if (__res[0] == 64) {2979return (__res[1] + 64) >> 5;2980}2981return __res[0] >> 5;2982}29832984static __inline__ unsigned __ATTRS_o_ai2985vec_first_mismatch_or_eos_index(vector unsigned int __a,2986vector unsigned int __b) {2987vector unsigned long long __res =2988#ifdef __LITTLE_ENDIAN__2989vec_cnttz((vector unsigned long long)vec_cmpnez(__a, __b));2990#else2991vec_cntlz((vector unsigned long long)vec_cmpnez(__a, __b));2992#endif2993if (__res[0] == 64) {2994return (__res[1] + 64) >> 5;2995}2996return __res[0] >> 5;2997}29982999static __inline__ vector double __ATTRS_o_ai3000vec_insert_exp(vector double __a, vector unsigned long long __b) {3001return __builtin_vsx_xviexpdp((vector unsigned long long)__a,__b);3002}30033004static __inline__ vector double __ATTRS_o_ai3005vec_insert_exp(vector unsigned long long __a, vector unsigned long long __b) {3006return __builtin_vsx_xviexpdp(__a,__b);3007}30083009static __inline__ vector float __ATTRS_o_ai3010vec_insert_exp(vector float __a, vector unsigned int __b) {3011return __builtin_vsx_xviexpsp((vector unsigned int)__a,__b);3012}30133014static __inline__ vector float __ATTRS_o_ai3015vec_insert_exp(vector unsigned int __a, vector unsigned int __b) {3016return __builtin_vsx_xviexpsp(__a,__b);3017}30183019#if defined(__powerpc64__)3020static __inline__ vector signed char __ATTRS_o_ai vec_xl_len(const signed char *__a,3021size_t __b) {3022return (vector signed char)__builtin_vsx_lxvl(__a, (__b << 56));3023}30243025static __inline__ vector unsigned char __ATTRS_o_ai3026vec_xl_len(const unsigned char *__a, size_t __b) {3027return (vector unsigned char)__builtin_vsx_lxvl(__a, (__b << 56));3028}30293030static __inline__ vector signed short __ATTRS_o_ai vec_xl_len(const signed short *__a,3031size_t __b) {3032return (vector signed short)__builtin_vsx_lxvl(__a, (__b << 56));3033}30343035static __inline__ vector unsigned short __ATTRS_o_ai3036vec_xl_len(const unsigned short *__a, size_t __b) {3037return (vector unsigned short)__builtin_vsx_lxvl(__a, (__b << 56));3038}30393040static __inline__ vector signed int __ATTRS_o_ai vec_xl_len(const signed int *__a,3041size_t __b) {3042return (vector signed int)__builtin_vsx_lxvl(__a, (__b << 56));3043}30443045static __inline__ vector unsigned int __ATTRS_o_ai vec_xl_len(const unsigned int *__a,3046size_t __b) {3047return (vector unsigned int)__builtin_vsx_lxvl(__a, (__b << 56));3048}30493050static __inline__ vector float __ATTRS_o_ai vec_xl_len(const float *__a, size_t __b) {3051return (vector float)__builtin_vsx_lxvl(__a, (__b << 56));3052}30533054#ifdef __SIZEOF_INT128__3055static __inline__ vector signed __int128 __ATTRS_o_ai3056vec_xl_len(const signed __int128 *__a, size_t __b) {3057return (vector signed __int128)__builtin_vsx_lxvl(__a, (__b << 56));3058}30593060static __inline__ vector unsigned __int128 __ATTRS_o_ai3061vec_xl_len(const unsigned __int128 *__a, size_t __b) {3062return (vector unsigned __int128)__builtin_vsx_lxvl(__a, (__b << 56));3063}3064#endif30653066static __inline__ vector signed long long __ATTRS_o_ai3067vec_xl_len(const signed long long *__a, size_t __b) {3068return (vector signed long long)__builtin_vsx_lxvl(__a, (__b << 56));3069}30703071static __inline__ vector unsigned long long __ATTRS_o_ai3072vec_xl_len(const unsigned long long *__a, size_t __b) {3073return (vector unsigned long long)__builtin_vsx_lxvl(__a, (__b << 56));3074}30753076static __inline__ vector double __ATTRS_o_ai vec_xl_len(const double *__a,3077size_t __b) {3078return (vector double)__builtin_vsx_lxvl(__a, (__b << 56));3079}30803081static __inline__ vector unsigned char __ATTRS_o_ai3082vec_xl_len_r(const unsigned char *__a, size_t __b) {3083vector unsigned char __res =3084(vector unsigned char)__builtin_vsx_lxvll(__a, (__b << 56));3085vector unsigned char __mask =3086(vector unsigned char)__builtin_altivec_lvsr(16 - __b, (int *)NULL);3087return (vector unsigned char)__builtin_altivec_vperm_4si(3088(vector int)__res, (vector int)__res, __mask);3089}30903091// vec_xst_len3092static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned char __a,3093unsigned char *__b,3094size_t __c) {3095return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3096}30973098static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed char __a,3099signed char *__b, size_t __c) {3100return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3101}31023103static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed short __a,3104signed short *__b, size_t __c) {3105return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3106}31073108static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned short __a,3109unsigned short *__b,3110size_t __c) {3111return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3112}31133114static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed int __a,3115signed int *__b, size_t __c) {3116return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3117}31183119static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned int __a,3120unsigned int *__b, size_t __c) {3121return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3122}31233124static __inline__ void __ATTRS_o_ai vec_xst_len(vector float __a, float *__b,3125size_t __c) {3126return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3127}31283129#ifdef __SIZEOF_INT128__3130static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed __int128 __a,3131signed __int128 *__b,3132size_t __c) {3133return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3134}31353136static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned __int128 __a,3137unsigned __int128 *__b,3138size_t __c) {3139return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3140}3141#endif31423143static __inline__ void __ATTRS_o_ai vec_xst_len(vector signed long long __a,3144signed long long *__b,3145size_t __c) {3146return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3147}31483149static __inline__ void __ATTRS_o_ai vec_xst_len(vector unsigned long long __a,3150unsigned long long *__b,3151size_t __c) {3152return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3153}31543155static __inline__ void __ATTRS_o_ai vec_xst_len(vector double __a, double *__b,3156size_t __c) {3157return __builtin_vsx_stxvl((vector int)__a, __b, (__c << 56));3158}31593160static __inline__ void __ATTRS_o_ai vec_xst_len_r(vector unsigned char __a,3161unsigned char *__b,3162size_t __c) {3163vector unsigned char __mask =3164(vector unsigned char)__builtin_altivec_lvsl(16 - __c, (int *)NULL);3165vector unsigned char __res =3166(vector unsigned char)__builtin_altivec_vperm_4si(3167(vector int)__a, (vector int)__a, __mask);3168return __builtin_vsx_stxvll((vector int)__res, __b, (__c << 56));3169}3170#endif3171#endif31723173#if defined(__POWER9_VECTOR__) && defined(__powerpc64__)3174#define __vec_ldrmb(PTR, CNT) vec_xl_len_r((const unsigned char *)(PTR), (CNT))3175#define __vec_strmb(PTR, CNT, VAL) \3176vec_xst_len_r((VAL), (unsigned char *)(PTR), (CNT))3177#else3178#define __vec_ldrmb __builtin_vsx_ldrmb3179#define __vec_strmb __builtin_vsx_strmb3180#endif31813182/* vec_cpsgn */31833184#ifdef __VSX__3185static __inline__ vector float __ATTRS_o_ai vec_cpsgn(vector float __a,3186vector float __b) {3187return __builtin_vsx_xvcpsgnsp(__b, __a);3188}31893190static __inline__ vector double __ATTRS_o_ai vec_cpsgn(vector double __a,3191vector double __b) {3192return __builtin_vsx_xvcpsgndp(__b, __a);3193}3194#endif31953196/* vec_ctf */31973198#ifdef __VSX__3199// There are some functions that have different signatures with the XL compiler3200// from those in Clang/GCC and documented in the PVIPR. This macro ensures that3201// the XL-compatible signatures are used for those functions.3202#ifdef __XL_COMPAT_ALTIVEC__3203#define vec_ctf(__a, __b) \3204_Generic((__a), \3205vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \3206((__b)&0x1F)), \3207vector unsigned int: (vector float)__builtin_altivec_vcfux( \3208(vector unsigned int)(__a), ((__b)&0x1F)), \3209vector unsigned long long: ( \3210vector float)(__builtin_vsx_xvcvuxdsp( \3211(vector unsigned long long)(__a)) * \3212(vector float)(vector unsigned)((0x7f - \3213((__b)&0x1F)) \3214<< 23)), \3215vector signed long long: ( \3216vector float)(__builtin_vsx_xvcvsxdsp( \3217(vector signed long long)(__a)) * \3218(vector float)(vector unsigned)((0x7f - \3219((__b)&0x1F)) \3220<< 23)))3221#else // __XL_COMPAT_ALTIVEC__3222#define vec_ctf(__a, __b) \3223_Generic( \3224(__a), \3225vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \3226((__b)&0x1F)), \3227vector unsigned int: (vector float)__builtin_altivec_vcfux( \3228(vector unsigned int)(__a), ((__b)&0x1F)), \3229vector unsigned long long: ( \3230vector float)(__builtin_convertvector( \3231(vector unsigned long long)(__a), vector double) * \3232(vector double)(vector unsigned long long)((0x3ffULL - \3233((__b)&0x1F)) \3234<< 52)), \3235vector signed long long: ( \3236vector float)(__builtin_convertvector( \3237(vector signed long long)(__a), vector double) * \3238(vector double)(vector unsigned long long)((0x3ffULL - \3239((__b)&0x1F)) \3240<< 52)))3241#endif // __XL_COMPAT_ALTIVEC__3242#else3243#define vec_ctf(__a, __b) \3244_Generic((__a), \3245vector int: (vector float)__builtin_altivec_vcfsx((vector int)(__a), \3246((__b)&0x1F)), \3247vector unsigned int: (vector float)__builtin_altivec_vcfux( \3248(vector unsigned int)(__a), ((__b)&0x1F)))3249#endif32503251/* vec_ctd */3252#ifdef __VSX__3253#define vec_ctd(__a, __b) \3254_Generic((__a), \3255vector signed int: ( \3256vec_doublee((vector signed int)(__a)) * \3257(vector double)(vector unsigned long long)((0x3ffULL - \3258((__b)&0x1F)) \3259<< 52)), \3260vector unsigned int: ( \3261vec_doublee((vector unsigned int)(__a)) * \3262(vector double)(vector unsigned long long)((0x3ffULL - \3263((__b)&0x1F)) \3264<< 52)), \3265vector unsigned long long: ( \3266__builtin_convertvector((vector unsigned long long)(__a), \3267vector double) * \3268(vector double)(vector unsigned long long)((0x3ffULL - \3269((__b)&0x1F)) \3270<< 52)), \3271vector signed long long: ( \3272__builtin_convertvector((vector signed long long)(__a), \3273vector double) * \3274(vector double)(vector unsigned long long)((0x3ffULL - \3275((__b)&0x1F)) \3276<< 52)))3277#endif // __VSX__32783279/* vec_vcfsx */32803281#define vec_vcfux __builtin_altivec_vcfux3282/* vec_vcfux */32833284#define vec_vcfsx(__a, __b) __builtin_altivec_vcfsx((vector int)(__a), (__b))32853286/* vec_cts */32873288#ifdef __VSX__3289#ifdef __XL_COMPAT_ALTIVEC__3290#define vec_cts(__a, __b) \3291_Generic((__a), \3292vector float: (vector signed int)__builtin_altivec_vctsxs( \3293(vector float)(__a), ((__b)&0x1F)), \3294vector double: __extension__({ \3295vector double __ret = \3296(vector double)(__a) * \3297(vector double)(vector unsigned long long)((0x3ffULL + \3298((__b)&0x1F)) \3299<< 52); \3300(vector signed long long)__builtin_vsx_xvcvdpsxws(__ret); \3301}))3302#else // __XL_COMPAT_ALTIVEC__3303#define vec_cts(__a, __b) \3304_Generic((__a), \3305vector float: (vector signed int)__builtin_altivec_vctsxs( \3306(vector float)(__a), ((__b)&0x1F)), \3307vector double: __extension__({ \3308vector double __ret = \3309(vector double)(__a) * \3310(vector double)(vector unsigned long long)((0x3ffULL + \3311((__b)&0x1F)) \3312<< 52); \3313(vector signed long long)__builtin_convertvector( \3314__ret, vector signed long long); \3315}))3316#endif // __XL_COMPAT_ALTIVEC__3317#else3318#define vec_cts __builtin_altivec_vctsxs3319#endif33203321/* vec_vctsxs */33223323#define vec_vctsxs __builtin_altivec_vctsxs33243325/* vec_ctu */33263327#ifdef __VSX__3328#ifdef __XL_COMPAT_ALTIVEC__3329#define vec_ctu(__a, __b) \3330_Generic((__a), \3331vector float: (vector unsigned int)__builtin_altivec_vctuxs( \3332(vector float)(__a), ((__b)&0x1F)), \3333vector double: __extension__({ \3334vector double __ret = \3335(vector double)(__a) * \3336(vector double)(vector unsigned long long)((0x3ffULL + \3337((__b)&0x1F)) \3338<< 52); \3339(vector unsigned long long)__builtin_vsx_xvcvdpuxws(__ret); \3340}))3341#else // __XL_COMPAT_ALTIVEC__3342#define vec_ctu(__a, __b) \3343_Generic((__a), \3344vector float: (vector unsigned int)__builtin_altivec_vctuxs( \3345(vector float)(__a), ((__b)&0x1F)), \3346vector double: __extension__({ \3347vector double __ret = \3348(vector double)(__a) * \3349(vector double)(vector unsigned long long)((0x3ffULL + \3350((__b)&0x1F)) \3351<< 52); \3352(vector unsigned long long)__builtin_convertvector( \3353__ret, vector unsigned long long); \3354}))3355#endif // __XL_COMPAT_ALTIVEC__3356#else3357#define vec_ctu __builtin_altivec_vctuxs3358#endif33593360#ifdef __LITTLE_ENDIAN__3361/* vec_ctsl */33623363#ifdef __VSX__3364#define vec_ctsl(__a, __b) \3365_Generic( \3366(__a), vector float \3367: __extension__({ \3368vector float __ret = \3369(vector float)(__a) * \3370(vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \3371__builtin_vsx_xvcvspsxds(__builtin_vsx_xxsldwi(__ret, __ret, 1)); \3372}), \3373vector double \3374: __extension__({ \3375vector double __ret = \3376(vector double)(__a) * \3377(vector double)(vector unsigned long long)((0x3ffULL + \3378((__b)&0x1F)) \3379<< 52); \3380__builtin_convertvector(__ret, vector signed long long); \3381}))33823383/* vec_ctul */33843385#define vec_ctul(__a, __b) \3386_Generic( \3387(__a), vector float \3388: __extension__({ \3389vector float __ret = \3390(vector float)(__a) * \3391(vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \3392__builtin_vsx_xvcvspuxds(__builtin_vsx_xxsldwi(__ret, __ret, 1)); \3393}), \3394vector double \3395: __extension__({ \3396vector double __ret = \3397(vector double)(__a) * \3398(vector double)(vector unsigned long long)((0x3ffULL + \3399((__b)&0x1F)) \3400<< 52); \3401__builtin_convertvector(__ret, vector unsigned long long); \3402}))3403#endif3404#else // __LITTLE_ENDIAN__3405/* vec_ctsl */34063407#ifdef __VSX__3408#define vec_ctsl(__a, __b) \3409_Generic((__a), \3410vector float: __extension__({ \3411vector float __ret = \3412(vector float)(__a) * \3413(vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) << 23); \3414__builtin_vsx_xvcvspsxds(__ret); \3415}), \3416vector double: __extension__({ \3417vector double __ret = \3418(vector double)(__a) * \3419(vector double)(vector unsigned long long)((0x3ffULL + \3420((__b)&0x1F)) \3421<< 52); \3422__builtin_convertvector(__ret, vector signed long long); \3423}))34243425/* vec_ctul */34263427#define vec_ctul(__a, __b) \3428_Generic((__a), vector float \3429: __extension__({ \3430vector float __ret = \3431(vector float)(__a) * \3432(vector float)(vector unsigned)((0x7f + ((__b)&0x1F)) \3433<< 23); \3434__builtin_vsx_xvcvspuxds(__ret); \3435}), \3436vector double \3437: __extension__({ \3438vector double __ret = \3439(vector double)(__a) * \3440(vector double)(vector unsigned long long)((0x3ffULL + \3441((__b)&0x1F)) \3442<< 52); \3443__builtin_convertvector(__ret, vector unsigned long long); \3444}))3445#endif3446#endif // __LITTLE_ENDIAN__34473448/* vec_vctuxs */34493450#define vec_vctuxs __builtin_altivec_vctuxs34513452/* vec_signext */34533454#ifdef __POWER9_VECTOR__3455static __inline__ vector signed int __ATTRS_o_ai3456vec_signexti(vector signed char __a) {3457return __builtin_altivec_vextsb2w(__a);3458}34593460static __inline__ vector signed int __ATTRS_o_ai3461vec_signexti(vector signed short __a) {3462return __builtin_altivec_vextsh2w(__a);3463}34643465static __inline__ vector signed long long __ATTRS_o_ai3466vec_signextll(vector signed char __a) {3467return __builtin_altivec_vextsb2d(__a);3468}34693470static __inline__ vector signed long long __ATTRS_o_ai3471vec_signextll(vector signed short __a) {3472return __builtin_altivec_vextsh2d(__a);3473}34743475static __inline__ vector signed long long __ATTRS_o_ai3476vec_signextll(vector signed int __a) {3477return __builtin_altivec_vextsw2d(__a);3478}3479#endif34803481#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)3482static __inline__ vector signed __int128 __ATTRS_o_ai3483vec_signextq(vector signed long long __a) {3484return __builtin_altivec_vextsd2q(__a);3485}3486#endif34873488/* vec_signed */34893490static __inline__ vector signed int __ATTRS_o_ai3491vec_sld(vector signed int, vector signed int, unsigned const int __c);34923493static __inline__ vector signed int __ATTRS_o_ai3494vec_signed(vector float __a) {3495return __builtin_convertvector(__a, vector signed int);3496}34973498#ifdef __VSX__3499static __inline__ vector signed long long __ATTRS_o_ai3500vec_signed(vector double __a) {3501return __builtin_convertvector(__a, vector signed long long);3502}35033504static __inline__ vector signed int __attribute__((__always_inline__))3505vec_signed2(vector double __a, vector double __b) {3506return (vector signed int) { __a[0], __a[1], __b[0], __b[1] };3507}35083509static __inline__ vector signed int __ATTRS_o_ai3510vec_signede(vector double __a) {3511#ifdef __LITTLE_ENDIAN__3512vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);3513return vec_sld(__ret, __ret, 12);3514#else3515return __builtin_vsx_xvcvdpsxws(__a);3516#endif3517}35183519static __inline__ vector signed int __ATTRS_o_ai3520vec_signedo(vector double __a) {3521#ifdef __LITTLE_ENDIAN__3522return __builtin_vsx_xvcvdpsxws(__a);3523#else3524vector signed int __ret = __builtin_vsx_xvcvdpsxws(__a);3525return vec_sld(__ret, __ret, 12);3526#endif3527}3528#endif35293530/* vec_unsigned */35313532static __inline__ vector unsigned int __ATTRS_o_ai3533vec_sld(vector unsigned int, vector unsigned int, unsigned const int __c);35343535static __inline__ vector unsigned int __ATTRS_o_ai3536vec_unsigned(vector float __a) {3537return __builtin_convertvector(__a, vector unsigned int);3538}35393540#ifdef __VSX__3541static __inline__ vector unsigned long long __ATTRS_o_ai3542vec_unsigned(vector double __a) {3543return __builtin_convertvector(__a, vector unsigned long long);3544}35453546static __inline__ vector unsigned int __attribute__((__always_inline__))3547vec_unsigned2(vector double __a, vector double __b) {3548return (vector unsigned int) { __a[0], __a[1], __b[0], __b[1] };3549}35503551static __inline__ vector unsigned int __ATTRS_o_ai3552vec_unsignede(vector double __a) {3553#ifdef __LITTLE_ENDIAN__3554vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);3555return vec_sld(__ret, __ret, 12);3556#else3557return __builtin_vsx_xvcvdpuxws(__a);3558#endif3559}35603561static __inline__ vector unsigned int __ATTRS_o_ai3562vec_unsignedo(vector double __a) {3563#ifdef __LITTLE_ENDIAN__3564return __builtin_vsx_xvcvdpuxws(__a);3565#else3566vector unsigned int __ret = __builtin_vsx_xvcvdpuxws(__a);3567return vec_sld(__ret, __ret, 12);3568#endif3569}3570#endif35713572/* vec_float */35733574static __inline__ vector float __ATTRS_o_ai3575vec_sld(vector float, vector float, unsigned const int __c);35763577static __inline__ vector float __ATTRS_o_ai3578vec_float(vector signed int __a) {3579return __builtin_convertvector(__a, vector float);3580}35813582static __inline__ vector float __ATTRS_o_ai3583vec_float(vector unsigned int __a) {3584return __builtin_convertvector(__a, vector float);3585}35863587#ifdef __VSX__3588static __inline__ vector float __ATTRS_o_ai3589vec_float2(vector signed long long __a, vector signed long long __b) {3590return (vector float) { __a[0], __a[1], __b[0], __b[1] };3591}35923593static __inline__ vector float __ATTRS_o_ai3594vec_float2(vector unsigned long long __a, vector unsigned long long __b) {3595return (vector float) { __a[0], __a[1], __b[0], __b[1] };3596}35973598static __inline__ vector float __ATTRS_o_ai3599vec_float2(vector double __a, vector double __b) {3600return (vector float) { __a[0], __a[1], __b[0], __b[1] };3601}36023603static __inline__ vector float __ATTRS_o_ai3604vec_floate(vector signed long long __a) {3605#ifdef __LITTLE_ENDIAN__3606vector float __ret = __builtin_vsx_xvcvsxdsp(__a);3607return vec_sld(__ret, __ret, 12);3608#else3609return __builtin_vsx_xvcvsxdsp(__a);3610#endif3611}36123613static __inline__ vector float __ATTRS_o_ai3614vec_floate(vector unsigned long long __a) {3615#ifdef __LITTLE_ENDIAN__3616vector float __ret = __builtin_vsx_xvcvuxdsp(__a);3617return vec_sld(__ret, __ret, 12);3618#else3619return __builtin_vsx_xvcvuxdsp(__a);3620#endif3621}36223623static __inline__ vector float __ATTRS_o_ai3624vec_floate(vector double __a) {3625#ifdef __LITTLE_ENDIAN__3626vector float __ret = __builtin_vsx_xvcvdpsp(__a);3627return vec_sld(__ret, __ret, 12);3628#else3629return __builtin_vsx_xvcvdpsp(__a);3630#endif3631}36323633static __inline__ vector float __ATTRS_o_ai3634vec_floato(vector signed long long __a) {3635#ifdef __LITTLE_ENDIAN__3636return __builtin_vsx_xvcvsxdsp(__a);3637#else3638vector float __ret = __builtin_vsx_xvcvsxdsp(__a);3639return vec_sld(__ret, __ret, 12);3640#endif3641}36423643static __inline__ vector float __ATTRS_o_ai3644vec_floato(vector unsigned long long __a) {3645#ifdef __LITTLE_ENDIAN__3646return __builtin_vsx_xvcvuxdsp(__a);3647#else3648vector float __ret = __builtin_vsx_xvcvuxdsp(__a);3649return vec_sld(__ret, __ret, 12);3650#endif3651}36523653static __inline__ vector float __ATTRS_o_ai3654vec_floato(vector double __a) {3655#ifdef __LITTLE_ENDIAN__3656return __builtin_vsx_xvcvdpsp(__a);3657#else3658vector float __ret = __builtin_vsx_xvcvdpsp(__a);3659return vec_sld(__ret, __ret, 12);3660#endif3661}3662#endif36633664/* vec_double */36653666#ifdef __VSX__3667static __inline__ vector double __ATTRS_o_ai3668vec_double(vector signed long long __a) {3669return __builtin_convertvector(__a, vector double);3670}36713672static __inline__ vector double __ATTRS_o_ai3673vec_double(vector unsigned long long __a) {3674return __builtin_convertvector(__a, vector double);3675}36763677static __inline__ vector double __ATTRS_o_ai3678vec_doublee(vector signed int __a) {3679#ifdef __LITTLE_ENDIAN__3680return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));3681#else3682return __builtin_vsx_xvcvsxwdp(__a);3683#endif3684}36853686static __inline__ vector double __ATTRS_o_ai3687vec_doublee(vector unsigned int __a) {3688#ifdef __LITTLE_ENDIAN__3689return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));3690#else3691return __builtin_vsx_xvcvuxwdp(__a);3692#endif3693}36943695static __inline__ vector double __ATTRS_o_ai3696vec_doublee(vector float __a) {3697#ifdef __LITTLE_ENDIAN__3698return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));3699#else3700return __builtin_vsx_xvcvspdp(__a);3701#endif3702}37033704static __inline__ vector double __ATTRS_o_ai3705vec_doubleh(vector signed int __a) {3706vector double __ret = {__a[0], __a[1]};3707return __ret;3708}37093710static __inline__ vector double __ATTRS_o_ai3711vec_doubleh(vector unsigned int __a) {3712vector double __ret = {__a[0], __a[1]};3713return __ret;3714}37153716static __inline__ vector double __ATTRS_o_ai3717vec_doubleh(vector float __a) {3718vector double __ret = {__a[0], __a[1]};3719return __ret;3720}37213722static __inline__ vector double __ATTRS_o_ai3723vec_doublel(vector signed int __a) {3724vector double __ret = {__a[2], __a[3]};3725return __ret;3726}37273728static __inline__ vector double __ATTRS_o_ai3729vec_doublel(vector unsigned int __a) {3730vector double __ret = {__a[2], __a[3]};3731return __ret;3732}37333734static __inline__ vector double __ATTRS_o_ai3735vec_doublel(vector float __a) {3736vector double __ret = {__a[2], __a[3]};3737return __ret;3738}37393740static __inline__ vector double __ATTRS_o_ai3741vec_doubleo(vector signed int __a) {3742#ifdef __LITTLE_ENDIAN__3743return __builtin_vsx_xvcvsxwdp(__a);3744#else3745return __builtin_vsx_xvcvsxwdp(vec_sld(__a, __a, 4));3746#endif3747}37483749static __inline__ vector double __ATTRS_o_ai3750vec_doubleo(vector unsigned int __a) {3751#ifdef __LITTLE_ENDIAN__3752return __builtin_vsx_xvcvuxwdp(__a);3753#else3754return __builtin_vsx_xvcvuxwdp(vec_sld(__a, __a, 4));3755#endif3756}37573758static __inline__ vector double __ATTRS_o_ai3759vec_doubleo(vector float __a) {3760#ifdef __LITTLE_ENDIAN__3761return __builtin_vsx_xvcvspdp(__a);3762#else3763return __builtin_vsx_xvcvspdp(vec_sld(__a, __a, 4));3764#endif3765}37663767/* vec_cvf */3768static __inline__ vector double __ATTRS_o_ai vec_cvf(vector float __a) {3769return vec_doublee(__a);3770}37713772static __inline__ vector float __ATTRS_o_ai vec_cvf(vector double __a) {3773return vec_floate(__a);3774}3775#endif37763777/* vec_div */37783779/* Integer vector divides (vectors are scalarized, elements divided3780and the vectors reassembled).3781*/3782static __inline__ vector signed char __ATTRS_o_ai3783vec_div(vector signed char __a, vector signed char __b) {3784return __a / __b;3785}37863787static __inline__ vector unsigned char __ATTRS_o_ai3788vec_div(vector unsigned char __a, vector unsigned char __b) {3789return __a / __b;3790}37913792static __inline__ vector signed short __ATTRS_o_ai3793vec_div(vector signed short __a, vector signed short __b) {3794return __a / __b;3795}37963797static __inline__ vector unsigned short __ATTRS_o_ai3798vec_div(vector unsigned short __a, vector unsigned short __b) {3799return __a / __b;3800}38013802static __inline__ vector signed int __ATTRS_o_ai3803vec_div(vector signed int __a, vector signed int __b) {3804return __a / __b;3805}38063807static __inline__ vector unsigned int __ATTRS_o_ai3808vec_div(vector unsigned int __a, vector unsigned int __b) {3809return __a / __b;3810}38113812#ifdef __VSX__3813static __inline__ vector signed long long __ATTRS_o_ai3814vec_div(vector signed long long __a, vector signed long long __b) {3815return __a / __b;3816}38173818static __inline__ vector unsigned long long __ATTRS_o_ai3819vec_div(vector unsigned long long __a, vector unsigned long long __b) {3820return __a / __b;3821}38223823static __inline__ vector float __ATTRS_o_ai vec_div(vector float __a,3824vector float __b) {3825return __a / __b;3826}38273828static __inline__ vector double __ATTRS_o_ai vec_div(vector double __a,3829vector double __b) {3830return __a / __b;3831}3832#endif38333834/* vec_dive */38353836#ifdef __POWER10_VECTOR__3837static __inline__ vector signed int __ATTRS_o_ai3838vec_dive(vector signed int __a, vector signed int __b) {3839return __builtin_altivec_vdivesw(__a, __b);3840}38413842static __inline__ vector unsigned int __ATTRS_o_ai3843vec_dive(vector unsigned int __a, vector unsigned int __b) {3844return __builtin_altivec_vdiveuw(__a, __b);3845}38463847static __inline__ vector signed long long __ATTRS_o_ai3848vec_dive(vector signed long long __a, vector signed long long __b) {3849return __builtin_altivec_vdivesd(__a, __b);3850}38513852static __inline__ vector unsigned long long __ATTRS_o_ai3853vec_dive(vector unsigned long long __a, vector unsigned long long __b) {3854return __builtin_altivec_vdiveud(__a, __b);3855}38563857#ifdef __SIZEOF_INT128__3858static __inline__ vector unsigned __int128 __ATTRS_o_ai3859vec_dive(vector unsigned __int128 __a, vector unsigned __int128 __b) {3860return __builtin_altivec_vdiveuq(__a, __b);3861}38623863static __inline__ vector signed __int128 __ATTRS_o_ai3864vec_dive(vector signed __int128 __a, vector signed __int128 __b) {3865return __builtin_altivec_vdivesq(__a, __b);3866}3867#endif3868#endif38693870#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)3871static __inline__ vector unsigned __int128 __ATTRS_o_ai3872vec_div(vector unsigned __int128 __a, vector unsigned __int128 __b) {3873return __a / __b;3874}38753876static __inline__ vector signed __int128 __ATTRS_o_ai3877vec_div(vector signed __int128 __a, vector signed __int128 __b) {3878return __a / __b;3879}3880#endif /* __POWER10_VECTOR__ */38813882/* vec_xvtdiv */38833884#ifdef __VSX__3885static __inline__ int __ATTRS_o_ai vec_test_swdiv(vector double __a,3886vector double __b) {3887return __builtin_vsx_xvtdivdp(__a, __b);3888}38893890static __inline__ int __ATTRS_o_ai vec_test_swdivs(vector float __a,3891vector float __b) {3892return __builtin_vsx_xvtdivsp(__a, __b);3893}3894#endif38953896/* vec_dss */38973898#define vec_dss __builtin_altivec_dss38993900/* vec_dssall */39013902static __inline__ void __attribute__((__always_inline__)) vec_dssall(void) {3903__builtin_altivec_dssall();3904}39053906/* vec_dst */3907#define vec_dst(__PTR, __CW, __STR) \3908__builtin_altivec_dst((const void *)(__PTR), (__CW), (__STR))39093910/* vec_dstst */3911#define vec_dstst(__PTR, __CW, __STR) \3912__builtin_altivec_dstst((const void *)(__PTR), (__CW), (__STR))39133914/* vec_dststt */3915#define vec_dststt(__PTR, __CW, __STR) \3916__builtin_altivec_dststt((const void *)(__PTR), (__CW), (__STR))39173918/* vec_dstt */3919#define vec_dstt(__PTR, __CW, __STR) \3920__builtin_altivec_dstt((const void *)(__PTR), (__CW), (__STR))39213922/* vec_eqv */39233924#ifdef __POWER8_VECTOR__3925static __inline__ vector signed char __ATTRS_o_ai3926vec_eqv(vector signed char __a, vector signed char __b) {3927return (vector signed char)__builtin_vsx_xxleqv((vector unsigned int)__a,3928(vector unsigned int)__b);3929}39303931static __inline__ vector unsigned char __ATTRS_o_ai3932vec_eqv(vector unsigned char __a, vector unsigned char __b) {3933return (vector unsigned char)__builtin_vsx_xxleqv((vector unsigned int)__a,3934(vector unsigned int)__b);3935}39363937static __inline__ vector bool char __ATTRS_o_ai vec_eqv(vector bool char __a,3938vector bool char __b) {3939return (vector bool char)__builtin_vsx_xxleqv((vector unsigned int)__a,3940(vector unsigned int)__b);3941}39423943static __inline__ vector signed short __ATTRS_o_ai3944vec_eqv(vector signed short __a, vector signed short __b) {3945return (vector signed short)__builtin_vsx_xxleqv((vector unsigned int)__a,3946(vector unsigned int)__b);3947}39483949static __inline__ vector unsigned short __ATTRS_o_ai3950vec_eqv(vector unsigned short __a, vector unsigned short __b) {3951return (vector unsigned short)__builtin_vsx_xxleqv((vector unsigned int)__a,3952(vector unsigned int)__b);3953}39543955static __inline__ vector bool short __ATTRS_o_ai3956vec_eqv(vector bool short __a, vector bool short __b) {3957return (vector bool short)__builtin_vsx_xxleqv((vector unsigned int)__a,3958(vector unsigned int)__b);3959}39603961static __inline__ vector signed int __ATTRS_o_ai3962vec_eqv(vector signed int __a, vector signed int __b) {3963return (vector signed int)__builtin_vsx_xxleqv((vector unsigned int)__a,3964(vector unsigned int)__b);3965}39663967static __inline__ vector unsigned int __ATTRS_o_ai3968vec_eqv(vector unsigned int __a, vector unsigned int __b) {3969return __builtin_vsx_xxleqv(__a, __b);3970}39713972static __inline__ vector bool int __ATTRS_o_ai vec_eqv(vector bool int __a,3973vector bool int __b) {3974return (vector bool int)__builtin_vsx_xxleqv((vector unsigned int)__a,3975(vector unsigned int)__b);3976}39773978static __inline__ vector signed long long __ATTRS_o_ai3979vec_eqv(vector signed long long __a, vector signed long long __b) {3980return (vector signed long long)__builtin_vsx_xxleqv(3981(vector unsigned int)__a, (vector unsigned int)__b);3982}39833984static __inline__ vector unsigned long long __ATTRS_o_ai3985vec_eqv(vector unsigned long long __a, vector unsigned long long __b) {3986return (vector unsigned long long)__builtin_vsx_xxleqv(3987(vector unsigned int)__a, (vector unsigned int)__b);3988}39893990static __inline__ vector bool long long __ATTRS_o_ai3991vec_eqv(vector bool long long __a, vector bool long long __b) {3992return (vector bool long long)__builtin_vsx_xxleqv((vector unsigned int)__a,3993(vector unsigned int)__b);3994}39953996static __inline__ vector float __ATTRS_o_ai vec_eqv(vector float __a,3997vector float __b) {3998return (vector float)__builtin_vsx_xxleqv((vector unsigned int)__a,3999(vector unsigned int)__b);4000}40014002static __inline__ vector double __ATTRS_o_ai vec_eqv(vector double __a,4003vector double __b) {4004return (vector double)__builtin_vsx_xxleqv((vector unsigned int)__a,4005(vector unsigned int)__b);4006}4007#endif40084009/* vec_expte */40104011static __inline__ vector float __attribute__((__always_inline__))4012vec_expte(vector float __a) {4013return __builtin_altivec_vexptefp(__a);4014}40154016/* vec_vexptefp */40174018static __inline__ vector float __attribute__((__always_inline__))4019vec_vexptefp(vector float __a) {4020return __builtin_altivec_vexptefp(__a);4021}40224023/* vec_floor */40244025static __inline__ vector float __ATTRS_o_ai vec_floor(vector float __a) {4026#ifdef __VSX__4027return __builtin_vsx_xvrspim(__a);4028#else4029return __builtin_altivec_vrfim(__a);4030#endif4031}40324033#ifdef __VSX__4034static __inline__ vector double __ATTRS_o_ai vec_floor(vector double __a) {4035return __builtin_vsx_xvrdpim(__a);4036}4037#endif40384039/* vec_roundm */4040static __inline__ vector float __ATTRS_o_ai vec_roundm(vector float __a) {4041return vec_floor(__a);4042}40434044#ifdef __VSX__4045static __inline__ vector double __ATTRS_o_ai vec_roundm(vector double __a) {4046return vec_floor(__a);4047}4048#endif40494050/* vec_vrfim */40514052static __inline__ vector float __attribute__((__always_inline__))4053vec_vrfim(vector float __a) {4054return __builtin_altivec_vrfim(__a);4055}40564057/* vec_ld */40584059static __inline__ vector signed char __ATTRS_o_ai4060vec_ld(long __a, const vector signed char *__b) {4061return (vector signed char)__builtin_altivec_lvx(__a, __b);4062}40634064static __inline__ vector signed char __ATTRS_o_ai4065vec_ld(long __a, const signed char *__b) {4066return (vector signed char)__builtin_altivec_lvx(__a, __b);4067}40684069static __inline__ vector unsigned char __ATTRS_o_ai4070vec_ld(long __a, const vector unsigned char *__b) {4071return (vector unsigned char)__builtin_altivec_lvx(__a, __b);4072}40734074static __inline__ vector unsigned char __ATTRS_o_ai4075vec_ld(long __a, const unsigned char *__b) {4076return (vector unsigned char)__builtin_altivec_lvx(__a, __b);4077}40784079static __inline__ vector bool char __ATTRS_o_ai4080vec_ld(long __a, const vector bool char *__b) {4081return (vector bool char)__builtin_altivec_lvx(__a, __b);4082}40834084static __inline__ vector short __ATTRS_o_ai vec_ld(long __a,4085const vector short *__b) {4086return (vector short)__builtin_altivec_lvx(__a, __b);4087}40884089static __inline__ vector short __ATTRS_o_ai vec_ld(long __a, const short *__b) {4090return (vector short)__builtin_altivec_lvx(__a, __b);4091}40924093static __inline__ vector unsigned short __ATTRS_o_ai4094vec_ld(long __a, const vector unsigned short *__b) {4095return (vector unsigned short)__builtin_altivec_lvx(__a, __b);4096}40974098static __inline__ vector unsigned short __ATTRS_o_ai4099vec_ld(long __a, const unsigned short *__b) {4100return (vector unsigned short)__builtin_altivec_lvx(__a, __b);4101}41024103static __inline__ vector bool short __ATTRS_o_ai4104vec_ld(long __a, const vector bool short *__b) {4105return (vector bool short)__builtin_altivec_lvx(__a, __b);4106}41074108static __inline__ vector pixel __ATTRS_o_ai vec_ld(long __a,4109const vector pixel *__b) {4110return (vector pixel)__builtin_altivec_lvx(__a, __b);4111}41124113static __inline__ vector int __ATTRS_o_ai vec_ld(long __a,4114const vector int *__b) {4115return (vector int)__builtin_altivec_lvx(__a, __b);4116}41174118static __inline__ vector int __ATTRS_o_ai vec_ld(long __a, const int *__b) {4119return (vector int)__builtin_altivec_lvx(__a, __b);4120}41214122static __inline__ vector unsigned int __ATTRS_o_ai4123vec_ld(long __a, const vector unsigned int *__b) {4124return (vector unsigned int)__builtin_altivec_lvx(__a, __b);4125}41264127static __inline__ vector unsigned int __ATTRS_o_ai4128vec_ld(long __a, const unsigned int *__b) {4129return (vector unsigned int)__builtin_altivec_lvx(__a, __b);4130}41314132static __inline__ vector bool int __ATTRS_o_ai4133vec_ld(long __a, const vector bool int *__b) {4134return (vector bool int)__builtin_altivec_lvx(__a, __b);4135}41364137static __inline__ vector float __ATTRS_o_ai vec_ld(long __a,4138const vector float *__b) {4139return (vector float)__builtin_altivec_lvx(__a, __b);4140}41414142static __inline__ vector float __ATTRS_o_ai vec_ld(long __a, const float *__b) {4143return (vector float)__builtin_altivec_lvx(__a, __b);4144}41454146/* vec_lvx */41474148static __inline__ vector signed char __ATTRS_o_ai4149vec_lvx(long __a, const vector signed char *__b) {4150return (vector signed char)__builtin_altivec_lvx(__a, __b);4151}41524153static __inline__ vector signed char __ATTRS_o_ai4154vec_lvx(long __a, const signed char *__b) {4155return (vector signed char)__builtin_altivec_lvx(__a, __b);4156}41574158static __inline__ vector unsigned char __ATTRS_o_ai4159vec_lvx(long __a, const vector unsigned char *__b) {4160return (vector unsigned char)__builtin_altivec_lvx(__a, __b);4161}41624163static __inline__ vector unsigned char __ATTRS_o_ai4164vec_lvx(long __a, const unsigned char *__b) {4165return (vector unsigned char)__builtin_altivec_lvx(__a, __b);4166}41674168static __inline__ vector bool char __ATTRS_o_ai4169vec_lvx(long __a, const vector bool char *__b) {4170return (vector bool char)__builtin_altivec_lvx(__a, __b);4171}41724173static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a,4174const vector short *__b) {4175return (vector short)__builtin_altivec_lvx(__a, __b);4176}41774178static __inline__ vector short __ATTRS_o_ai vec_lvx(long __a, const short *__b) {4179return (vector short)__builtin_altivec_lvx(__a, __b);4180}41814182static __inline__ vector unsigned short __ATTRS_o_ai4183vec_lvx(long __a, const vector unsigned short *__b) {4184return (vector unsigned short)__builtin_altivec_lvx(__a, __b);4185}41864187static __inline__ vector unsigned short __ATTRS_o_ai4188vec_lvx(long __a, const unsigned short *__b) {4189return (vector unsigned short)__builtin_altivec_lvx(__a, __b);4190}41914192static __inline__ vector bool short __ATTRS_o_ai4193vec_lvx(long __a, const vector bool short *__b) {4194return (vector bool short)__builtin_altivec_lvx(__a, __b);4195}41964197static __inline__ vector pixel __ATTRS_o_ai vec_lvx(long __a,4198const vector pixel *__b) {4199return (vector pixel)__builtin_altivec_lvx(__a, __b);4200}42014202static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a,4203const vector int *__b) {4204return (vector int)__builtin_altivec_lvx(__a, __b);4205}42064207static __inline__ vector int __ATTRS_o_ai vec_lvx(long __a, const int *__b) {4208return (vector int)__builtin_altivec_lvx(__a, __b);4209}42104211static __inline__ vector unsigned int __ATTRS_o_ai4212vec_lvx(long __a, const vector unsigned int *__b) {4213return (vector unsigned int)__builtin_altivec_lvx(__a, __b);4214}42154216static __inline__ vector unsigned int __ATTRS_o_ai4217vec_lvx(long __a, const unsigned int *__b) {4218return (vector unsigned int)__builtin_altivec_lvx(__a, __b);4219}42204221static __inline__ vector bool int __ATTRS_o_ai4222vec_lvx(long __a, const vector bool int *__b) {4223return (vector bool int)__builtin_altivec_lvx(__a, __b);4224}42254226static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a,4227const vector float *__b) {4228return (vector float)__builtin_altivec_lvx(__a, __b);4229}42304231static __inline__ vector float __ATTRS_o_ai vec_lvx(long __a, const float *__b) {4232return (vector float)__builtin_altivec_lvx(__a, __b);4233}42344235/* vec_lde */42364237static __inline__ vector signed char __ATTRS_o_ai4238vec_lde(long __a, const signed char *__b) {4239return (vector signed char)__builtin_altivec_lvebx(__a, __b);4240}42414242static __inline__ vector unsigned char __ATTRS_o_ai4243vec_lde(long __a, const unsigned char *__b) {4244return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);4245}42464247static __inline__ vector short __ATTRS_o_ai vec_lde(long __a, const short *__b) {4248return (vector short)__builtin_altivec_lvehx(__a, __b);4249}42504251static __inline__ vector unsigned short __ATTRS_o_ai4252vec_lde(long __a, const unsigned short *__b) {4253return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);4254}42554256static __inline__ vector int __ATTRS_o_ai vec_lde(long __a, const int *__b) {4257return (vector int)__builtin_altivec_lvewx(__a, __b);4258}42594260static __inline__ vector unsigned int __ATTRS_o_ai4261vec_lde(long __a, const unsigned int *__b) {4262return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);4263}42644265static __inline__ vector float __ATTRS_o_ai vec_lde(long __a, const float *__b) {4266return (vector float)__builtin_altivec_lvewx(__a, __b);4267}42684269/* vec_lvebx */42704271static __inline__ vector signed char __ATTRS_o_ai4272vec_lvebx(long __a, const signed char *__b) {4273return (vector signed char)__builtin_altivec_lvebx(__a, __b);4274}42754276static __inline__ vector unsigned char __ATTRS_o_ai4277vec_lvebx(long __a, const unsigned char *__b) {4278return (vector unsigned char)__builtin_altivec_lvebx(__a, __b);4279}42804281/* vec_lvehx */42824283static __inline__ vector short __ATTRS_o_ai vec_lvehx(long __a,4284const short *__b) {4285return (vector short)__builtin_altivec_lvehx(__a, __b);4286}42874288static __inline__ vector unsigned short __ATTRS_o_ai4289vec_lvehx(long __a, const unsigned short *__b) {4290return (vector unsigned short)__builtin_altivec_lvehx(__a, __b);4291}42924293/* vec_lvewx */42944295static __inline__ vector int __ATTRS_o_ai vec_lvewx(long __a, const int *__b) {4296return (vector int)__builtin_altivec_lvewx(__a, __b);4297}42984299static __inline__ vector unsigned int __ATTRS_o_ai4300vec_lvewx(long __a, const unsigned int *__b) {4301return (vector unsigned int)__builtin_altivec_lvewx(__a, __b);4302}43034304static __inline__ vector float __ATTRS_o_ai vec_lvewx(long __a,4305const float *__b) {4306return (vector float)__builtin_altivec_lvewx(__a, __b);4307}43084309/* vec_ldl */43104311static __inline__ vector signed char __ATTRS_o_ai4312vec_ldl(long __a, const vector signed char *__b) {4313return (vector signed char)__builtin_altivec_lvxl(__a, __b);4314}43154316static __inline__ vector signed char __ATTRS_o_ai4317vec_ldl(long __a, const signed char *__b) {4318return (vector signed char)__builtin_altivec_lvxl(__a, __b);4319}43204321static __inline__ vector unsigned char __ATTRS_o_ai4322vec_ldl(long __a, const vector unsigned char *__b) {4323return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);4324}43254326static __inline__ vector unsigned char __ATTRS_o_ai4327vec_ldl(long __a, const unsigned char *__b) {4328return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);4329}43304331static __inline__ vector bool char __ATTRS_o_ai4332vec_ldl(long __a, const vector bool char *__b) {4333return (vector bool char)__builtin_altivec_lvxl(__a, __b);4334}43354336static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a,4337const vector short *__b) {4338return (vector short)__builtin_altivec_lvxl(__a, __b);4339}43404341static __inline__ vector short __ATTRS_o_ai vec_ldl(long __a, const short *__b) {4342return (vector short)__builtin_altivec_lvxl(__a, __b);4343}43444345static __inline__ vector unsigned short __ATTRS_o_ai4346vec_ldl(long __a, const vector unsigned short *__b) {4347return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);4348}43494350static __inline__ vector unsigned short __ATTRS_o_ai4351vec_ldl(long __a, const unsigned short *__b) {4352return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);4353}43544355static __inline__ vector bool short __ATTRS_o_ai4356vec_ldl(long __a, const vector bool short *__b) {4357return (vector bool short)__builtin_altivec_lvxl(__a, __b);4358}43594360static __inline__ vector pixel __ATTRS_o_ai vec_ldl(long __a,4361const vector pixel *__b) {4362return (vector pixel short)__builtin_altivec_lvxl(__a, __b);4363}43644365static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a,4366const vector int *__b) {4367return (vector int)__builtin_altivec_lvxl(__a, __b);4368}43694370static __inline__ vector int __ATTRS_o_ai vec_ldl(long __a, const int *__b) {4371return (vector int)__builtin_altivec_lvxl(__a, __b);4372}43734374static __inline__ vector unsigned int __ATTRS_o_ai4375vec_ldl(long __a, const vector unsigned int *__b) {4376return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);4377}43784379static __inline__ vector unsigned int __ATTRS_o_ai4380vec_ldl(long __a, const unsigned int *__b) {4381return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);4382}43834384static __inline__ vector bool int __ATTRS_o_ai4385vec_ldl(long __a, const vector bool int *__b) {4386return (vector bool int)__builtin_altivec_lvxl(__a, __b);4387}43884389static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a,4390const vector float *__b) {4391return (vector float)__builtin_altivec_lvxl(__a, __b);4392}43934394static __inline__ vector float __ATTRS_o_ai vec_ldl(long __a, const float *__b) {4395return (vector float)__builtin_altivec_lvxl(__a, __b);4396}43974398/* vec_lvxl */43994400static __inline__ vector signed char __ATTRS_o_ai4401vec_lvxl(long __a, const vector signed char *__b) {4402return (vector signed char)__builtin_altivec_lvxl(__a, __b);4403}44044405static __inline__ vector signed char __ATTRS_o_ai4406vec_lvxl(long __a, const signed char *__b) {4407return (vector signed char)__builtin_altivec_lvxl(__a, __b);4408}44094410static __inline__ vector unsigned char __ATTRS_o_ai4411vec_lvxl(long __a, const vector unsigned char *__b) {4412return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);4413}44144415static __inline__ vector unsigned char __ATTRS_o_ai4416vec_lvxl(long __a, const unsigned char *__b) {4417return (vector unsigned char)__builtin_altivec_lvxl(__a, __b);4418}44194420static __inline__ vector bool char __ATTRS_o_ai4421vec_lvxl(long __a, const vector bool char *__b) {4422return (vector bool char)__builtin_altivec_lvxl(__a, __b);4423}44244425static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,4426const vector short *__b) {4427return (vector short)__builtin_altivec_lvxl(__a, __b);4428}44294430static __inline__ vector short __ATTRS_o_ai vec_lvxl(long __a,4431const short *__b) {4432return (vector short)__builtin_altivec_lvxl(__a, __b);4433}44344435static __inline__ vector unsigned short __ATTRS_o_ai4436vec_lvxl(long __a, const vector unsigned short *__b) {4437return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);4438}44394440static __inline__ vector unsigned short __ATTRS_o_ai4441vec_lvxl(long __a, const unsigned short *__b) {4442return (vector unsigned short)__builtin_altivec_lvxl(__a, __b);4443}44444445static __inline__ vector bool short __ATTRS_o_ai4446vec_lvxl(long __a, const vector bool short *__b) {4447return (vector bool short)__builtin_altivec_lvxl(__a, __b);4448}44494450static __inline__ vector pixel __ATTRS_o_ai vec_lvxl(long __a,4451const vector pixel *__b) {4452return (vector pixel)__builtin_altivec_lvxl(__a, __b);4453}44544455static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a,4456const vector int *__b) {4457return (vector int)__builtin_altivec_lvxl(__a, __b);4458}44594460static __inline__ vector int __ATTRS_o_ai vec_lvxl(long __a, const int *__b) {4461return (vector int)__builtin_altivec_lvxl(__a, __b);4462}44634464static __inline__ vector unsigned int __ATTRS_o_ai4465vec_lvxl(long __a, const vector unsigned int *__b) {4466return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);4467}44684469static __inline__ vector unsigned int __ATTRS_o_ai4470vec_lvxl(long __a, const unsigned int *__b) {4471return (vector unsigned int)__builtin_altivec_lvxl(__a, __b);4472}44734474static __inline__ vector bool int __ATTRS_o_ai4475vec_lvxl(long __a, const vector bool int *__b) {4476return (vector bool int)__builtin_altivec_lvxl(__a, __b);4477}44784479static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,4480const vector float *__b) {4481return (vector float)__builtin_altivec_lvxl(__a, __b);4482}44834484static __inline__ vector float __ATTRS_o_ai vec_lvxl(long __a,4485const float *__b) {4486return (vector float)__builtin_altivec_lvxl(__a, __b);4487}44884489/* vec_loge */44904491static __inline__ vector float __attribute__((__always_inline__))4492vec_loge(vector float __a) {4493return __builtin_altivec_vlogefp(__a);4494}44954496/* vec_vlogefp */44974498static __inline__ vector float __attribute__((__always_inline__))4499vec_vlogefp(vector float __a) {4500return __builtin_altivec_vlogefp(__a);4501}45024503/* vec_lvsl */45044505#ifdef __LITTLE_ENDIAN__4506static __inline__ vector unsigned char __ATTRS_o_ai4507__attribute__((__deprecated__("use assignment for unaligned little endian \4508loads/stores"))) vec_lvsl(int __a, const signed char *__b) {4509vector unsigned char mask =4510(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4511vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45127, 6, 5, 4, 3, 2, 1, 0};4513return vec_perm(mask, mask, reverse);4514}4515#else4516static __inline__ vector unsigned char __ATTRS_o_ai4517vec_lvsl(int __a, const signed char *__b) {4518return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4519}4520#endif45214522#ifdef __LITTLE_ENDIAN__4523static __inline__ vector unsigned char __ATTRS_o_ai4524__attribute__((__deprecated__("use assignment for unaligned little endian \4525loads/stores"))) vec_lvsl(int __a, const unsigned char *__b) {4526vector unsigned char mask =4527(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4528vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45297, 6, 5, 4, 3, 2, 1, 0};4530return vec_perm(mask, mask, reverse);4531}4532#else4533static __inline__ vector unsigned char __ATTRS_o_ai4534vec_lvsl(int __a, const unsigned char *__b) {4535return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4536}4537#endif45384539#ifdef __LITTLE_ENDIAN__4540static __inline__ vector unsigned char __ATTRS_o_ai4541__attribute__((__deprecated__("use assignment for unaligned little endian \4542loads/stores"))) vec_lvsl(int __a, const short *__b) {4543vector unsigned char mask =4544(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4545vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45467, 6, 5, 4, 3, 2, 1, 0};4547return vec_perm(mask, mask, reverse);4548}4549#else4550static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,4551const short *__b) {4552return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4553}4554#endif45554556#ifdef __LITTLE_ENDIAN__4557static __inline__ vector unsigned char __ATTRS_o_ai4558__attribute__((__deprecated__("use assignment for unaligned little endian \4559loads/stores"))) vec_lvsl(int __a, const unsigned short *__b) {4560vector unsigned char mask =4561(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4562vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45637, 6, 5, 4, 3, 2, 1, 0};4564return vec_perm(mask, mask, reverse);4565}4566#else4567static __inline__ vector unsigned char __ATTRS_o_ai4568vec_lvsl(int __a, const unsigned short *__b) {4569return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4570}4571#endif45724573#ifdef __LITTLE_ENDIAN__4574static __inline__ vector unsigned char __ATTRS_o_ai4575__attribute__((__deprecated__("use assignment for unaligned little endian \4576loads/stores"))) vec_lvsl(int __a, const int *__b) {4577vector unsigned char mask =4578(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4579vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45807, 6, 5, 4, 3, 2, 1, 0};4581return vec_perm(mask, mask, reverse);4582}4583#else4584static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,4585const int *__b) {4586return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4587}4588#endif45894590#ifdef __LITTLE_ENDIAN__4591static __inline__ vector unsigned char __ATTRS_o_ai4592__attribute__((__deprecated__("use assignment for unaligned little endian \4593loads/stores"))) vec_lvsl(int __a, const unsigned int *__b) {4594vector unsigned char mask =4595(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4596vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,45977, 6, 5, 4, 3, 2, 1, 0};4598return vec_perm(mask, mask, reverse);4599}4600#else4601static __inline__ vector unsigned char __ATTRS_o_ai4602vec_lvsl(int __a, const unsigned int *__b) {4603return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4604}4605#endif46064607#ifdef __LITTLE_ENDIAN__4608static __inline__ vector unsigned char __ATTRS_o_ai4609__attribute__((__deprecated__("use assignment for unaligned little endian \4610loads/stores"))) vec_lvsl(int __a, const float *__b) {4611vector unsigned char mask =4612(vector unsigned char)__builtin_altivec_lvsl(__a, __b);4613vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,46147, 6, 5, 4, 3, 2, 1, 0};4615return vec_perm(mask, mask, reverse);4616}4617#else4618static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsl(int __a,4619const float *__b) {4620return (vector unsigned char)__builtin_altivec_lvsl(__a, __b);4621}4622#endif46234624/* vec_lvsr */46254626#ifdef __LITTLE_ENDIAN__4627static __inline__ vector unsigned char __ATTRS_o_ai4628__attribute__((__deprecated__("use assignment for unaligned little endian \4629loads/stores"))) vec_lvsr(int __a, const signed char *__b) {4630vector unsigned char mask =4631(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4632vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,46337, 6, 5, 4, 3, 2, 1, 0};4634return vec_perm(mask, mask, reverse);4635}4636#else4637static __inline__ vector unsigned char __ATTRS_o_ai4638vec_lvsr(int __a, const signed char *__b) {4639return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4640}4641#endif46424643#ifdef __LITTLE_ENDIAN__4644static __inline__ vector unsigned char __ATTRS_o_ai4645__attribute__((__deprecated__("use assignment for unaligned little endian \4646loads/stores"))) vec_lvsr(int __a, const unsigned char *__b) {4647vector unsigned char mask =4648(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4649vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,46507, 6, 5, 4, 3, 2, 1, 0};4651return vec_perm(mask, mask, reverse);4652}4653#else4654static __inline__ vector unsigned char __ATTRS_o_ai4655vec_lvsr(int __a, const unsigned char *__b) {4656return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4657}4658#endif46594660#ifdef __LITTLE_ENDIAN__4661static __inline__ vector unsigned char __ATTRS_o_ai4662__attribute__((__deprecated__("use assignment for unaligned little endian \4663loads/stores"))) vec_lvsr(int __a, const short *__b) {4664vector unsigned char mask =4665(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4666vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,46677, 6, 5, 4, 3, 2, 1, 0};4668return vec_perm(mask, mask, reverse);4669}4670#else4671static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,4672const short *__b) {4673return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4674}4675#endif46764677#ifdef __LITTLE_ENDIAN__4678static __inline__ vector unsigned char __ATTRS_o_ai4679__attribute__((__deprecated__("use assignment for unaligned little endian \4680loads/stores"))) vec_lvsr(int __a, const unsigned short *__b) {4681vector unsigned char mask =4682(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4683vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,46847, 6, 5, 4, 3, 2, 1, 0};4685return vec_perm(mask, mask, reverse);4686}4687#else4688static __inline__ vector unsigned char __ATTRS_o_ai4689vec_lvsr(int __a, const unsigned short *__b) {4690return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4691}4692#endif46934694#ifdef __LITTLE_ENDIAN__4695static __inline__ vector unsigned char __ATTRS_o_ai4696__attribute__((__deprecated__("use assignment for unaligned little endian \4697loads/stores"))) vec_lvsr(int __a, const int *__b) {4698vector unsigned char mask =4699(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4700vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,47017, 6, 5, 4, 3, 2, 1, 0};4702return vec_perm(mask, mask, reverse);4703}4704#else4705static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,4706const int *__b) {4707return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4708}4709#endif47104711#ifdef __LITTLE_ENDIAN__4712static __inline__ vector unsigned char __ATTRS_o_ai4713__attribute__((__deprecated__("use assignment for unaligned little endian \4714loads/stores"))) vec_lvsr(int __a, const unsigned int *__b) {4715vector unsigned char mask =4716(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4717vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,47187, 6, 5, 4, 3, 2, 1, 0};4719return vec_perm(mask, mask, reverse);4720}4721#else4722static __inline__ vector unsigned char __ATTRS_o_ai4723vec_lvsr(int __a, const unsigned int *__b) {4724return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4725}4726#endif47274728#ifdef __LITTLE_ENDIAN__4729static __inline__ vector unsigned char __ATTRS_o_ai4730__attribute__((__deprecated__("use assignment for unaligned little endian \4731loads/stores"))) vec_lvsr(int __a, const float *__b) {4732vector unsigned char mask =4733(vector unsigned char)__builtin_altivec_lvsr(__a, __b);4734vector unsigned char reverse = {15, 14, 13, 12, 11, 10, 9, 8,47357, 6, 5, 4, 3, 2, 1, 0};4736return vec_perm(mask, mask, reverse);4737}4738#else4739static __inline__ vector unsigned char __ATTRS_o_ai vec_lvsr(int __a,4740const float *__b) {4741return (vector unsigned char)__builtin_altivec_lvsr(__a, __b);4742}4743#endif47444745/* vec_madd */4746static __inline__ vector signed short __ATTRS_o_ai4747vec_mladd(vector signed short, vector signed short, vector signed short);4748static __inline__ vector signed short __ATTRS_o_ai4749vec_mladd(vector signed short, vector unsigned short, vector unsigned short);4750static __inline__ vector signed short __ATTRS_o_ai4751vec_mladd(vector unsigned short, vector signed short, vector signed short);4752static __inline__ vector unsigned short __ATTRS_o_ai4753vec_mladd(vector unsigned short, vector unsigned short, vector unsigned short);47544755static __inline__ vector signed short __ATTRS_o_ai vec_madd(4756vector signed short __a, vector signed short __b, vector signed short __c) {4757return vec_mladd(__a, __b, __c);4758}47594760static __inline__ vector signed short __ATTRS_o_ai4761vec_madd(vector signed short __a, vector unsigned short __b,4762vector unsigned short __c) {4763return vec_mladd(__a, __b, __c);4764}47654766static __inline__ vector signed short __ATTRS_o_ai4767vec_madd(vector unsigned short __a, vector signed short __b,4768vector signed short __c) {4769return vec_mladd(__a, __b, __c);4770}47714772static __inline__ vector unsigned short __ATTRS_o_ai4773vec_madd(vector unsigned short __a, vector unsigned short __b,4774vector unsigned short __c) {4775return vec_mladd(__a, __b, __c);4776}47774778static __inline__ vector float __ATTRS_o_ai vec_madd(vector float __a,4779vector float __b,4780vector float __c) {4781#ifdef __VSX__4782return __builtin_vsx_xvmaddasp(__a, __b, __c);4783#else4784return __builtin_altivec_vmaddfp(__a, __b, __c);4785#endif4786}47874788#ifdef __VSX__4789static __inline__ vector double __ATTRS_o_ai vec_madd(vector double __a,4790vector double __b,4791vector double __c) {4792return __builtin_vsx_xvmaddadp(__a, __b, __c);4793}4794#endif47954796/* vec_vmaddfp */47974798static __inline__ vector float __attribute__((__always_inline__))4799vec_vmaddfp(vector float __a, vector float __b, vector float __c) {4800return __builtin_altivec_vmaddfp(__a, __b, __c);4801}48024803/* vec_madds */48044805static __inline__ vector signed short __attribute__((__always_inline__))4806vec_madds(vector signed short __a, vector signed short __b,4807vector signed short __c) {4808return __builtin_altivec_vmhaddshs(__a, __b, __c);4809}48104811/* vec_vmhaddshs */4812static __inline__ vector signed short __attribute__((__always_inline__))4813vec_vmhaddshs(vector signed short __a, vector signed short __b,4814vector signed short __c) {4815return __builtin_altivec_vmhaddshs(__a, __b, __c);4816}48174818/* vec_msub */48194820#ifdef __VSX__4821static __inline__ vector float __ATTRS_o_ai vec_msub(vector float __a,4822vector float __b,4823vector float __c) {4824return __builtin_vsx_xvmsubasp(__a, __b, __c);4825}48264827static __inline__ vector double __ATTRS_o_ai vec_msub(vector double __a,4828vector double __b,4829vector double __c) {4830return __builtin_vsx_xvmsubadp(__a, __b, __c);4831}4832#endif48334834/* vec_max */48354836static __inline__ vector signed char __ATTRS_o_ai4837vec_max(vector signed char __a, vector signed char __b) {4838return __builtin_altivec_vmaxsb(__a, __b);4839}48404841static __inline__ vector signed char __ATTRS_o_ai4842vec_max(vector bool char __a, vector signed char __b) {4843return __builtin_altivec_vmaxsb((vector signed char)__a, __b);4844}48454846static __inline__ vector signed char __ATTRS_o_ai4847vec_max(vector signed char __a, vector bool char __b) {4848return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);4849}48504851static __inline__ vector unsigned char __ATTRS_o_ai4852vec_max(vector unsigned char __a, vector unsigned char __b) {4853return __builtin_altivec_vmaxub(__a, __b);4854}48554856static __inline__ vector unsigned char __ATTRS_o_ai4857vec_max(vector bool char __a, vector unsigned char __b) {4858return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);4859}48604861static __inline__ vector unsigned char __ATTRS_o_ai4862vec_max(vector unsigned char __a, vector bool char __b) {4863return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);4864}48654866static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,4867vector short __b) {4868return __builtin_altivec_vmaxsh(__a, __b);4869}48704871static __inline__ vector short __ATTRS_o_ai vec_max(vector bool short __a,4872vector short __b) {4873return __builtin_altivec_vmaxsh((vector short)__a, __b);4874}48754876static __inline__ vector short __ATTRS_o_ai vec_max(vector short __a,4877vector bool short __b) {4878return __builtin_altivec_vmaxsh(__a, (vector short)__b);4879}48804881static __inline__ vector unsigned short __ATTRS_o_ai4882vec_max(vector unsigned short __a, vector unsigned short __b) {4883return __builtin_altivec_vmaxuh(__a, __b);4884}48854886static __inline__ vector unsigned short __ATTRS_o_ai4887vec_max(vector bool short __a, vector unsigned short __b) {4888return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);4889}48904891static __inline__ vector unsigned short __ATTRS_o_ai4892vec_max(vector unsigned short __a, vector bool short __b) {4893return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);4894}48954896static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,4897vector int __b) {4898return __builtin_altivec_vmaxsw(__a, __b);4899}49004901static __inline__ vector int __ATTRS_o_ai vec_max(vector bool int __a,4902vector int __b) {4903return __builtin_altivec_vmaxsw((vector int)__a, __b);4904}49054906static __inline__ vector int __ATTRS_o_ai vec_max(vector int __a,4907vector bool int __b) {4908return __builtin_altivec_vmaxsw(__a, (vector int)__b);4909}49104911static __inline__ vector unsigned int __ATTRS_o_ai4912vec_max(vector unsigned int __a, vector unsigned int __b) {4913return __builtin_altivec_vmaxuw(__a, __b);4914}49154916static __inline__ vector unsigned int __ATTRS_o_ai4917vec_max(vector bool int __a, vector unsigned int __b) {4918return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);4919}49204921static __inline__ vector unsigned int __ATTRS_o_ai4922vec_max(vector unsigned int __a, vector bool int __b) {4923return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);4924}49254926#ifdef __POWER8_VECTOR__4927static __inline__ vector signed long long __ATTRS_o_ai4928vec_max(vector signed long long __a, vector signed long long __b) {4929return __builtin_altivec_vmaxsd(__a, __b);4930}49314932static __inline__ vector signed long long __ATTRS_o_ai4933vec_max(vector bool long long __a, vector signed long long __b) {4934return __builtin_altivec_vmaxsd((vector signed long long)__a, __b);4935}49364937static __inline__ vector signed long long __ATTRS_o_ai4938vec_max(vector signed long long __a, vector bool long long __b) {4939return __builtin_altivec_vmaxsd(__a, (vector signed long long)__b);4940}49414942static __inline__ vector unsigned long long __ATTRS_o_ai4943vec_max(vector unsigned long long __a, vector unsigned long long __b) {4944return __builtin_altivec_vmaxud(__a, __b);4945}49464947static __inline__ vector unsigned long long __ATTRS_o_ai4948vec_max(vector bool long long __a, vector unsigned long long __b) {4949return __builtin_altivec_vmaxud((vector unsigned long long)__a, __b);4950}49514952static __inline__ vector unsigned long long __ATTRS_o_ai4953vec_max(vector unsigned long long __a, vector bool long long __b) {4954return __builtin_altivec_vmaxud(__a, (vector unsigned long long)__b);4955}4956#endif49574958static __inline__ vector float __ATTRS_o_ai vec_max(vector float __a,4959vector float __b) {4960#ifdef __VSX__4961return __builtin_vsx_xvmaxsp(__a, __b);4962#else4963return __builtin_altivec_vmaxfp(__a, __b);4964#endif4965}49664967#ifdef __VSX__4968static __inline__ vector double __ATTRS_o_ai vec_max(vector double __a,4969vector double __b) {4970return __builtin_vsx_xvmaxdp(__a, __b);4971}4972#endif49734974/* vec_vmaxsb */49754976static __inline__ vector signed char __ATTRS_o_ai4977vec_vmaxsb(vector signed char __a, vector signed char __b) {4978return __builtin_altivec_vmaxsb(__a, __b);4979}49804981static __inline__ vector signed char __ATTRS_o_ai4982vec_vmaxsb(vector bool char __a, vector signed char __b) {4983return __builtin_altivec_vmaxsb((vector signed char)__a, __b);4984}49854986static __inline__ vector signed char __ATTRS_o_ai4987vec_vmaxsb(vector signed char __a, vector bool char __b) {4988return __builtin_altivec_vmaxsb(__a, (vector signed char)__b);4989}49904991/* vec_vmaxub */49924993static __inline__ vector unsigned char __ATTRS_o_ai4994vec_vmaxub(vector unsigned char __a, vector unsigned char __b) {4995return __builtin_altivec_vmaxub(__a, __b);4996}49974998static __inline__ vector unsigned char __ATTRS_o_ai4999vec_vmaxub(vector bool char __a, vector unsigned char __b) {5000return __builtin_altivec_vmaxub((vector unsigned char)__a, __b);5001}50025003static __inline__ vector unsigned char __ATTRS_o_ai5004vec_vmaxub(vector unsigned char __a, vector bool char __b) {5005return __builtin_altivec_vmaxub(__a, (vector unsigned char)__b);5006}50075008/* vec_vmaxsh */50095010static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,5011vector short __b) {5012return __builtin_altivec_vmaxsh(__a, __b);5013}50145015static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector bool short __a,5016vector short __b) {5017return __builtin_altivec_vmaxsh((vector short)__a, __b);5018}50195020static __inline__ vector short __ATTRS_o_ai vec_vmaxsh(vector short __a,5021vector bool short __b) {5022return __builtin_altivec_vmaxsh(__a, (vector short)__b);5023}50245025/* vec_vmaxuh */50265027static __inline__ vector unsigned short __ATTRS_o_ai5028vec_vmaxuh(vector unsigned short __a, vector unsigned short __b) {5029return __builtin_altivec_vmaxuh(__a, __b);5030}50315032static __inline__ vector unsigned short __ATTRS_o_ai5033vec_vmaxuh(vector bool short __a, vector unsigned short __b) {5034return __builtin_altivec_vmaxuh((vector unsigned short)__a, __b);5035}50365037static __inline__ vector unsigned short __ATTRS_o_ai5038vec_vmaxuh(vector unsigned short __a, vector bool short __b) {5039return __builtin_altivec_vmaxuh(__a, (vector unsigned short)__b);5040}50415042/* vec_vmaxsw */50435044static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,5045vector int __b) {5046return __builtin_altivec_vmaxsw(__a, __b);5047}50485049static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector bool int __a,5050vector int __b) {5051return __builtin_altivec_vmaxsw((vector int)__a, __b);5052}50535054static __inline__ vector int __ATTRS_o_ai vec_vmaxsw(vector int __a,5055vector bool int __b) {5056return __builtin_altivec_vmaxsw(__a, (vector int)__b);5057}50585059/* vec_vmaxuw */50605061static __inline__ vector unsigned int __ATTRS_o_ai5062vec_vmaxuw(vector unsigned int __a, vector unsigned int __b) {5063return __builtin_altivec_vmaxuw(__a, __b);5064}50655066static __inline__ vector unsigned int __ATTRS_o_ai5067vec_vmaxuw(vector bool int __a, vector unsigned int __b) {5068return __builtin_altivec_vmaxuw((vector unsigned int)__a, __b);5069}50705071static __inline__ vector unsigned int __ATTRS_o_ai5072vec_vmaxuw(vector unsigned int __a, vector bool int __b) {5073return __builtin_altivec_vmaxuw(__a, (vector unsigned int)__b);5074}50755076/* vec_vmaxfp */50775078static __inline__ vector float __attribute__((__always_inline__))5079vec_vmaxfp(vector float __a, vector float __b) {5080#ifdef __VSX__5081return __builtin_vsx_xvmaxsp(__a, __b);5082#else5083return __builtin_altivec_vmaxfp(__a, __b);5084#endif5085}50865087/* vec_mergeh */50885089static __inline__ vector signed char __ATTRS_o_ai5090vec_mergeh(vector signed char __a, vector signed char __b) {5091return vec_perm(__a, __b,5092(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,50930x03, 0x13, 0x04, 0x14, 0x05, 0x15,50940x06, 0x16, 0x07, 0x17));5095}50965097static __inline__ vector unsigned char __ATTRS_o_ai5098vec_mergeh(vector unsigned char __a, vector unsigned char __b) {5099return vec_perm(__a, __b,5100(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,51010x03, 0x13, 0x04, 0x14, 0x05, 0x15,51020x06, 0x16, 0x07, 0x17));5103}51045105static __inline__ vector bool char __ATTRS_o_ai5106vec_mergeh(vector bool char __a, vector bool char __b) {5107return vec_perm(__a, __b,5108(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,51090x03, 0x13, 0x04, 0x14, 0x05, 0x15,51100x06, 0x16, 0x07, 0x17));5111}51125113static __inline__ vector short __ATTRS_o_ai vec_mergeh(vector short __a,5114vector short __b) {5115return vec_perm(__a, __b,5116(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,51170x12, 0x13, 0x04, 0x05, 0x14, 0x15,51180x06, 0x07, 0x16, 0x17));5119}51205121static __inline__ vector unsigned short __ATTRS_o_ai5122vec_mergeh(vector unsigned short __a, vector unsigned short __b) {5123return vec_perm(__a, __b,5124(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,51250x12, 0x13, 0x04, 0x05, 0x14, 0x15,51260x06, 0x07, 0x16, 0x17));5127}51285129static __inline__ vector bool short __ATTRS_o_ai5130vec_mergeh(vector bool short __a, vector bool short __b) {5131return vec_perm(__a, __b,5132(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,51330x12, 0x13, 0x04, 0x05, 0x14, 0x15,51340x06, 0x07, 0x16, 0x17));5135}51365137static __inline__ vector pixel __ATTRS_o_ai vec_mergeh(vector pixel __a,5138vector pixel __b) {5139return vec_perm(__a, __b,5140(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,51410x12, 0x13, 0x04, 0x05, 0x14, 0x15,51420x06, 0x07, 0x16, 0x17));5143}51445145static __inline__ vector int __ATTRS_o_ai vec_mergeh(vector int __a,5146vector int __b) {5147return vec_perm(__a, __b,5148(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,51490x12, 0x13, 0x04, 0x05, 0x06, 0x07,51500x14, 0x15, 0x16, 0x17));5151}51525153static __inline__ vector unsigned int __ATTRS_o_ai5154vec_mergeh(vector unsigned int __a, vector unsigned int __b) {5155return vec_perm(__a, __b,5156(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,51570x12, 0x13, 0x04, 0x05, 0x06, 0x07,51580x14, 0x15, 0x16, 0x17));5159}51605161static __inline__ vector bool int __ATTRS_o_ai vec_mergeh(vector bool int __a,5162vector bool int __b) {5163return vec_perm(__a, __b,5164(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,51650x12, 0x13, 0x04, 0x05, 0x06, 0x07,51660x14, 0x15, 0x16, 0x17));5167}51685169static __inline__ vector float __ATTRS_o_ai vec_mergeh(vector float __a,5170vector float __b) {5171return vec_perm(__a, __b,5172(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,51730x12, 0x13, 0x04, 0x05, 0x06, 0x07,51740x14, 0x15, 0x16, 0x17));5175}51765177#ifdef __VSX__5178static __inline__ vector signed long long __ATTRS_o_ai5179vec_mergeh(vector signed long long __a, vector signed long long __b) {5180return vec_perm(__a, __b,5181(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,51820x06, 0x07, 0x10, 0x11, 0x12, 0x13,51830x14, 0x15, 0x16, 0x17));5184}51855186static __inline__ vector signed long long __ATTRS_o_ai5187vec_mergeh(vector signed long long __a, vector bool long long __b) {5188return vec_perm(__a, (vector signed long long)__b,5189(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,51900x06, 0x07, 0x10, 0x11, 0x12, 0x13,51910x14, 0x15, 0x16, 0x17));5192}51935194static __inline__ vector signed long long __ATTRS_o_ai5195vec_mergeh(vector bool long long __a, vector signed long long __b) {5196return vec_perm((vector signed long long)__a, __b,5197(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,51980x06, 0x07, 0x10, 0x11, 0x12, 0x13,51990x14, 0x15, 0x16, 0x17));5200}52015202static __inline__ vector unsigned long long __ATTRS_o_ai5203vec_mergeh(vector unsigned long long __a, vector unsigned long long __b) {5204return vec_perm(__a, __b,5205(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52060x06, 0x07, 0x10, 0x11, 0x12, 0x13,52070x14, 0x15, 0x16, 0x17));5208}52095210static __inline__ vector unsigned long long __ATTRS_o_ai5211vec_mergeh(vector unsigned long long __a, vector bool long long __b) {5212return vec_perm(__a, (vector unsigned long long)__b,5213(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52140x06, 0x07, 0x10, 0x11, 0x12, 0x13,52150x14, 0x15, 0x16, 0x17));5216}52175218static __inline__ vector unsigned long long __ATTRS_o_ai5219vec_mergeh(vector bool long long __a, vector unsigned long long __b) {5220return vec_perm((vector unsigned long long)__a, __b,5221(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52220x06, 0x07, 0x10, 0x11, 0x12, 0x13,52230x14, 0x15, 0x16, 0x17));5224}52255226static __inline__ vector bool long long __ATTRS_o_ai5227vec_mergeh(vector bool long long __a, vector bool long long __b) {5228return vec_perm(__a, __b,5229(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52300x06, 0x07, 0x10, 0x11, 0x12, 0x13,52310x14, 0x15, 0x16, 0x17));5232}52335234static __inline__ vector double __ATTRS_o_ai vec_mergeh(vector double __a,5235vector double __b) {5236return vec_perm(__a, __b,5237(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52380x06, 0x07, 0x10, 0x11, 0x12, 0x13,52390x14, 0x15, 0x16, 0x17));5240}5241static __inline__ vector double __ATTRS_o_ai5242vec_mergeh(vector double __a, vector bool long long __b) {5243return vec_perm(__a, (vector double)__b,5244(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52450x06, 0x07, 0x10, 0x11, 0x12, 0x13,52460x14, 0x15, 0x16, 0x17));5247}5248static __inline__ vector double __ATTRS_o_ai5249vec_mergeh(vector bool long long __a, vector double __b) {5250return vec_perm((vector double)__a, __b,5251(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x04, 0x05,52520x06, 0x07, 0x10, 0x11, 0x12, 0x13,52530x14, 0x15, 0x16, 0x17));5254}5255#endif52565257/* vec_vmrghb */52585259#define __builtin_altivec_vmrghb vec_vmrghb52605261static __inline__ vector signed char __ATTRS_o_ai5262vec_vmrghb(vector signed char __a, vector signed char __b) {5263return vec_perm(__a, __b,5264(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,52650x03, 0x13, 0x04, 0x14, 0x05, 0x15,52660x06, 0x16, 0x07, 0x17));5267}52685269static __inline__ vector unsigned char __ATTRS_o_ai5270vec_vmrghb(vector unsigned char __a, vector unsigned char __b) {5271return vec_perm(__a, __b,5272(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,52730x03, 0x13, 0x04, 0x14, 0x05, 0x15,52740x06, 0x16, 0x07, 0x17));5275}52765277static __inline__ vector bool char __ATTRS_o_ai5278vec_vmrghb(vector bool char __a, vector bool char __b) {5279return vec_perm(__a, __b,5280(vector unsigned char)(0x00, 0x10, 0x01, 0x11, 0x02, 0x12,52810x03, 0x13, 0x04, 0x14, 0x05, 0x15,52820x06, 0x16, 0x07, 0x17));5283}52845285/* vec_vmrghh */52865287#define __builtin_altivec_vmrghh vec_vmrghh52885289static __inline__ vector short __ATTRS_o_ai vec_vmrghh(vector short __a,5290vector short __b) {5291return vec_perm(__a, __b,5292(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,52930x12, 0x13, 0x04, 0x05, 0x14, 0x15,52940x06, 0x07, 0x16, 0x17));5295}52965297static __inline__ vector unsigned short __ATTRS_o_ai5298vec_vmrghh(vector unsigned short __a, vector unsigned short __b) {5299return vec_perm(__a, __b,5300(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,53010x12, 0x13, 0x04, 0x05, 0x14, 0x15,53020x06, 0x07, 0x16, 0x17));5303}53045305static __inline__ vector bool short __ATTRS_o_ai5306vec_vmrghh(vector bool short __a, vector bool short __b) {5307return vec_perm(__a, __b,5308(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,53090x12, 0x13, 0x04, 0x05, 0x14, 0x15,53100x06, 0x07, 0x16, 0x17));5311}53125313static __inline__ vector pixel __ATTRS_o_ai vec_vmrghh(vector pixel __a,5314vector pixel __b) {5315return vec_perm(__a, __b,5316(vector unsigned char)(0x00, 0x01, 0x10, 0x11, 0x02, 0x03,53170x12, 0x13, 0x04, 0x05, 0x14, 0x15,53180x06, 0x07, 0x16, 0x17));5319}53205321/* vec_vmrghw */53225323#define __builtin_altivec_vmrghw vec_vmrghw53245325static __inline__ vector int __ATTRS_o_ai vec_vmrghw(vector int __a,5326vector int __b) {5327return vec_perm(__a, __b,5328(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,53290x12, 0x13, 0x04, 0x05, 0x06, 0x07,53300x14, 0x15, 0x16, 0x17));5331}53325333static __inline__ vector unsigned int __ATTRS_o_ai5334vec_vmrghw(vector unsigned int __a, vector unsigned int __b) {5335return vec_perm(__a, __b,5336(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,53370x12, 0x13, 0x04, 0x05, 0x06, 0x07,53380x14, 0x15, 0x16, 0x17));5339}53405341static __inline__ vector bool int __ATTRS_o_ai vec_vmrghw(vector bool int __a,5342vector bool int __b) {5343return vec_perm(__a, __b,5344(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,53450x12, 0x13, 0x04, 0x05, 0x06, 0x07,53460x14, 0x15, 0x16, 0x17));5347}53485349static __inline__ vector float __ATTRS_o_ai vec_vmrghw(vector float __a,5350vector float __b) {5351return vec_perm(__a, __b,5352(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,53530x12, 0x13, 0x04, 0x05, 0x06, 0x07,53540x14, 0x15, 0x16, 0x17));5355}53565357/* vec_mergel */53585359static __inline__ vector signed char __ATTRS_o_ai5360vec_mergel(vector signed char __a, vector signed char __b) {5361return vec_perm(__a, __b,5362(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,53630x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,53640x0E, 0x1E, 0x0F, 0x1F));5365}53665367static __inline__ vector unsigned char __ATTRS_o_ai5368vec_mergel(vector unsigned char __a, vector unsigned char __b) {5369return vec_perm(__a, __b,5370(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,53710x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,53720x0E, 0x1E, 0x0F, 0x1F));5373}53745375static __inline__ vector bool char __ATTRS_o_ai5376vec_mergel(vector bool char __a, vector bool char __b) {5377return vec_perm(__a, __b,5378(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,53790x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,53800x0E, 0x1E, 0x0F, 0x1F));5381}53825383static __inline__ vector short __ATTRS_o_ai vec_mergel(vector short __a,5384vector short __b) {5385return vec_perm(__a, __b,5386(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,53870x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,53880x0E, 0x0F, 0x1E, 0x1F));5389}53905391static __inline__ vector unsigned short __ATTRS_o_ai5392vec_mergel(vector unsigned short __a, vector unsigned short __b) {5393return vec_perm(__a, __b,5394(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,53950x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,53960x0E, 0x0F, 0x1E, 0x1F));5397}53985399static __inline__ vector bool short __ATTRS_o_ai5400vec_mergel(vector bool short __a, vector bool short __b) {5401return vec_perm(__a, __b,5402(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,54030x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,54040x0E, 0x0F, 0x1E, 0x1F));5405}54065407static __inline__ vector pixel __ATTRS_o_ai vec_mergel(vector pixel __a,5408vector pixel __b) {5409return vec_perm(__a, __b,5410(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,54110x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,54120x0E, 0x0F, 0x1E, 0x1F));5413}54145415static __inline__ vector int __ATTRS_o_ai vec_mergel(vector int __a,5416vector int __b) {5417return vec_perm(__a, __b,5418(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,54190x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,54200x1C, 0x1D, 0x1E, 0x1F));5421}54225423static __inline__ vector unsigned int __ATTRS_o_ai5424vec_mergel(vector unsigned int __a, vector unsigned int __b) {5425return vec_perm(__a, __b,5426(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,54270x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,54280x1C, 0x1D, 0x1E, 0x1F));5429}54305431static __inline__ vector bool int __ATTRS_o_ai vec_mergel(vector bool int __a,5432vector bool int __b) {5433return vec_perm(__a, __b,5434(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,54350x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,54360x1C, 0x1D, 0x1E, 0x1F));5437}54385439static __inline__ vector float __ATTRS_o_ai vec_mergel(vector float __a,5440vector float __b) {5441return vec_perm(__a, __b,5442(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,54430x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,54440x1C, 0x1D, 0x1E, 0x1F));5445}54465447#ifdef __VSX__5448static __inline__ vector signed long long __ATTRS_o_ai5449vec_mergel(vector signed long long __a, vector signed long long __b) {5450return vec_perm(__a, __b,5451(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54520x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54530x1C, 0x1D, 0x1E, 0x1F));5454}5455static __inline__ vector signed long long __ATTRS_o_ai5456vec_mergel(vector signed long long __a, vector bool long long __b) {5457return vec_perm(__a, (vector signed long long)__b,5458(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54590x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54600x1C, 0x1D, 0x1E, 0x1F));5461}5462static __inline__ vector signed long long __ATTRS_o_ai5463vec_mergel(vector bool long long __a, vector signed long long __b) {5464return vec_perm((vector signed long long)__a, __b,5465(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54660x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54670x1C, 0x1D, 0x1E, 0x1F));5468}5469static __inline__ vector unsigned long long __ATTRS_o_ai5470vec_mergel(vector unsigned long long __a, vector unsigned long long __b) {5471return vec_perm(__a, __b,5472(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54730x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54740x1C, 0x1D, 0x1E, 0x1F));5475}5476static __inline__ vector unsigned long long __ATTRS_o_ai5477vec_mergel(vector unsigned long long __a, vector bool long long __b) {5478return vec_perm(__a, (vector unsigned long long)__b,5479(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54800x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54810x1C, 0x1D, 0x1E, 0x1F));5482}5483static __inline__ vector unsigned long long __ATTRS_o_ai5484vec_mergel(vector bool long long __a, vector unsigned long long __b) {5485return vec_perm((vector unsigned long long)__a, __b,5486(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54870x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54880x1C, 0x1D, 0x1E, 0x1F));5489}5490static __inline__ vector bool long long __ATTRS_o_ai5491vec_mergel(vector bool long long __a, vector bool long long __b) {5492return vec_perm(__a, __b,5493(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,54940x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,54950x1C, 0x1D, 0x1E, 0x1F));5496}5497static __inline__ vector double __ATTRS_o_ai vec_mergel(vector double __a,5498vector double __b) {5499return vec_perm(__a, __b,5500(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,55010x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,55020x1C, 0x1D, 0x1E, 0x1F));5503}5504static __inline__ vector double __ATTRS_o_ai5505vec_mergel(vector double __a, vector bool long long __b) {5506return vec_perm(__a, (vector double)__b,5507(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,55080x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,55090x1C, 0x1D, 0x1E, 0x1F));5510}5511static __inline__ vector double __ATTRS_o_ai5512vec_mergel(vector bool long long __a, vector double __b) {5513return vec_perm((vector double)__a, __b,5514(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D,55150x0E, 0x0F, 0x18, 0X19, 0x1A, 0x1B,55160x1C, 0x1D, 0x1E, 0x1F));5517}5518#endif55195520/* vec_vmrglb */55215522#define __builtin_altivec_vmrglb vec_vmrglb55235524static __inline__ vector signed char __ATTRS_o_ai5525vec_vmrglb(vector signed char __a, vector signed char __b) {5526return vec_perm(__a, __b,5527(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,55280x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,55290x0E, 0x1E, 0x0F, 0x1F));5530}55315532static __inline__ vector unsigned char __ATTRS_o_ai5533vec_vmrglb(vector unsigned char __a, vector unsigned char __b) {5534return vec_perm(__a, __b,5535(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,55360x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,55370x0E, 0x1E, 0x0F, 0x1F));5538}55395540static __inline__ vector bool char __ATTRS_o_ai5541vec_vmrglb(vector bool char __a, vector bool char __b) {5542return vec_perm(__a, __b,5543(vector unsigned char)(0x08, 0x18, 0x09, 0x19, 0x0A, 0x1A,55440x0B, 0x1B, 0x0C, 0x1C, 0x0D, 0x1D,55450x0E, 0x1E, 0x0F, 0x1F));5546}55475548/* vec_vmrglh */55495550#define __builtin_altivec_vmrglh vec_vmrglh55515552static __inline__ vector short __ATTRS_o_ai vec_vmrglh(vector short __a,5553vector short __b) {5554return vec_perm(__a, __b,5555(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,55560x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,55570x0E, 0x0F, 0x1E, 0x1F));5558}55595560static __inline__ vector unsigned short __ATTRS_o_ai5561vec_vmrglh(vector unsigned short __a, vector unsigned short __b) {5562return vec_perm(__a, __b,5563(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,55640x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,55650x0E, 0x0F, 0x1E, 0x1F));5566}55675568static __inline__ vector bool short __ATTRS_o_ai5569vec_vmrglh(vector bool short __a, vector bool short __b) {5570return vec_perm(__a, __b,5571(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,55720x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,55730x0E, 0x0F, 0x1E, 0x1F));5574}55755576static __inline__ vector pixel __ATTRS_o_ai vec_vmrglh(vector pixel __a,5577vector pixel __b) {5578return vec_perm(__a, __b,5579(vector unsigned char)(0x08, 0x09, 0x18, 0x19, 0x0A, 0x0B,55800x1A, 0x1B, 0x0C, 0x0D, 0x1C, 0x1D,55810x0E, 0x0F, 0x1E, 0x1F));5582}55835584/* vec_vmrglw */55855586#define __builtin_altivec_vmrglw vec_vmrglw55875588static __inline__ vector int __ATTRS_o_ai vec_vmrglw(vector int __a,5589vector int __b) {5590return vec_perm(__a, __b,5591(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,55920x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,55930x1C, 0x1D, 0x1E, 0x1F));5594}55955596static __inline__ vector unsigned int __ATTRS_o_ai5597vec_vmrglw(vector unsigned int __a, vector unsigned int __b) {5598return vec_perm(__a, __b,5599(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,56000x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,56010x1C, 0x1D, 0x1E, 0x1F));5602}56035604static __inline__ vector bool int __ATTRS_o_ai vec_vmrglw(vector bool int __a,5605vector bool int __b) {5606return vec_perm(__a, __b,5607(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,56080x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,56090x1C, 0x1D, 0x1E, 0x1F));5610}56115612static __inline__ vector float __ATTRS_o_ai vec_vmrglw(vector float __a,5613vector float __b) {5614return vec_perm(__a, __b,5615(vector unsigned char)(0x08, 0x09, 0x0A, 0x0B, 0x18, 0x19,56160x1A, 0x1B, 0x0C, 0x0D, 0x0E, 0x0F,56170x1C, 0x1D, 0x1E, 0x1F));5618}56195620#ifdef __POWER8_VECTOR__5621/* vec_mergee */56225623static __inline__ vector bool int __ATTRS_o_ai vec_mergee(vector bool int __a,5624vector bool int __b) {5625return vec_perm(__a, __b,5626(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,56270x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,56280x18, 0x19, 0x1A, 0x1B));5629}56305631static __inline__ vector signed int __ATTRS_o_ai5632vec_mergee(vector signed int __a, vector signed int __b) {5633return vec_perm(__a, __b,5634(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,56350x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,56360x18, 0x19, 0x1A, 0x1B));5637}56385639static __inline__ vector unsigned int __ATTRS_o_ai5640vec_mergee(vector unsigned int __a, vector unsigned int __b) {5641return vec_perm(__a, __b,5642(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,56430x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,56440x18, 0x19, 0x1A, 0x1B));5645}56465647static __inline__ vector bool long long __ATTRS_o_ai5648vec_mergee(vector bool long long __a, vector bool long long __b) {5649return vec_mergeh(__a, __b);5650}56515652static __inline__ vector signed long long __ATTRS_o_ai5653vec_mergee(vector signed long long __a, vector signed long long __b) {5654return vec_mergeh(__a, __b);5655}56565657static __inline__ vector unsigned long long __ATTRS_o_ai5658vec_mergee(vector unsigned long long __a, vector unsigned long long __b) {5659return vec_mergeh(__a, __b);5660}56615662static __inline__ vector float __ATTRS_o_ai5663vec_mergee(vector float __a, vector float __b) {5664return vec_perm(__a, __b,5665(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x10, 0x11,56660x12, 0x13, 0x08, 0x09, 0x0A, 0x0B,56670x18, 0x19, 0x1A, 0x1B));5668}56695670static __inline__ vector double __ATTRS_o_ai5671vec_mergee(vector double __a, vector double __b) {5672return vec_mergeh(__a, __b);5673}56745675/* vec_mergeo */56765677static __inline__ vector bool int __ATTRS_o_ai vec_mergeo(vector bool int __a,5678vector bool int __b) {5679return vec_perm(__a, __b,5680(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,56810x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,56820x1C, 0x1D, 0x1E, 0x1F));5683}56845685static __inline__ vector signed int __ATTRS_o_ai5686vec_mergeo(vector signed int __a, vector signed int __b) {5687return vec_perm(__a, __b,5688(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,56890x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,56900x1C, 0x1D, 0x1E, 0x1F));5691}56925693static __inline__ vector unsigned int __ATTRS_o_ai5694vec_mergeo(vector unsigned int __a, vector unsigned int __b) {5695return vec_perm(__a, __b,5696(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,56970x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,56980x1C, 0x1D, 0x1E, 0x1F));5699}57005701static __inline__ vector bool long long __ATTRS_o_ai5702vec_mergeo(vector bool long long __a, vector bool long long __b) {5703return vec_mergel(__a, __b);5704}57055706static __inline__ vector signed long long __ATTRS_o_ai5707vec_mergeo(vector signed long long __a, vector signed long long __b) {5708return vec_mergel(__a, __b);5709}57105711static __inline__ vector unsigned long long __ATTRS_o_ai5712vec_mergeo(vector unsigned long long __a, vector unsigned long long __b) {5713return vec_mergel(__a, __b);5714}57155716static __inline__ vector float __ATTRS_o_ai5717vec_mergeo(vector float __a, vector float __b) {5718return vec_perm(__a, __b,5719(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x14, 0x15,57200x16, 0x17, 0x0C, 0x0D, 0x0E, 0x0F,57210x1C, 0x1D, 0x1E, 0x1F));5722}57235724static __inline__ vector double __ATTRS_o_ai5725vec_mergeo(vector double __a, vector double __b) {5726return vec_mergel(__a, __b);5727}57285729#endif57305731/* vec_mfvscr */57325733static __inline__ vector unsigned short __attribute__((__always_inline__))5734vec_mfvscr(void) {5735return __builtin_altivec_mfvscr();5736}57375738/* vec_min */57395740static __inline__ vector signed char __ATTRS_o_ai5741vec_min(vector signed char __a, vector signed char __b) {5742return __builtin_altivec_vminsb(__a, __b);5743}57445745static __inline__ vector signed char __ATTRS_o_ai5746vec_min(vector bool char __a, vector signed char __b) {5747return __builtin_altivec_vminsb((vector signed char)__a, __b);5748}57495750static __inline__ vector signed char __ATTRS_o_ai5751vec_min(vector signed char __a, vector bool char __b) {5752return __builtin_altivec_vminsb(__a, (vector signed char)__b);5753}57545755static __inline__ vector unsigned char __ATTRS_o_ai5756vec_min(vector unsigned char __a, vector unsigned char __b) {5757return __builtin_altivec_vminub(__a, __b);5758}57595760static __inline__ vector unsigned char __ATTRS_o_ai5761vec_min(vector bool char __a, vector unsigned char __b) {5762return __builtin_altivec_vminub((vector unsigned char)__a, __b);5763}57645765static __inline__ vector unsigned char __ATTRS_o_ai5766vec_min(vector unsigned char __a, vector bool char __b) {5767return __builtin_altivec_vminub(__a, (vector unsigned char)__b);5768}57695770static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,5771vector short __b) {5772return __builtin_altivec_vminsh(__a, __b);5773}57745775static __inline__ vector short __ATTRS_o_ai vec_min(vector bool short __a,5776vector short __b) {5777return __builtin_altivec_vminsh((vector short)__a, __b);5778}57795780static __inline__ vector short __ATTRS_o_ai vec_min(vector short __a,5781vector bool short __b) {5782return __builtin_altivec_vminsh(__a, (vector short)__b);5783}57845785static __inline__ vector unsigned short __ATTRS_o_ai5786vec_min(vector unsigned short __a, vector unsigned short __b) {5787return __builtin_altivec_vminuh(__a, __b);5788}57895790static __inline__ vector unsigned short __ATTRS_o_ai5791vec_min(vector bool short __a, vector unsigned short __b) {5792return __builtin_altivec_vminuh((vector unsigned short)__a, __b);5793}57945795static __inline__ vector unsigned short __ATTRS_o_ai5796vec_min(vector unsigned short __a, vector bool short __b) {5797return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);5798}57995800static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,5801vector int __b) {5802return __builtin_altivec_vminsw(__a, __b);5803}58045805static __inline__ vector int __ATTRS_o_ai vec_min(vector bool int __a,5806vector int __b) {5807return __builtin_altivec_vminsw((vector int)__a, __b);5808}58095810static __inline__ vector int __ATTRS_o_ai vec_min(vector int __a,5811vector bool int __b) {5812return __builtin_altivec_vminsw(__a, (vector int)__b);5813}58145815static __inline__ vector unsigned int __ATTRS_o_ai5816vec_min(vector unsigned int __a, vector unsigned int __b) {5817return __builtin_altivec_vminuw(__a, __b);5818}58195820static __inline__ vector unsigned int __ATTRS_o_ai5821vec_min(vector bool int __a, vector unsigned int __b) {5822return __builtin_altivec_vminuw((vector unsigned int)__a, __b);5823}58245825static __inline__ vector unsigned int __ATTRS_o_ai5826vec_min(vector unsigned int __a, vector bool int __b) {5827return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);5828}58295830#ifdef __POWER8_VECTOR__5831static __inline__ vector signed long long __ATTRS_o_ai5832vec_min(vector signed long long __a, vector signed long long __b) {5833return __builtin_altivec_vminsd(__a, __b);5834}58355836static __inline__ vector signed long long __ATTRS_o_ai5837vec_min(vector bool long long __a, vector signed long long __b) {5838return __builtin_altivec_vminsd((vector signed long long)__a, __b);5839}58405841static __inline__ vector signed long long __ATTRS_o_ai5842vec_min(vector signed long long __a, vector bool long long __b) {5843return __builtin_altivec_vminsd(__a, (vector signed long long)__b);5844}58455846static __inline__ vector unsigned long long __ATTRS_o_ai5847vec_min(vector unsigned long long __a, vector unsigned long long __b) {5848return __builtin_altivec_vminud(__a, __b);5849}58505851static __inline__ vector unsigned long long __ATTRS_o_ai5852vec_min(vector bool long long __a, vector unsigned long long __b) {5853return __builtin_altivec_vminud((vector unsigned long long)__a, __b);5854}58555856static __inline__ vector unsigned long long __ATTRS_o_ai5857vec_min(vector unsigned long long __a, vector bool long long __b) {5858return __builtin_altivec_vminud(__a, (vector unsigned long long)__b);5859}5860#endif58615862static __inline__ vector float __ATTRS_o_ai vec_min(vector float __a,5863vector float __b) {5864#ifdef __VSX__5865return __builtin_vsx_xvminsp(__a, __b);5866#else5867return __builtin_altivec_vminfp(__a, __b);5868#endif5869}58705871#ifdef __VSX__5872static __inline__ vector double __ATTRS_o_ai vec_min(vector double __a,5873vector double __b) {5874return __builtin_vsx_xvmindp(__a, __b);5875}5876#endif58775878/* vec_vminsb */58795880static __inline__ vector signed char __ATTRS_o_ai5881vec_vminsb(vector signed char __a, vector signed char __b) {5882return __builtin_altivec_vminsb(__a, __b);5883}58845885static __inline__ vector signed char __ATTRS_o_ai5886vec_vminsb(vector bool char __a, vector signed char __b) {5887return __builtin_altivec_vminsb((vector signed char)__a, __b);5888}58895890static __inline__ vector signed char __ATTRS_o_ai5891vec_vminsb(vector signed char __a, vector bool char __b) {5892return __builtin_altivec_vminsb(__a, (vector signed char)__b);5893}58945895/* vec_vminub */58965897static __inline__ vector unsigned char __ATTRS_o_ai5898vec_vminub(vector unsigned char __a, vector unsigned char __b) {5899return __builtin_altivec_vminub(__a, __b);5900}59015902static __inline__ vector unsigned char __ATTRS_o_ai5903vec_vminub(vector bool char __a, vector unsigned char __b) {5904return __builtin_altivec_vminub((vector unsigned char)__a, __b);5905}59065907static __inline__ vector unsigned char __ATTRS_o_ai5908vec_vminub(vector unsigned char __a, vector bool char __b) {5909return __builtin_altivec_vminub(__a, (vector unsigned char)__b);5910}59115912/* vec_vminsh */59135914static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,5915vector short __b) {5916return __builtin_altivec_vminsh(__a, __b);5917}59185919static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector bool short __a,5920vector short __b) {5921return __builtin_altivec_vminsh((vector short)__a, __b);5922}59235924static __inline__ vector short __ATTRS_o_ai vec_vminsh(vector short __a,5925vector bool short __b) {5926return __builtin_altivec_vminsh(__a, (vector short)__b);5927}59285929/* vec_vminuh */59305931static __inline__ vector unsigned short __ATTRS_o_ai5932vec_vminuh(vector unsigned short __a, vector unsigned short __b) {5933return __builtin_altivec_vminuh(__a, __b);5934}59355936static __inline__ vector unsigned short __ATTRS_o_ai5937vec_vminuh(vector bool short __a, vector unsigned short __b) {5938return __builtin_altivec_vminuh((vector unsigned short)__a, __b);5939}59405941static __inline__ vector unsigned short __ATTRS_o_ai5942vec_vminuh(vector unsigned short __a, vector bool short __b) {5943return __builtin_altivec_vminuh(__a, (vector unsigned short)__b);5944}59455946/* vec_vminsw */59475948static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,5949vector int __b) {5950return __builtin_altivec_vminsw(__a, __b);5951}59525953static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector bool int __a,5954vector int __b) {5955return __builtin_altivec_vminsw((vector int)__a, __b);5956}59575958static __inline__ vector int __ATTRS_o_ai vec_vminsw(vector int __a,5959vector bool int __b) {5960return __builtin_altivec_vminsw(__a, (vector int)__b);5961}59625963/* vec_vminuw */59645965static __inline__ vector unsigned int __ATTRS_o_ai5966vec_vminuw(vector unsigned int __a, vector unsigned int __b) {5967return __builtin_altivec_vminuw(__a, __b);5968}59695970static __inline__ vector unsigned int __ATTRS_o_ai5971vec_vminuw(vector bool int __a, vector unsigned int __b) {5972return __builtin_altivec_vminuw((vector unsigned int)__a, __b);5973}59745975static __inline__ vector unsigned int __ATTRS_o_ai5976vec_vminuw(vector unsigned int __a, vector bool int __b) {5977return __builtin_altivec_vminuw(__a, (vector unsigned int)__b);5978}59795980/* vec_vminfp */59815982static __inline__ vector float __attribute__((__always_inline__))5983vec_vminfp(vector float __a, vector float __b) {5984#ifdef __VSX__5985return __builtin_vsx_xvminsp(__a, __b);5986#else5987return __builtin_altivec_vminfp(__a, __b);5988#endif5989}59905991/* vec_mladd */59925993#define __builtin_altivec_vmladduhm vec_mladd59945995static __inline__ vector short __ATTRS_o_ai vec_mladd(vector short __a,5996vector short __b,5997vector short __c) {5998return __a * __b + __c;5999}60006001static __inline__ vector short __ATTRS_o_ai vec_mladd(6002vector short __a, vector unsigned short __b, vector unsigned short __c) {6003return __a * (vector short)__b + (vector short)__c;6004}60056006static __inline__ vector short __ATTRS_o_ai vec_mladd(vector unsigned short __a,6007vector short __b,6008vector short __c) {6009return (vector short)__a * __b + __c;6010}60116012static __inline__ vector unsigned short __ATTRS_o_ai6013vec_mladd(vector unsigned short __a, vector unsigned short __b,6014vector unsigned short __c) {6015return __a * __b + __c;6016}60176018/* vec_vmladduhm */60196020static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(vector short __a,6021vector short __b,6022vector short __c) {6023return __a * __b + __c;6024}60256026static __inline__ vector short __ATTRS_o_ai vec_vmladduhm(6027vector short __a, vector unsigned short __b, vector unsigned short __c) {6028return __a * (vector short)__b + (vector short)__c;6029}60306031static __inline__ vector short __ATTRS_o_ai6032vec_vmladduhm(vector unsigned short __a, vector short __b, vector short __c) {6033return (vector short)__a * __b + __c;6034}60356036static __inline__ vector unsigned short __ATTRS_o_ai6037vec_vmladduhm(vector unsigned short __a, vector unsigned short __b,6038vector unsigned short __c) {6039return __a * __b + __c;6040}60416042/* vec_mradds */60436044static __inline__ vector short __attribute__((__always_inline__))6045vec_mradds(vector short __a, vector short __b, vector short __c) {6046return __builtin_altivec_vmhraddshs(__a, __b, __c);6047}60486049/* vec_vmhraddshs */60506051static __inline__ vector short __attribute__((__always_inline__))6052vec_vmhraddshs(vector short __a, vector short __b, vector short __c) {6053return __builtin_altivec_vmhraddshs(__a, __b, __c);6054}60556056/* vec_msum */60576058static __inline__ vector int __ATTRS_o_ai vec_msum(vector signed char __a,6059vector unsigned char __b,6060vector int __c) {6061return __builtin_altivec_vmsummbm(__a, __b, __c);6062}60636064static __inline__ vector unsigned int __ATTRS_o_ai6065vec_msum(vector unsigned char __a, vector unsigned char __b,6066vector unsigned int __c) {6067return __builtin_altivec_vmsumubm(__a, __b, __c);6068}60696070static __inline__ vector int __ATTRS_o_ai vec_msum(vector short __a,6071vector short __b,6072vector int __c) {6073return __builtin_altivec_vmsumshm(__a, __b, __c);6074}60756076static __inline__ vector unsigned int __ATTRS_o_ai6077vec_msum(vector unsigned short __a, vector unsigned short __b,6078vector unsigned int __c) {6079return __builtin_altivec_vmsumuhm(__a, __b, __c);6080}60816082/* vec_msumc */60836084#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)6085static __inline__ vector unsigned __int128 __ATTRS_o_ai6086vec_msumc(vector unsigned long long __a, vector unsigned long long __b,6087vector unsigned __int128 __c) {6088return __builtin_altivec_vmsumcud(__a, __b, __c);6089}6090#endif60916092/* vec_vmsummbm */60936094static __inline__ vector int __attribute__((__always_inline__))6095vec_vmsummbm(vector signed char __a, vector unsigned char __b, vector int __c) {6096return __builtin_altivec_vmsummbm(__a, __b, __c);6097}60986099/* vec_vmsumubm */61006101static __inline__ vector unsigned int __attribute__((__always_inline__))6102vec_vmsumubm(vector unsigned char __a, vector unsigned char __b,6103vector unsigned int __c) {6104return __builtin_altivec_vmsumubm(__a, __b, __c);6105}61066107/* vec_vmsumshm */61086109static __inline__ vector int __attribute__((__always_inline__))6110vec_vmsumshm(vector short __a, vector short __b, vector int __c) {6111return __builtin_altivec_vmsumshm(__a, __b, __c);6112}61136114/* vec_vmsumuhm */61156116static __inline__ vector unsigned int __attribute__((__always_inline__))6117vec_vmsumuhm(vector unsigned short __a, vector unsigned short __b,6118vector unsigned int __c) {6119return __builtin_altivec_vmsumuhm(__a, __b, __c);6120}61216122/* vec_msums */61236124static __inline__ vector int __ATTRS_o_ai vec_msums(vector short __a,6125vector short __b,6126vector int __c) {6127return __builtin_altivec_vmsumshs(__a, __b, __c);6128}61296130static __inline__ vector unsigned int __ATTRS_o_ai6131vec_msums(vector unsigned short __a, vector unsigned short __b,6132vector unsigned int __c) {6133return __builtin_altivec_vmsumuhs(__a, __b, __c);6134}61356136/* vec_vmsumshs */61376138static __inline__ vector int __attribute__((__always_inline__))6139vec_vmsumshs(vector short __a, vector short __b, vector int __c) {6140return __builtin_altivec_vmsumshs(__a, __b, __c);6141}61426143/* vec_vmsumuhs */61446145static __inline__ vector unsigned int __attribute__((__always_inline__))6146vec_vmsumuhs(vector unsigned short __a, vector unsigned short __b,6147vector unsigned int __c) {6148return __builtin_altivec_vmsumuhs(__a, __b, __c);6149}61506151/* vec_mtvscr */61526153static __inline__ void __ATTRS_o_ai vec_mtvscr(vector signed char __a) {6154__builtin_altivec_mtvscr((vector int)__a);6155}61566157static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned char __a) {6158__builtin_altivec_mtvscr((vector int)__a);6159}61606161static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool char __a) {6162__builtin_altivec_mtvscr((vector int)__a);6163}61646165static __inline__ void __ATTRS_o_ai vec_mtvscr(vector short __a) {6166__builtin_altivec_mtvscr((vector int)__a);6167}61686169static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned short __a) {6170__builtin_altivec_mtvscr((vector int)__a);6171}61726173static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool short __a) {6174__builtin_altivec_mtvscr((vector int)__a);6175}61766177static __inline__ void __ATTRS_o_ai vec_mtvscr(vector pixel __a) {6178__builtin_altivec_mtvscr((vector int)__a);6179}61806181static __inline__ void __ATTRS_o_ai vec_mtvscr(vector int __a) {6182__builtin_altivec_mtvscr((vector int)__a);6183}61846185static __inline__ void __ATTRS_o_ai vec_mtvscr(vector unsigned int __a) {6186__builtin_altivec_mtvscr((vector int)__a);6187}61886189static __inline__ void __ATTRS_o_ai vec_mtvscr(vector bool int __a) {6190__builtin_altivec_mtvscr((vector int)__a);6191}61926193static __inline__ void __ATTRS_o_ai vec_mtvscr(vector float __a) {6194__builtin_altivec_mtvscr((vector int)__a);6195}61966197/* vec_mul */61986199/* Integer vector multiplication will involve multiplication of the odd/even6200elements separately, then truncating the results and moving to the6201result vector.6202*/6203static __inline__ vector signed char __ATTRS_o_ai6204vec_mul(vector signed char __a, vector signed char __b) {6205return __a * __b;6206}62076208static __inline__ vector unsigned char __ATTRS_o_ai6209vec_mul(vector unsigned char __a, vector unsigned char __b) {6210return __a * __b;6211}62126213static __inline__ vector signed short __ATTRS_o_ai6214vec_mul(vector signed short __a, vector signed short __b) {6215return __a * __b;6216}62176218static __inline__ vector unsigned short __ATTRS_o_ai6219vec_mul(vector unsigned short __a, vector unsigned short __b) {6220return __a * __b;6221}62226223static __inline__ vector signed int __ATTRS_o_ai6224vec_mul(vector signed int __a, vector signed int __b) {6225return __a * __b;6226}62276228static __inline__ vector unsigned int __ATTRS_o_ai6229vec_mul(vector unsigned int __a, vector unsigned int __b) {6230return __a * __b;6231}62326233#ifdef __VSX__6234static __inline__ vector signed long long __ATTRS_o_ai6235vec_mul(vector signed long long __a, vector signed long long __b) {6236return __a * __b;6237}62386239static __inline__ vector unsigned long long __ATTRS_o_ai6240vec_mul(vector unsigned long long __a, vector unsigned long long __b) {6241return __a * __b;6242}6243#endif62446245static __inline__ vector float __ATTRS_o_ai vec_mul(vector float __a,6246vector float __b) {6247return __a * __b;6248}62496250#ifdef __VSX__6251static __inline__ vector double __ATTRS_o_ai vec_mul(vector double __a,6252vector double __b) {6253return __a * __b;6254}6255#endif62566257/* The vmulos* and vmules* instructions have a big endian bias, so6258we must reverse the meaning of "even" and "odd" for little endian. */62596260/* vec_mule */62616262static __inline__ vector short __ATTRS_o_ai vec_mule(vector signed char __a,6263vector signed char __b) {6264#ifdef __LITTLE_ENDIAN__6265return __builtin_altivec_vmulosb(__a, __b);6266#else6267return __builtin_altivec_vmulesb(__a, __b);6268#endif6269}62706271static __inline__ vector unsigned short __ATTRS_o_ai6272vec_mule(vector unsigned char __a, vector unsigned char __b) {6273#ifdef __LITTLE_ENDIAN__6274return __builtin_altivec_vmuloub(__a, __b);6275#else6276return __builtin_altivec_vmuleub(__a, __b);6277#endif6278}62796280static __inline__ vector int __ATTRS_o_ai vec_mule(vector short __a,6281vector short __b) {6282#ifdef __LITTLE_ENDIAN__6283return __builtin_altivec_vmulosh(__a, __b);6284#else6285return __builtin_altivec_vmulesh(__a, __b);6286#endif6287}62886289static __inline__ vector unsigned int __ATTRS_o_ai6290vec_mule(vector unsigned short __a, vector unsigned short __b) {6291#ifdef __LITTLE_ENDIAN__6292return __builtin_altivec_vmulouh(__a, __b);6293#else6294return __builtin_altivec_vmuleuh(__a, __b);6295#endif6296}62976298#ifdef __POWER8_VECTOR__6299static __inline__ vector signed long long __ATTRS_o_ai6300vec_mule(vector signed int __a, vector signed int __b) {6301#ifdef __LITTLE_ENDIAN__6302return __builtin_altivec_vmulosw(__a, __b);6303#else6304return __builtin_altivec_vmulesw(__a, __b);6305#endif6306}63076308static __inline__ vector unsigned long long __ATTRS_o_ai6309vec_mule(vector unsigned int __a, vector unsigned int __b) {6310#ifdef __LITTLE_ENDIAN__6311return __builtin_altivec_vmulouw(__a, __b);6312#else6313return __builtin_altivec_vmuleuw(__a, __b);6314#endif6315}6316#endif63176318#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)6319static __inline__ vector signed __int128 __ATTRS_o_ai6320vec_mule(vector signed long long __a, vector signed long long __b) {6321#ifdef __LITTLE_ENDIAN__6322return __builtin_altivec_vmulosd(__a, __b);6323#else6324return __builtin_altivec_vmulesd(__a, __b);6325#endif6326}63276328static __inline__ vector unsigned __int128 __ATTRS_o_ai6329vec_mule(vector unsigned long long __a, vector unsigned long long __b) {6330#ifdef __LITTLE_ENDIAN__6331return __builtin_altivec_vmuloud(__a, __b);6332#else6333return __builtin_altivec_vmuleud(__a, __b);6334#endif6335}6336#endif63376338/* vec_vmulesb */63396340static __inline__ vector short __attribute__((__always_inline__))6341vec_vmulesb(vector signed char __a, vector signed char __b) {6342#ifdef __LITTLE_ENDIAN__6343return __builtin_altivec_vmulosb(__a, __b);6344#else6345return __builtin_altivec_vmulesb(__a, __b);6346#endif6347}63486349/* vec_vmuleub */63506351static __inline__ vector unsigned short __attribute__((__always_inline__))6352vec_vmuleub(vector unsigned char __a, vector unsigned char __b) {6353#ifdef __LITTLE_ENDIAN__6354return __builtin_altivec_vmuloub(__a, __b);6355#else6356return __builtin_altivec_vmuleub(__a, __b);6357#endif6358}63596360/* vec_vmulesh */63616362static __inline__ vector int __attribute__((__always_inline__))6363vec_vmulesh(vector short __a, vector short __b) {6364#ifdef __LITTLE_ENDIAN__6365return __builtin_altivec_vmulosh(__a, __b);6366#else6367return __builtin_altivec_vmulesh(__a, __b);6368#endif6369}63706371/* vec_vmuleuh */63726373static __inline__ vector unsigned int __attribute__((__always_inline__))6374vec_vmuleuh(vector unsigned short __a, vector unsigned short __b) {6375#ifdef __LITTLE_ENDIAN__6376return __builtin_altivec_vmulouh(__a, __b);6377#else6378return __builtin_altivec_vmuleuh(__a, __b);6379#endif6380}63816382/* vec_mulh */63836384#ifdef __POWER10_VECTOR__6385static __inline__ vector signed int __ATTRS_o_ai6386vec_mulh(vector signed int __a, vector signed int __b) {6387return __builtin_altivec_vmulhsw(__a, __b);6388}63896390static __inline__ vector unsigned int __ATTRS_o_ai6391vec_mulh(vector unsigned int __a, vector unsigned int __b) {6392return __builtin_altivec_vmulhuw(__a, __b);6393}63946395static __inline__ vector signed long long __ATTRS_o_ai6396vec_mulh(vector signed long long __a, vector signed long long __b) {6397return __builtin_altivec_vmulhsd(__a, __b);6398}63996400static __inline__ vector unsigned long long __ATTRS_o_ai6401vec_mulh(vector unsigned long long __a, vector unsigned long long __b) {6402return __builtin_altivec_vmulhud(__a, __b);6403}6404#endif64056406/* vec_mulo */64076408static __inline__ vector short __ATTRS_o_ai vec_mulo(vector signed char __a,6409vector signed char __b) {6410#ifdef __LITTLE_ENDIAN__6411return __builtin_altivec_vmulesb(__a, __b);6412#else6413return __builtin_altivec_vmulosb(__a, __b);6414#endif6415}64166417static __inline__ vector unsigned short __ATTRS_o_ai6418vec_mulo(vector unsigned char __a, vector unsigned char __b) {6419#ifdef __LITTLE_ENDIAN__6420return __builtin_altivec_vmuleub(__a, __b);6421#else6422return __builtin_altivec_vmuloub(__a, __b);6423#endif6424}64256426static __inline__ vector int __ATTRS_o_ai vec_mulo(vector short __a,6427vector short __b) {6428#ifdef __LITTLE_ENDIAN__6429return __builtin_altivec_vmulesh(__a, __b);6430#else6431return __builtin_altivec_vmulosh(__a, __b);6432#endif6433}64346435static __inline__ vector unsigned int __ATTRS_o_ai6436vec_mulo(vector unsigned short __a, vector unsigned short __b) {6437#ifdef __LITTLE_ENDIAN__6438return __builtin_altivec_vmuleuh(__a, __b);6439#else6440return __builtin_altivec_vmulouh(__a, __b);6441#endif6442}64436444#ifdef __POWER8_VECTOR__6445static __inline__ vector signed long long __ATTRS_o_ai6446vec_mulo(vector signed int __a, vector signed int __b) {6447#ifdef __LITTLE_ENDIAN__6448return __builtin_altivec_vmulesw(__a, __b);6449#else6450return __builtin_altivec_vmulosw(__a, __b);6451#endif6452}64536454static __inline__ vector unsigned long long __ATTRS_o_ai6455vec_mulo(vector unsigned int __a, vector unsigned int __b) {6456#ifdef __LITTLE_ENDIAN__6457return __builtin_altivec_vmuleuw(__a, __b);6458#else6459return __builtin_altivec_vmulouw(__a, __b);6460#endif6461}6462#endif64636464#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)6465static __inline__ vector signed __int128 __ATTRS_o_ai6466vec_mulo(vector signed long long __a, vector signed long long __b) {6467#ifdef __LITTLE_ENDIAN__6468return __builtin_altivec_vmulesd(__a, __b);6469#else6470return __builtin_altivec_vmulosd(__a, __b);6471#endif6472}64736474static __inline__ vector unsigned __int128 __ATTRS_o_ai6475vec_mulo(vector unsigned long long __a, vector unsigned long long __b) {6476#ifdef __LITTLE_ENDIAN__6477return __builtin_altivec_vmuleud(__a, __b);6478#else6479return __builtin_altivec_vmuloud(__a, __b);6480#endif6481}6482#endif64836484/* vec_vmulosb */64856486static __inline__ vector short __attribute__((__always_inline__))6487vec_vmulosb(vector signed char __a, vector signed char __b) {6488#ifdef __LITTLE_ENDIAN__6489return __builtin_altivec_vmulesb(__a, __b);6490#else6491return __builtin_altivec_vmulosb(__a, __b);6492#endif6493}64946495/* vec_vmuloub */64966497static __inline__ vector unsigned short __attribute__((__always_inline__))6498vec_vmuloub(vector unsigned char __a, vector unsigned char __b) {6499#ifdef __LITTLE_ENDIAN__6500return __builtin_altivec_vmuleub(__a, __b);6501#else6502return __builtin_altivec_vmuloub(__a, __b);6503#endif6504}65056506/* vec_vmulosh */65076508static __inline__ vector int __attribute__((__always_inline__))6509vec_vmulosh(vector short __a, vector short __b) {6510#ifdef __LITTLE_ENDIAN__6511return __builtin_altivec_vmulesh(__a, __b);6512#else6513return __builtin_altivec_vmulosh(__a, __b);6514#endif6515}65166517/* vec_vmulouh */65186519static __inline__ vector unsigned int __attribute__((__always_inline__))6520vec_vmulouh(vector unsigned short __a, vector unsigned short __b) {6521#ifdef __LITTLE_ENDIAN__6522return __builtin_altivec_vmuleuh(__a, __b);6523#else6524return __builtin_altivec_vmulouh(__a, __b);6525#endif6526}65276528/* vec_nand */65296530#ifdef __POWER8_VECTOR__6531static __inline__ vector signed char __ATTRS_o_ai6532vec_nand(vector signed char __a, vector signed char __b) {6533return ~(__a & __b);6534}65356536static __inline__ vector signed char __ATTRS_o_ai6537vec_nand(vector signed char __a, vector bool char __b) {6538return ~(__a & (vector signed char)__b);6539}65406541static __inline__ vector signed char __ATTRS_o_ai6542vec_nand(vector bool char __a, vector signed char __b) {6543return (vector signed char)~(__a & (vector bool char)__b);6544}65456546static __inline__ vector unsigned char __ATTRS_o_ai6547vec_nand(vector unsigned char __a, vector unsigned char __b) {6548return ~(__a & __b);6549}65506551static __inline__ vector unsigned char __ATTRS_o_ai6552vec_nand(vector unsigned char __a, vector bool char __b) {6553return ~(__a & (vector unsigned char)__b);6554}65556556static __inline__ vector unsigned char __ATTRS_o_ai6557vec_nand(vector bool char __a, vector unsigned char __b) {6558return (vector unsigned char)~(__a & (vector bool char)__b);6559}65606561static __inline__ vector bool char __ATTRS_o_ai vec_nand(vector bool char __a,6562vector bool char __b) {6563return ~(__a & __b);6564}65656566static __inline__ vector signed short __ATTRS_o_ai6567vec_nand(vector signed short __a, vector signed short __b) {6568return ~(__a & __b);6569}65706571static __inline__ vector signed short __ATTRS_o_ai6572vec_nand(vector signed short __a, vector bool short __b) {6573return ~(__a & (vector signed short)__b);6574}65756576static __inline__ vector signed short __ATTRS_o_ai6577vec_nand(vector bool short __a, vector signed short __b) {6578return (vector signed short)~(__a & (vector bool short)__b);6579}65806581static __inline__ vector unsigned short __ATTRS_o_ai6582vec_nand(vector unsigned short __a, vector unsigned short __b) {6583return ~(__a & __b);6584}65856586static __inline__ vector unsigned short __ATTRS_o_ai6587vec_nand(vector unsigned short __a, vector bool short __b) {6588return ~(__a & (vector unsigned short)__b);6589}65906591static __inline__ vector bool short __ATTRS_o_ai6592vec_nand(vector bool short __a, vector bool short __b) {6593return ~(__a & __b);6594}65956596static __inline__ vector signed int __ATTRS_o_ai6597vec_nand(vector signed int __a, vector signed int __b) {6598return ~(__a & __b);6599}66006601static __inline__ vector signed int __ATTRS_o_ai vec_nand(vector signed int __a,6602vector bool int __b) {6603return ~(__a & (vector signed int)__b);6604}66056606static __inline__ vector signed int __ATTRS_o_ai6607vec_nand(vector bool int __a, vector signed int __b) {6608return (vector signed int)~(__a & (vector bool int)__b);6609}66106611static __inline__ vector unsigned int __ATTRS_o_ai6612vec_nand(vector unsigned int __a, vector unsigned int __b) {6613return ~(__a & __b);6614}66156616static __inline__ vector unsigned int __ATTRS_o_ai6617vec_nand(vector unsigned int __a, vector bool int __b) {6618return ~(__a & (vector unsigned int)__b);6619}66206621static __inline__ vector unsigned int __ATTRS_o_ai6622vec_nand(vector bool int __a, vector unsigned int __b) {6623return (vector unsigned int)~(__a & (vector bool int)__b);6624}66256626static __inline__ vector bool int __ATTRS_o_ai vec_nand(vector bool int __a,6627vector bool int __b) {6628return ~(__a & __b);6629}66306631static __inline__ vector float __ATTRS_o_ai6632vec_nand(vector float __a, vector float __b) {6633return (vector float)(~((vector unsigned int)__a &6634(vector unsigned int)__b));6635}66366637static __inline__ vector signed long long __ATTRS_o_ai6638vec_nand(vector signed long long __a, vector signed long long __b) {6639return ~(__a & __b);6640}66416642static __inline__ vector signed long long __ATTRS_o_ai6643vec_nand(vector signed long long __a, vector bool long long __b) {6644return ~(__a & (vector signed long long)__b);6645}66466647static __inline__ vector signed long long __ATTRS_o_ai6648vec_nand(vector bool long long __a, vector signed long long __b) {6649return (vector signed long long)~(__a & (vector bool long long)__b);6650}66516652static __inline__ vector unsigned long long __ATTRS_o_ai6653vec_nand(vector unsigned long long __a, vector unsigned long long __b) {6654return ~(__a & __b);6655}66566657static __inline__ vector unsigned long long __ATTRS_o_ai6658vec_nand(vector unsigned long long __a, vector bool long long __b) {6659return ~(__a & (vector unsigned long long)__b);6660}66616662static __inline__ vector unsigned long long __ATTRS_o_ai6663vec_nand(vector bool long long __a, vector unsigned long long __b) {6664return (vector unsigned long long)~(__a & (vector bool long long)__b);6665}66666667static __inline__ vector bool long long __ATTRS_o_ai6668vec_nand(vector bool long long __a, vector bool long long __b) {6669return ~(__a & __b);6670}66716672static __inline__ vector double __ATTRS_o_ai6673vec_nand(vector double __a, vector double __b) {6674return (vector double)(~((vector unsigned long long)__a &6675(vector unsigned long long)__b));6676}66776678#endif66796680/* vec_nmadd */66816682#ifdef __VSX__6683static __inline__ vector float __ATTRS_o_ai vec_nmadd(vector float __a,6684vector float __b,6685vector float __c) {6686return __builtin_vsx_xvnmaddasp(__a, __b, __c);6687}66886689static __inline__ vector double __ATTRS_o_ai vec_nmadd(vector double __a,6690vector double __b,6691vector double __c) {6692return __builtin_vsx_xvnmaddadp(__a, __b, __c);6693}6694#endif66956696/* vec_nmsub */66976698static __inline__ vector float __ATTRS_o_ai vec_nmsub(vector float __a,6699vector float __b,6700vector float __c) {6701#ifdef __VSX__6702return __builtin_vsx_xvnmsubasp(__a, __b, __c);6703#else6704return __builtin_altivec_vnmsubfp(__a, __b, __c);6705#endif6706}67076708#ifdef __VSX__6709static __inline__ vector double __ATTRS_o_ai vec_nmsub(vector double __a,6710vector double __b,6711vector double __c) {6712return __builtin_vsx_xvnmsubadp(__a, __b, __c);6713}6714#endif67156716/* vec_vnmsubfp */67176718static __inline__ vector float __attribute__((__always_inline__))6719vec_vnmsubfp(vector float __a, vector float __b, vector float __c) {6720return __builtin_altivec_vnmsubfp(__a, __b, __c);6721}67226723/* vec_nor */67246725#define __builtin_altivec_vnor vec_nor67266727static __inline__ vector signed char __ATTRS_o_ai6728vec_nor(vector signed char __a, vector signed char __b) {6729return ~(__a | __b);6730}67316732static __inline__ vector unsigned char __ATTRS_o_ai6733vec_nor(vector unsigned char __a, vector unsigned char __b) {6734return ~(__a | __b);6735}67366737static __inline__ vector bool char __ATTRS_o_ai vec_nor(vector bool char __a,6738vector bool char __b) {6739return ~(__a | __b);6740}67416742static __inline__ vector short __ATTRS_o_ai vec_nor(vector short __a,6743vector short __b) {6744return ~(__a | __b);6745}67466747static __inline__ vector unsigned short __ATTRS_o_ai6748vec_nor(vector unsigned short __a, vector unsigned short __b) {6749return ~(__a | __b);6750}67516752static __inline__ vector bool short __ATTRS_o_ai6753vec_nor(vector bool short __a, vector bool short __b) {6754return ~(__a | __b);6755}67566757static __inline__ vector int __ATTRS_o_ai vec_nor(vector int __a,6758vector int __b) {6759return ~(__a | __b);6760}67616762static __inline__ vector unsigned int __ATTRS_o_ai6763vec_nor(vector unsigned int __a, vector unsigned int __b) {6764return ~(__a | __b);6765}67666767static __inline__ vector bool int __ATTRS_o_ai vec_nor(vector bool int __a,6768vector bool int __b) {6769return ~(__a | __b);6770}67716772static __inline__ vector float __ATTRS_o_ai vec_nor(vector float __a,6773vector float __b) {6774vector unsigned int __res =6775~((vector unsigned int)__a | (vector unsigned int)__b);6776return (vector float)__res;6777}67786779#ifdef __VSX__6780static __inline__ vector double __ATTRS_o_ai vec_nor(vector double __a,6781vector double __b) {6782vector unsigned long long __res =6783~((vector unsigned long long)__a | (vector unsigned long long)__b);6784return (vector double)__res;6785}6786#endif67876788/* vec_vnor */67896790static __inline__ vector signed char __ATTRS_o_ai6791vec_vnor(vector signed char __a, vector signed char __b) {6792return ~(__a | __b);6793}67946795static __inline__ vector unsigned char __ATTRS_o_ai6796vec_vnor(vector unsigned char __a, vector unsigned char __b) {6797return ~(__a | __b);6798}67996800static __inline__ vector bool char __ATTRS_o_ai vec_vnor(vector bool char __a,6801vector bool char __b) {6802return ~(__a | __b);6803}68046805static __inline__ vector short __ATTRS_o_ai vec_vnor(vector short __a,6806vector short __b) {6807return ~(__a | __b);6808}68096810static __inline__ vector unsigned short __ATTRS_o_ai6811vec_vnor(vector unsigned short __a, vector unsigned short __b) {6812return ~(__a | __b);6813}68146815static __inline__ vector bool short __ATTRS_o_ai6816vec_vnor(vector bool short __a, vector bool short __b) {6817return ~(__a | __b);6818}68196820static __inline__ vector int __ATTRS_o_ai vec_vnor(vector int __a,6821vector int __b) {6822return ~(__a | __b);6823}68246825static __inline__ vector unsigned int __ATTRS_o_ai6826vec_vnor(vector unsigned int __a, vector unsigned int __b) {6827return ~(__a | __b);6828}68296830static __inline__ vector bool int __ATTRS_o_ai vec_vnor(vector bool int __a,6831vector bool int __b) {6832return ~(__a | __b);6833}68346835static __inline__ vector float __ATTRS_o_ai vec_vnor(vector float __a,6836vector float __b) {6837vector unsigned int __res =6838~((vector unsigned int)__a | (vector unsigned int)__b);6839return (vector float)__res;6840}68416842#ifdef __VSX__6843static __inline__ vector signed long long __ATTRS_o_ai6844vec_nor(vector signed long long __a, vector signed long long __b) {6845return ~(__a | __b);6846}68476848static __inline__ vector unsigned long long __ATTRS_o_ai6849vec_nor(vector unsigned long long __a, vector unsigned long long __b) {6850return ~(__a | __b);6851}68526853static __inline__ vector bool long long __ATTRS_o_ai6854vec_nor(vector bool long long __a, vector bool long long __b) {6855return ~(__a | __b);6856}6857#endif68586859/* vec_or */68606861#define __builtin_altivec_vor vec_or68626863static __inline__ vector signed char __ATTRS_o_ai6864vec_or(vector signed char __a, vector signed char __b) {6865return __a | __b;6866}68676868static __inline__ vector signed char __ATTRS_o_ai6869vec_or(vector bool char __a, vector signed char __b) {6870return (vector signed char)__a | __b;6871}68726873static __inline__ vector signed char __ATTRS_o_ai vec_or(vector signed char __a,6874vector bool char __b) {6875return __a | (vector signed char)__b;6876}68776878static __inline__ vector unsigned char __ATTRS_o_ai6879vec_or(vector unsigned char __a, vector unsigned char __b) {6880return __a | __b;6881}68826883static __inline__ vector unsigned char __ATTRS_o_ai6884vec_or(vector bool char __a, vector unsigned char __b) {6885return (vector unsigned char)__a | __b;6886}68876888static __inline__ vector unsigned char __ATTRS_o_ai6889vec_or(vector unsigned char __a, vector bool char __b) {6890return __a | (vector unsigned char)__b;6891}68926893static __inline__ vector bool char __ATTRS_o_ai vec_or(vector bool char __a,6894vector bool char __b) {6895return __a | __b;6896}68976898static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,6899vector short __b) {6900return __a | __b;6901}69026903static __inline__ vector short __ATTRS_o_ai vec_or(vector bool short __a,6904vector short __b) {6905return (vector short)__a | __b;6906}69076908static __inline__ vector short __ATTRS_o_ai vec_or(vector short __a,6909vector bool short __b) {6910return __a | (vector short)__b;6911}69126913static __inline__ vector unsigned short __ATTRS_o_ai6914vec_or(vector unsigned short __a, vector unsigned short __b) {6915return __a | __b;6916}69176918static __inline__ vector unsigned short __ATTRS_o_ai6919vec_or(vector bool short __a, vector unsigned short __b) {6920return (vector unsigned short)__a | __b;6921}69226923static __inline__ vector unsigned short __ATTRS_o_ai6924vec_or(vector unsigned short __a, vector bool short __b) {6925return __a | (vector unsigned short)__b;6926}69276928static __inline__ vector bool short __ATTRS_o_ai vec_or(vector bool short __a,6929vector bool short __b) {6930return __a | __b;6931}69326933static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,6934vector int __b) {6935return __a | __b;6936}69376938static __inline__ vector int __ATTRS_o_ai vec_or(vector bool int __a,6939vector int __b) {6940return (vector int)__a | __b;6941}69426943static __inline__ vector int __ATTRS_o_ai vec_or(vector int __a,6944vector bool int __b) {6945return __a | (vector int)__b;6946}69476948static __inline__ vector unsigned int __ATTRS_o_ai6949vec_or(vector unsigned int __a, vector unsigned int __b) {6950return __a | __b;6951}69526953static __inline__ vector unsigned int __ATTRS_o_ai6954vec_or(vector bool int __a, vector unsigned int __b) {6955return (vector unsigned int)__a | __b;6956}69576958static __inline__ vector unsigned int __ATTRS_o_ai6959vec_or(vector unsigned int __a, vector bool int __b) {6960return __a | (vector unsigned int)__b;6961}69626963static __inline__ vector bool int __ATTRS_o_ai vec_or(vector bool int __a,6964vector bool int __b) {6965return __a | __b;6966}69676968static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,6969vector float __b) {6970vector unsigned int __res =6971(vector unsigned int)__a | (vector unsigned int)__b;6972return (vector float)__res;6973}69746975static __inline__ vector float __ATTRS_o_ai vec_or(vector bool int __a,6976vector float __b) {6977vector unsigned int __res =6978(vector unsigned int)__a | (vector unsigned int)__b;6979return (vector float)__res;6980}69816982static __inline__ vector float __ATTRS_o_ai vec_or(vector float __a,6983vector bool int __b) {6984vector unsigned int __res =6985(vector unsigned int)__a | (vector unsigned int)__b;6986return (vector float)__res;6987}69886989#ifdef __VSX__6990static __inline__ vector double __ATTRS_o_ai vec_or(vector bool long long __a,6991vector double __b) {6992return (vector double)((vector unsigned long long)__a |6993(vector unsigned long long)__b);6994}69956996static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,6997vector bool long long __b) {6998return (vector double)((vector unsigned long long)__a |6999(vector unsigned long long)__b);7000}70017002static __inline__ vector double __ATTRS_o_ai vec_or(vector double __a,7003vector double __b) {7004return (vector double)((vector unsigned long long)__a |7005(vector unsigned long long)__b);7006}70077008static __inline__ vector signed long long __ATTRS_o_ai7009vec_or(vector signed long long __a, vector signed long long __b) {7010return __a | __b;7011}70127013static __inline__ vector signed long long __ATTRS_o_ai7014vec_or(vector bool long long __a, vector signed long long __b) {7015return (vector signed long long)__a | __b;7016}70177018static __inline__ vector signed long long __ATTRS_o_ai7019vec_or(vector signed long long __a, vector bool long long __b) {7020return __a | (vector signed long long)__b;7021}70227023static __inline__ vector unsigned long long __ATTRS_o_ai7024vec_or(vector unsigned long long __a, vector unsigned long long __b) {7025return __a | __b;7026}70277028static __inline__ vector unsigned long long __ATTRS_o_ai7029vec_or(vector bool long long __a, vector unsigned long long __b) {7030return (vector unsigned long long)__a | __b;7031}70327033static __inline__ vector unsigned long long __ATTRS_o_ai7034vec_or(vector unsigned long long __a, vector bool long long __b) {7035return __a | (vector unsigned long long)__b;7036}70377038static __inline__ vector bool long long __ATTRS_o_ai7039vec_or(vector bool long long __a, vector bool long long __b) {7040return __a | __b;7041}7042#endif70437044#ifdef __POWER8_VECTOR__7045static __inline__ vector signed char __ATTRS_o_ai7046vec_orc(vector signed char __a, vector signed char __b) {7047return __a | ~__b;7048}70497050static __inline__ vector signed char __ATTRS_o_ai7051vec_orc(vector signed char __a, vector bool char __b) {7052return __a | (vector signed char)~__b;7053}70547055static __inline__ vector signed char __ATTRS_o_ai7056vec_orc(vector bool char __a, vector signed char __b) {7057return (vector signed char)(__a | (vector bool char)~__b);7058}70597060static __inline__ vector unsigned char __ATTRS_o_ai7061vec_orc(vector unsigned char __a, vector unsigned char __b) {7062return __a | ~__b;7063}70647065static __inline__ vector unsigned char __ATTRS_o_ai7066vec_orc(vector unsigned char __a, vector bool char __b) {7067return __a | (vector unsigned char)~__b;7068}70697070static __inline__ vector unsigned char __ATTRS_o_ai7071vec_orc(vector bool char __a, vector unsigned char __b) {7072return (vector unsigned char)(__a | (vector bool char)~__b);7073}70747075static __inline__ vector bool char __ATTRS_o_ai vec_orc(vector bool char __a,7076vector bool char __b) {7077return __a | ~__b;7078}70797080static __inline__ vector signed short __ATTRS_o_ai7081vec_orc(vector signed short __a, vector signed short __b) {7082return __a | ~__b;7083}70847085static __inline__ vector signed short __ATTRS_o_ai7086vec_orc(vector signed short __a, vector bool short __b) {7087return __a | (vector signed short)~__b;7088}70897090static __inline__ vector signed short __ATTRS_o_ai7091vec_orc(vector bool short __a, vector signed short __b) {7092return (vector signed short)(__a | (vector bool short)~__b);7093}70947095static __inline__ vector unsigned short __ATTRS_o_ai7096vec_orc(vector unsigned short __a, vector unsigned short __b) {7097return __a | ~__b;7098}70997100static __inline__ vector unsigned short __ATTRS_o_ai7101vec_orc(vector unsigned short __a, vector bool short __b) {7102return __a | (vector unsigned short)~__b;7103}71047105static __inline__ vector unsigned short __ATTRS_o_ai7106vec_orc(vector bool short __a, vector unsigned short __b) {7107return (vector unsigned short)(__a | (vector bool short)~__b);7108}71097110static __inline__ vector bool short __ATTRS_o_ai7111vec_orc(vector bool short __a, vector bool short __b) {7112return __a | ~__b;7113}71147115static __inline__ vector signed int __ATTRS_o_ai7116vec_orc(vector signed int __a, vector signed int __b) {7117return __a | ~__b;7118}71197120static __inline__ vector signed int __ATTRS_o_ai vec_orc(vector signed int __a,7121vector bool int __b) {7122return __a | (vector signed int)~__b;7123}71247125static __inline__ vector signed int __ATTRS_o_ai7126vec_orc(vector bool int __a, vector signed int __b) {7127return (vector signed int)(__a | (vector bool int)~__b);7128}71297130static __inline__ vector unsigned int __ATTRS_o_ai7131vec_orc(vector unsigned int __a, vector unsigned int __b) {7132return __a | ~__b;7133}71347135static __inline__ vector unsigned int __ATTRS_o_ai7136vec_orc(vector unsigned int __a, vector bool int __b) {7137return __a | (vector unsigned int)~__b;7138}71397140static __inline__ vector unsigned int __ATTRS_o_ai7141vec_orc(vector bool int __a, vector unsigned int __b) {7142return (vector unsigned int)(__a | (vector bool int)~__b);7143}71447145static __inline__ vector bool int __ATTRS_o_ai vec_orc(vector bool int __a,7146vector bool int __b) {7147return __a | ~__b;7148}71497150static __inline__ vector float __ATTRS_o_ai7151vec_orc(vector bool int __a, vector float __b) {7152return (vector float)(__a | ~(vector bool int)__b);7153}71547155static __inline__ vector float __ATTRS_o_ai7156vec_orc(vector float __a, vector bool int __b) {7157return (vector float)((vector bool int)__a | ~__b);7158}71597160static __inline__ vector float __ATTRS_o_ai vec_orc(vector float __a,7161vector float __b) {7162return (vector float)((vector unsigned int)__a | ~(vector unsigned int)__b);7163}71647165static __inline__ vector signed long long __ATTRS_o_ai7166vec_orc(vector signed long long __a, vector signed long long __b) {7167return __a | ~__b;7168}71697170static __inline__ vector signed long long __ATTRS_o_ai7171vec_orc(vector signed long long __a, vector bool long long __b) {7172return __a | (vector signed long long)~__b;7173}71747175static __inline__ vector signed long long __ATTRS_o_ai7176vec_orc(vector bool long long __a, vector signed long long __b) {7177return (vector signed long long)(__a | (vector bool long long)~__b);7178}71797180static __inline__ vector unsigned long long __ATTRS_o_ai7181vec_orc(vector unsigned long long __a, vector unsigned long long __b) {7182return __a | ~__b;7183}71847185static __inline__ vector unsigned long long __ATTRS_o_ai7186vec_orc(vector unsigned long long __a, vector bool long long __b) {7187return __a | (vector unsigned long long)~__b;7188}71897190static __inline__ vector unsigned long long __ATTRS_o_ai7191vec_orc(vector bool long long __a, vector unsigned long long __b) {7192return (vector unsigned long long)(__a | (vector bool long long)~__b);7193}71947195static __inline__ vector bool long long __ATTRS_o_ai7196vec_orc(vector bool long long __a, vector bool long long __b) {7197return __a | ~__b;7198}71997200static __inline__ vector double __ATTRS_o_ai7201vec_orc(vector double __a, vector bool long long __b) {7202return (vector double)((vector bool long long)__a | ~__b);7203}72047205static __inline__ vector double __ATTRS_o_ai7206vec_orc(vector bool long long __a, vector double __b) {7207return (vector double)(__a | ~(vector bool long long)__b);7208}72097210static __inline__ vector double __ATTRS_o_ai vec_orc(vector double __a,7211vector double __b) {7212return (vector double)((vector unsigned long long)__a |7213~(vector unsigned long long)__b);7214}7215#endif72167217/* vec_vor */72187219static __inline__ vector signed char __ATTRS_o_ai7220vec_vor(vector signed char __a, vector signed char __b) {7221return __a | __b;7222}72237224static __inline__ vector signed char __ATTRS_o_ai7225vec_vor(vector bool char __a, vector signed char __b) {7226return (vector signed char)__a | __b;7227}72287229static __inline__ vector signed char __ATTRS_o_ai7230vec_vor(vector signed char __a, vector bool char __b) {7231return __a | (vector signed char)__b;7232}72337234static __inline__ vector unsigned char __ATTRS_o_ai7235vec_vor(vector unsigned char __a, vector unsigned char __b) {7236return __a | __b;7237}72387239static __inline__ vector unsigned char __ATTRS_o_ai7240vec_vor(vector bool char __a, vector unsigned char __b) {7241return (vector unsigned char)__a | __b;7242}72437244static __inline__ vector unsigned char __ATTRS_o_ai7245vec_vor(vector unsigned char __a, vector bool char __b) {7246return __a | (vector unsigned char)__b;7247}72487249static __inline__ vector bool char __ATTRS_o_ai vec_vor(vector bool char __a,7250vector bool char __b) {7251return __a | __b;7252}72537254static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,7255vector short __b) {7256return __a | __b;7257}72587259static __inline__ vector short __ATTRS_o_ai vec_vor(vector bool short __a,7260vector short __b) {7261return (vector short)__a | __b;7262}72637264static __inline__ vector short __ATTRS_o_ai vec_vor(vector short __a,7265vector bool short __b) {7266return __a | (vector short)__b;7267}72687269static __inline__ vector unsigned short __ATTRS_o_ai7270vec_vor(vector unsigned short __a, vector unsigned short __b) {7271return __a | __b;7272}72737274static __inline__ vector unsigned short __ATTRS_o_ai7275vec_vor(vector bool short __a, vector unsigned short __b) {7276return (vector unsigned short)__a | __b;7277}72787279static __inline__ vector unsigned short __ATTRS_o_ai7280vec_vor(vector unsigned short __a, vector bool short __b) {7281return __a | (vector unsigned short)__b;7282}72837284static __inline__ vector bool short __ATTRS_o_ai7285vec_vor(vector bool short __a, vector bool short __b) {7286return __a | __b;7287}72887289static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,7290vector int __b) {7291return __a | __b;7292}72937294static __inline__ vector int __ATTRS_o_ai vec_vor(vector bool int __a,7295vector int __b) {7296return (vector int)__a | __b;7297}72987299static __inline__ vector int __ATTRS_o_ai vec_vor(vector int __a,7300vector bool int __b) {7301return __a | (vector int)__b;7302}73037304static __inline__ vector unsigned int __ATTRS_o_ai7305vec_vor(vector unsigned int __a, vector unsigned int __b) {7306return __a | __b;7307}73087309static __inline__ vector unsigned int __ATTRS_o_ai7310vec_vor(vector bool int __a, vector unsigned int __b) {7311return (vector unsigned int)__a | __b;7312}73137314static __inline__ vector unsigned int __ATTRS_o_ai7315vec_vor(vector unsigned int __a, vector bool int __b) {7316return __a | (vector unsigned int)__b;7317}73187319static __inline__ vector bool int __ATTRS_o_ai vec_vor(vector bool int __a,7320vector bool int __b) {7321return __a | __b;7322}73237324static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,7325vector float __b) {7326vector unsigned int __res =7327(vector unsigned int)__a | (vector unsigned int)__b;7328return (vector float)__res;7329}73307331static __inline__ vector float __ATTRS_o_ai vec_vor(vector bool int __a,7332vector float __b) {7333vector unsigned int __res =7334(vector unsigned int)__a | (vector unsigned int)__b;7335return (vector float)__res;7336}73377338static __inline__ vector float __ATTRS_o_ai vec_vor(vector float __a,7339vector bool int __b) {7340vector unsigned int __res =7341(vector unsigned int)__a | (vector unsigned int)__b;7342return (vector float)__res;7343}73447345#ifdef __VSX__7346static __inline__ vector signed long long __ATTRS_o_ai7347vec_vor(vector signed long long __a, vector signed long long __b) {7348return __a | __b;7349}73507351static __inline__ vector signed long long __ATTRS_o_ai7352vec_vor(vector bool long long __a, vector signed long long __b) {7353return (vector signed long long)__a | __b;7354}73557356static __inline__ vector signed long long __ATTRS_o_ai7357vec_vor(vector signed long long __a, vector bool long long __b) {7358return __a | (vector signed long long)__b;7359}73607361static __inline__ vector unsigned long long __ATTRS_o_ai7362vec_vor(vector unsigned long long __a, vector unsigned long long __b) {7363return __a | __b;7364}73657366static __inline__ vector unsigned long long __ATTRS_o_ai7367vec_vor(vector bool long long __a, vector unsigned long long __b) {7368return (vector unsigned long long)__a | __b;7369}73707371static __inline__ vector unsigned long long __ATTRS_o_ai7372vec_vor(vector unsigned long long __a, vector bool long long __b) {7373return __a | (vector unsigned long long)__b;7374}73757376static __inline__ vector bool long long __ATTRS_o_ai7377vec_vor(vector bool long long __a, vector bool long long __b) {7378return __a | __b;7379}7380#endif73817382/* vec_pack */73837384/* The various vector pack instructions have a big-endian bias, so for7385little endian we must handle reversed element numbering. */73867387static __inline__ vector signed char __ATTRS_o_ai7388vec_pack(vector signed short __a, vector signed short __b) {7389#ifdef __LITTLE_ENDIAN__7390return (vector signed char)vec_perm(7391__a, __b,7392(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,73930x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7394#else7395return (vector signed char)vec_perm(7396__a, __b,7397(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,73980x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7399#endif7400}74017402static __inline__ vector unsigned char __ATTRS_o_ai7403vec_pack(vector unsigned short __a, vector unsigned short __b) {7404#ifdef __LITTLE_ENDIAN__7405return (vector unsigned char)vec_perm(7406__a, __b,7407(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,74080x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7409#else7410return (vector unsigned char)vec_perm(7411__a, __b,7412(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,74130x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7414#endif7415}74167417static __inline__ vector bool char __ATTRS_o_ai7418vec_pack(vector bool short __a, vector bool short __b) {7419#ifdef __LITTLE_ENDIAN__7420return (vector bool char)vec_perm(7421__a, __b,7422(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,74230x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7424#else7425return (vector bool char)vec_perm(7426__a, __b,7427(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,74280x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7429#endif7430}74317432static __inline__ vector short __ATTRS_o_ai vec_pack(vector int __a,7433vector int __b) {7434#ifdef __LITTLE_ENDIAN__7435return (vector short)vec_perm(7436__a, __b,7437(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,74380x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7439#else7440return (vector short)vec_perm(7441__a, __b,7442(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,74430x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7444#endif7445}74467447static __inline__ vector unsigned short __ATTRS_o_ai7448vec_pack(vector unsigned int __a, vector unsigned int __b) {7449#ifdef __LITTLE_ENDIAN__7450return (vector unsigned short)vec_perm(7451__a, __b,7452(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,74530x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7454#else7455return (vector unsigned short)vec_perm(7456__a, __b,7457(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,74580x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7459#endif7460}74617462static __inline__ vector bool short __ATTRS_o_ai vec_pack(vector bool int __a,7463vector bool int __b) {7464#ifdef __LITTLE_ENDIAN__7465return (vector bool short)vec_perm(7466__a, __b,7467(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,74680x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7469#else7470return (vector bool short)vec_perm(7471__a, __b,7472(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,74730x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7474#endif7475}74767477#ifdef __VSX__7478static __inline__ vector signed int __ATTRS_o_ai7479vec_pack(vector signed long long __a, vector signed long long __b) {7480#ifdef __LITTLE_ENDIAN__7481return (vector signed int)vec_perm(7482__a, __b,7483(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,74840x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7485#else7486return (vector signed int)vec_perm(7487__a, __b,7488(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,74890x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7490#endif7491}7492static __inline__ vector unsigned int __ATTRS_o_ai7493vec_pack(vector unsigned long long __a, vector unsigned long long __b) {7494#ifdef __LITTLE_ENDIAN__7495return (vector unsigned int)vec_perm(7496__a, __b,7497(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,74980x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7499#else7500return (vector unsigned int)vec_perm(7501__a, __b,7502(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,75030x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7504#endif7505}75067507static __inline__ vector bool int __ATTRS_o_ai7508vec_pack(vector bool long long __a, vector bool long long __b) {7509#ifdef __LITTLE_ENDIAN__7510return (vector bool int)vec_perm(7511__a, __b,7512(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,75130x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7514#else7515return (vector bool int)vec_perm(7516__a, __b,7517(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,75180x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7519#endif7520}75217522static __inline__ vector float __ATTRS_o_ai7523vec_pack(vector double __a, vector double __b) {7524return (vector float) (__a[0], __a[1], __b[0], __b[1]);7525}7526#endif75277528#ifdef __POWER9_VECTOR__7529static __inline__ vector unsigned short __ATTRS_o_ai7530vec_pack_to_short_fp32(vector float __a, vector float __b) {7531vector float __resa = __builtin_vsx_xvcvsphp(__a);7532vector float __resb = __builtin_vsx_xvcvsphp(__b);7533#ifdef __LITTLE_ENDIAN__7534return (vector unsigned short)vec_mergee(__resa, __resb);7535#else7536return (vector unsigned short)vec_mergeo(__resa, __resb);7537#endif7538}75397540#endif7541/* vec_vpkuhum */75427543#define __builtin_altivec_vpkuhum vec_vpkuhum75447545static __inline__ vector signed char __ATTRS_o_ai7546vec_vpkuhum(vector signed short __a, vector signed short __b) {7547#ifdef __LITTLE_ENDIAN__7548return (vector signed char)vec_perm(7549__a, __b,7550(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,75510x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7552#else7553return (vector signed char)vec_perm(7554__a, __b,7555(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,75560x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7557#endif7558}75597560static __inline__ vector unsigned char __ATTRS_o_ai7561vec_vpkuhum(vector unsigned short __a, vector unsigned short __b) {7562#ifdef __LITTLE_ENDIAN__7563return (vector unsigned char)vec_perm(7564__a, __b,7565(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,75660x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7567#else7568return (vector unsigned char)vec_perm(7569__a, __b,7570(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,75710x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7572#endif7573}75747575static __inline__ vector bool char __ATTRS_o_ai7576vec_vpkuhum(vector bool short __a, vector bool short __b) {7577#ifdef __LITTLE_ENDIAN__7578return (vector bool char)vec_perm(7579__a, __b,7580(vector unsigned char)(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E,75810x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1C, 0x1E));7582#else7583return (vector bool char)vec_perm(7584__a, __b,7585(vector unsigned char)(0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,75860x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F));7587#endif7588}75897590/* vec_vpkuwum */75917592#define __builtin_altivec_vpkuwum vec_vpkuwum75937594static __inline__ vector short __ATTRS_o_ai vec_vpkuwum(vector int __a,7595vector int __b) {7596#ifdef __LITTLE_ENDIAN__7597return (vector short)vec_perm(7598__a, __b,7599(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,76000x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7601#else7602return (vector short)vec_perm(7603__a, __b,7604(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,76050x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7606#endif7607}76087609static __inline__ vector unsigned short __ATTRS_o_ai7610vec_vpkuwum(vector unsigned int __a, vector unsigned int __b) {7611#ifdef __LITTLE_ENDIAN__7612return (vector unsigned short)vec_perm(7613__a, __b,7614(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,76150x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7616#else7617return (vector unsigned short)vec_perm(7618__a, __b,7619(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,76200x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7621#endif7622}76237624static __inline__ vector bool short __ATTRS_o_ai7625vec_vpkuwum(vector bool int __a, vector bool int __b) {7626#ifdef __LITTLE_ENDIAN__7627return (vector bool short)vec_perm(7628__a, __b,7629(vector unsigned char)(0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D,76300x10, 0x11, 0x14, 0x15, 0x18, 0x19, 0x1C, 0x1D));7631#else7632return (vector bool short)vec_perm(7633__a, __b,7634(vector unsigned char)(0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,76350x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F));7636#endif7637}76387639/* vec_vpkudum */76407641#ifdef __POWER8_VECTOR__7642#define __builtin_altivec_vpkudum vec_vpkudum76437644static __inline__ vector int __ATTRS_o_ai vec_vpkudum(vector long long __a,7645vector long long __b) {7646#ifdef __LITTLE_ENDIAN__7647return (vector int)vec_perm(7648__a, __b,7649(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,76500x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7651#else7652return (vector int)vec_perm(7653__a, __b,7654(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,76550x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7656#endif7657}76587659static __inline__ vector unsigned int __ATTRS_o_ai7660vec_vpkudum(vector unsigned long long __a, vector unsigned long long __b) {7661#ifdef __LITTLE_ENDIAN__7662return (vector unsigned int)vec_perm(7663__a, __b,7664(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,76650x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7666#else7667return (vector unsigned int)vec_perm(7668__a, __b,7669(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,76700x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7671#endif7672}76737674static __inline__ vector bool int __ATTRS_o_ai7675vec_vpkudum(vector bool long long __a, vector bool long long __b) {7676#ifdef __LITTLE_ENDIAN__7677return (vector bool int)vec_perm(7678(vector long long)__a, (vector long long)__b,7679(vector unsigned char)(0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B,76800x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B));7681#else7682return (vector bool int)vec_perm(7683(vector long long)__a, (vector long long)__b,7684(vector unsigned char)(0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F,76850x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F));7686#endif7687}7688#endif76897690/* vec_packpx */76917692static __inline__ vector pixel __attribute__((__always_inline__))7693vec_packpx(vector unsigned int __a, vector unsigned int __b) {7694#ifdef __LITTLE_ENDIAN__7695return (vector pixel)__builtin_altivec_vpkpx(__b, __a);7696#else7697return (vector pixel)__builtin_altivec_vpkpx(__a, __b);7698#endif7699}77007701/* vec_vpkpx */77027703static __inline__ vector pixel __attribute__((__always_inline__))7704vec_vpkpx(vector unsigned int __a, vector unsigned int __b) {7705#ifdef __LITTLE_ENDIAN__7706return (vector pixel)__builtin_altivec_vpkpx(__b, __a);7707#else7708return (vector pixel)__builtin_altivec_vpkpx(__a, __b);7709#endif7710}77117712/* vec_packs */77137714static __inline__ vector signed char __ATTRS_o_ai vec_packs(vector short __a,7715vector short __b) {7716#ifdef __LITTLE_ENDIAN__7717return __builtin_altivec_vpkshss(__b, __a);7718#else7719return __builtin_altivec_vpkshss(__a, __b);7720#endif7721}77227723static __inline__ vector unsigned char __ATTRS_o_ai7724vec_packs(vector unsigned short __a, vector unsigned short __b) {7725#ifdef __LITTLE_ENDIAN__7726return __builtin_altivec_vpkuhus(__b, __a);7727#else7728return __builtin_altivec_vpkuhus(__a, __b);7729#endif7730}77317732static __inline__ vector signed short __ATTRS_o_ai vec_packs(vector int __a,7733vector int __b) {7734#ifdef __LITTLE_ENDIAN__7735return __builtin_altivec_vpkswss(__b, __a);7736#else7737return __builtin_altivec_vpkswss(__a, __b);7738#endif7739}77407741static __inline__ vector unsigned short __ATTRS_o_ai7742vec_packs(vector unsigned int __a, vector unsigned int __b) {7743#ifdef __LITTLE_ENDIAN__7744return __builtin_altivec_vpkuwus(__b, __a);7745#else7746return __builtin_altivec_vpkuwus(__a, __b);7747#endif7748}77497750#ifdef __POWER8_VECTOR__7751static __inline__ vector int __ATTRS_o_ai vec_packs(vector long long __a,7752vector long long __b) {7753#ifdef __LITTLE_ENDIAN__7754return __builtin_altivec_vpksdss(__b, __a);7755#else7756return __builtin_altivec_vpksdss(__a, __b);7757#endif7758}77597760static __inline__ vector unsigned int __ATTRS_o_ai7761vec_packs(vector unsigned long long __a, vector unsigned long long __b) {7762#ifdef __LITTLE_ENDIAN__7763return __builtin_altivec_vpkudus(__b, __a);7764#else7765return __builtin_altivec_vpkudus(__a, __b);7766#endif7767}7768#endif77697770/* vec_vpkshss */77717772static __inline__ vector signed char __attribute__((__always_inline__))7773vec_vpkshss(vector short __a, vector short __b) {7774#ifdef __LITTLE_ENDIAN__7775return __builtin_altivec_vpkshss(__b, __a);7776#else7777return __builtin_altivec_vpkshss(__a, __b);7778#endif7779}77807781/* vec_vpksdss */77827783#ifdef __POWER8_VECTOR__7784static __inline__ vector int __ATTRS_o_ai vec_vpksdss(vector long long __a,7785vector long long __b) {7786#ifdef __LITTLE_ENDIAN__7787return __builtin_altivec_vpksdss(__b, __a);7788#else7789return __builtin_altivec_vpksdss(__a, __b);7790#endif7791}7792#endif77937794/* vec_vpkuhus */77957796static __inline__ vector unsigned char __attribute__((__always_inline__))7797vec_vpkuhus(vector unsigned short __a, vector unsigned short __b) {7798#ifdef __LITTLE_ENDIAN__7799return __builtin_altivec_vpkuhus(__b, __a);7800#else7801return __builtin_altivec_vpkuhus(__a, __b);7802#endif7803}78047805/* vec_vpkudus */78067807#ifdef __POWER8_VECTOR__7808static __inline__ vector unsigned int __attribute__((__always_inline__))7809vec_vpkudus(vector unsigned long long __a, vector unsigned long long __b) {7810#ifdef __LITTLE_ENDIAN__7811return __builtin_altivec_vpkudus(__b, __a);7812#else7813return __builtin_altivec_vpkudus(__a, __b);7814#endif7815}7816#endif78177818/* vec_vpkswss */78197820static __inline__ vector signed short __attribute__((__always_inline__))7821vec_vpkswss(vector int __a, vector int __b) {7822#ifdef __LITTLE_ENDIAN__7823return __builtin_altivec_vpkswss(__b, __a);7824#else7825return __builtin_altivec_vpkswss(__a, __b);7826#endif7827}78287829/* vec_vpkuwus */78307831static __inline__ vector unsigned short __attribute__((__always_inline__))7832vec_vpkuwus(vector unsigned int __a, vector unsigned int __b) {7833#ifdef __LITTLE_ENDIAN__7834return __builtin_altivec_vpkuwus(__b, __a);7835#else7836return __builtin_altivec_vpkuwus(__a, __b);7837#endif7838}78397840/* vec_packsu */78417842static __inline__ vector unsigned char __ATTRS_o_ai7843vec_packsu(vector short __a, vector short __b) {7844#ifdef __LITTLE_ENDIAN__7845return __builtin_altivec_vpkshus(__b, __a);7846#else7847return __builtin_altivec_vpkshus(__a, __b);7848#endif7849}78507851static __inline__ vector unsigned char __ATTRS_o_ai7852vec_packsu(vector unsigned short __a, vector unsigned short __b) {7853#ifdef __LITTLE_ENDIAN__7854return __builtin_altivec_vpkuhus(__b, __a);7855#else7856return __builtin_altivec_vpkuhus(__a, __b);7857#endif7858}78597860static __inline__ vector unsigned short __ATTRS_o_ai7861vec_packsu(vector int __a, vector int __b) {7862#ifdef __LITTLE_ENDIAN__7863return __builtin_altivec_vpkswus(__b, __a);7864#else7865return __builtin_altivec_vpkswus(__a, __b);7866#endif7867}78687869static __inline__ vector unsigned short __ATTRS_o_ai7870vec_packsu(vector unsigned int __a, vector unsigned int __b) {7871#ifdef __LITTLE_ENDIAN__7872return __builtin_altivec_vpkuwus(__b, __a);7873#else7874return __builtin_altivec_vpkuwus(__a, __b);7875#endif7876}78777878#ifdef __POWER8_VECTOR__7879static __inline__ vector unsigned int __ATTRS_o_ai7880vec_packsu(vector long long __a, vector long long __b) {7881#ifdef __LITTLE_ENDIAN__7882return __builtin_altivec_vpksdus(__b, __a);7883#else7884return __builtin_altivec_vpksdus(__a, __b);7885#endif7886}78877888static __inline__ vector unsigned int __ATTRS_o_ai7889vec_packsu(vector unsigned long long __a, vector unsigned long long __b) {7890#ifdef __LITTLE_ENDIAN__7891return __builtin_altivec_vpkudus(__b, __a);7892#else7893return __builtin_altivec_vpkudus(__a, __b);7894#endif7895}7896#endif78977898/* vec_vpkshus */78997900static __inline__ vector unsigned char __ATTRS_o_ai7901vec_vpkshus(vector short __a, vector short __b) {7902#ifdef __LITTLE_ENDIAN__7903return __builtin_altivec_vpkshus(__b, __a);7904#else7905return __builtin_altivec_vpkshus(__a, __b);7906#endif7907}79087909static __inline__ vector unsigned char __ATTRS_o_ai7910vec_vpkshus(vector unsigned short __a, vector unsigned short __b) {7911#ifdef __LITTLE_ENDIAN__7912return __builtin_altivec_vpkuhus(__b, __a);7913#else7914return __builtin_altivec_vpkuhus(__a, __b);7915#endif7916}79177918/* vec_vpkswus */79197920static __inline__ vector unsigned short __ATTRS_o_ai7921vec_vpkswus(vector int __a, vector int __b) {7922#ifdef __LITTLE_ENDIAN__7923return __builtin_altivec_vpkswus(__b, __a);7924#else7925return __builtin_altivec_vpkswus(__a, __b);7926#endif7927}79287929static __inline__ vector unsigned short __ATTRS_o_ai7930vec_vpkswus(vector unsigned int __a, vector unsigned int __b) {7931#ifdef __LITTLE_ENDIAN__7932return __builtin_altivec_vpkuwus(__b, __a);7933#else7934return __builtin_altivec_vpkuwus(__a, __b);7935#endif7936}79377938/* vec_vpksdus */79397940#ifdef __POWER8_VECTOR__7941static __inline__ vector unsigned int __ATTRS_o_ai7942vec_vpksdus(vector long long __a, vector long long __b) {7943#ifdef __LITTLE_ENDIAN__7944return __builtin_altivec_vpksdus(__b, __a);7945#else7946return __builtin_altivec_vpksdus(__a, __b);7947#endif7948}7949#endif79507951/* vec_perm */79527953// The vperm instruction is defined architecturally with a big-endian bias.7954// For little endian, we swap the input operands and invert the permute7955// control vector. Only the rightmost 5 bits matter, so we could use7956// a vector of all 31s instead of all 255s to perform the inversion.7957// However, when the PCV is not a constant, using 255 has an advantage7958// in that the vec_xor can be recognized as a vec_nor (and for P8 and7959// later, possibly a vec_nand).79607961static __inline__ vector signed char __ATTRS_o_ai vec_perm(7962vector signed char __a, vector signed char __b, vector unsigned char __c) {7963#ifdef __LITTLE_ENDIAN__7964vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,7965255, 255, 255, 255, 255, 255, 255, 255};7966__d = vec_xor(__c, __d);7967return (vector signed char)__builtin_altivec_vperm_4si((vector int)__b,7968(vector int)__a, __d);7969#else7970return (vector signed char)__builtin_altivec_vperm_4si((vector int)__a,7971(vector int)__b, __c);7972#endif7973}79747975static __inline__ vector unsigned char __ATTRS_o_ai7976vec_perm(vector unsigned char __a, vector unsigned char __b,7977vector unsigned char __c) {7978#ifdef __LITTLE_ENDIAN__7979vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,7980255, 255, 255, 255, 255, 255, 255, 255};7981__d = vec_xor(__c, __d);7982return (vector unsigned char)__builtin_altivec_vperm_4si(7983(vector int)__b, (vector int)__a, __d);7984#else7985return (vector unsigned char)__builtin_altivec_vperm_4si(7986(vector int)__a, (vector int)__b, __c);7987#endif7988}79897990static __inline__ vector bool char __ATTRS_o_ai7991vec_perm(vector bool char __a, vector bool char __b, vector unsigned char __c) {7992#ifdef __LITTLE_ENDIAN__7993vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,7994255, 255, 255, 255, 255, 255, 255, 255};7995__d = vec_xor(__c, __d);7996return (vector bool char)__builtin_altivec_vperm_4si((vector int)__b,7997(vector int)__a, __d);7998#else7999return (vector bool char)__builtin_altivec_vperm_4si((vector int)__a,8000(vector int)__b, __c);8001#endif8002}80038004static __inline__ vector short __ATTRS_o_ai vec_perm(vector signed short __a,8005vector signed short __b,8006vector unsigned char __c) {8007#ifdef __LITTLE_ENDIAN__8008vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8009255, 255, 255, 255, 255, 255, 255, 255};8010__d = vec_xor(__c, __d);8011return (vector signed short)__builtin_altivec_vperm_4si((vector int)__b,8012(vector int)__a, __d);8013#else8014return (vector signed short)__builtin_altivec_vperm_4si((vector int)__a,8015(vector int)__b, __c);8016#endif8017}80188019static __inline__ vector unsigned short __ATTRS_o_ai8020vec_perm(vector unsigned short __a, vector unsigned short __b,8021vector unsigned char __c) {8022#ifdef __LITTLE_ENDIAN__8023vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8024255, 255, 255, 255, 255, 255, 255, 255};8025__d = vec_xor(__c, __d);8026return (vector unsigned short)__builtin_altivec_vperm_4si(8027(vector int)__b, (vector int)__a, __d);8028#else8029return (vector unsigned short)__builtin_altivec_vperm_4si(8030(vector int)__a, (vector int)__b, __c);8031#endif8032}80338034static __inline__ vector bool short __ATTRS_o_ai vec_perm(8035vector bool short __a, vector bool short __b, vector unsigned char __c) {8036#ifdef __LITTLE_ENDIAN__8037vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8038255, 255, 255, 255, 255, 255, 255, 255};8039__d = vec_xor(__c, __d);8040return (vector bool short)__builtin_altivec_vperm_4si((vector int)__b,8041(vector int)__a, __d);8042#else8043return (vector bool short)__builtin_altivec_vperm_4si((vector int)__a,8044(vector int)__b, __c);8045#endif8046}80478048static __inline__ vector pixel __ATTRS_o_ai vec_perm(vector pixel __a,8049vector pixel __b,8050vector unsigned char __c) {8051#ifdef __LITTLE_ENDIAN__8052vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8053255, 255, 255, 255, 255, 255, 255, 255};8054__d = vec_xor(__c, __d);8055return (vector pixel)__builtin_altivec_vperm_4si((vector int)__b,8056(vector int)__a, __d);8057#else8058return (vector pixel)__builtin_altivec_vperm_4si((vector int)__a,8059(vector int)__b, __c);8060#endif8061}80628063static __inline__ vector int __ATTRS_o_ai vec_perm(vector signed int __a,8064vector signed int __b,8065vector unsigned char __c) {8066#ifdef __LITTLE_ENDIAN__8067vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8068255, 255, 255, 255, 255, 255, 255, 255};8069__d = vec_xor(__c, __d);8070return (vector signed int)__builtin_altivec_vperm_4si(__b, __a, __d);8071#else8072return (vector signed int)__builtin_altivec_vperm_4si(__a, __b, __c);8073#endif8074}80758076static __inline__ vector unsigned int __ATTRS_o_ai8077vec_perm(vector unsigned int __a, vector unsigned int __b,8078vector unsigned char __c) {8079#ifdef __LITTLE_ENDIAN__8080vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8081255, 255, 255, 255, 255, 255, 255, 255};8082__d = vec_xor(__c, __d);8083return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__b,8084(vector int)__a, __d);8085#else8086return (vector unsigned int)__builtin_altivec_vperm_4si((vector int)__a,8087(vector int)__b, __c);8088#endif8089}80908091static __inline__ vector bool int __ATTRS_o_ai8092vec_perm(vector bool int __a, vector bool int __b, vector unsigned char __c) {8093#ifdef __LITTLE_ENDIAN__8094vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8095255, 255, 255, 255, 255, 255, 255, 255};8096__d = vec_xor(__c, __d);8097return (vector bool int)__builtin_altivec_vperm_4si((vector int)__b,8098(vector int)__a, __d);8099#else8100return (vector bool int)__builtin_altivec_vperm_4si((vector int)__a,8101(vector int)__b, __c);8102#endif8103}81048105static __inline__ vector float __ATTRS_o_ai vec_perm(vector float __a,8106vector float __b,8107vector unsigned char __c) {8108#ifdef __LITTLE_ENDIAN__8109vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8110255, 255, 255, 255, 255, 255, 255, 255};8111__d = vec_xor(__c, __d);8112return (vector float)__builtin_altivec_vperm_4si((vector int)__b,8113(vector int)__a, __d);8114#else8115return (vector float)__builtin_altivec_vperm_4si((vector int)__a,8116(vector int)__b, __c);8117#endif8118}81198120#ifdef __VSX__8121static __inline__ vector long long __ATTRS_o_ai8122vec_perm(vector signed long long __a, vector signed long long __b,8123vector unsigned char __c) {8124#ifdef __LITTLE_ENDIAN__8125vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8126255, 255, 255, 255, 255, 255, 255, 255};8127__d = vec_xor(__c, __d);8128return (vector signed long long)__builtin_altivec_vperm_4si(8129(vector int)__b, (vector int)__a, __d);8130#else8131return (vector signed long long)__builtin_altivec_vperm_4si(8132(vector int)__a, (vector int)__b, __c);8133#endif8134}81358136static __inline__ vector unsigned long long __ATTRS_o_ai8137vec_perm(vector unsigned long long __a, vector unsigned long long __b,8138vector unsigned char __c) {8139#ifdef __LITTLE_ENDIAN__8140vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8141255, 255, 255, 255, 255, 255, 255, 255};8142__d = vec_xor(__c, __d);8143return (vector unsigned long long)__builtin_altivec_vperm_4si(8144(vector int)__b, (vector int)__a, __d);8145#else8146return (vector unsigned long long)__builtin_altivec_vperm_4si(8147(vector int)__a, (vector int)__b, __c);8148#endif8149}81508151static __inline__ vector bool long long __ATTRS_o_ai8152vec_perm(vector bool long long __a, vector bool long long __b,8153vector unsigned char __c) {8154#ifdef __LITTLE_ENDIAN__8155vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8156255, 255, 255, 255, 255, 255, 255, 255};8157__d = vec_xor(__c, __d);8158return (vector bool long long)__builtin_altivec_vperm_4si(8159(vector int)__b, (vector int)__a, __d);8160#else8161return (vector bool long long)__builtin_altivec_vperm_4si(8162(vector int)__a, (vector int)__b, __c);8163#endif8164}81658166static __inline__ vector double __ATTRS_o_ai8167vec_perm(vector double __a, vector double __b, vector unsigned char __c) {8168#ifdef __LITTLE_ENDIAN__8169vector unsigned char __d = {255, 255, 255, 255, 255, 255, 255, 255,8170255, 255, 255, 255, 255, 255, 255, 255};8171__d = vec_xor(__c, __d);8172return (vector double)__builtin_altivec_vperm_4si((vector int)__b,8173(vector int)__a, __d);8174#else8175return (vector double)__builtin_altivec_vperm_4si((vector int)__a,8176(vector int)__b, __c);8177#endif8178}8179#endif81808181/* vec_vperm */81828183static __inline__ vector signed char __ATTRS_o_ai vec_vperm(8184vector signed char __a, vector signed char __b, vector unsigned char __c) {8185return vec_perm(__a, __b, __c);8186}81878188static __inline__ vector unsigned char __ATTRS_o_ai8189vec_vperm(vector unsigned char __a, vector unsigned char __b,8190vector unsigned char __c) {8191return vec_perm(__a, __b, __c);8192}81938194static __inline__ vector bool char __ATTRS_o_ai vec_vperm(8195vector bool char __a, vector bool char __b, vector unsigned char __c) {8196return vec_perm(__a, __b, __c);8197}81988199static __inline__ vector short __ATTRS_o_ai8200vec_vperm(vector short __a, vector short __b, vector unsigned char __c) {8201return vec_perm(__a, __b, __c);8202}82038204static __inline__ vector unsigned short __ATTRS_o_ai8205vec_vperm(vector unsigned short __a, vector unsigned short __b,8206vector unsigned char __c) {8207return vec_perm(__a, __b, __c);8208}82098210static __inline__ vector bool short __ATTRS_o_ai vec_vperm(8211vector bool short __a, vector bool short __b, vector unsigned char __c) {8212return vec_perm(__a, __b, __c);8213}82148215static __inline__ vector pixel __ATTRS_o_ai8216vec_vperm(vector pixel __a, vector pixel __b, vector unsigned char __c) {8217return vec_perm(__a, __b, __c);8218}82198220static __inline__ vector int __ATTRS_o_ai vec_vperm(vector int __a,8221vector int __b,8222vector unsigned char __c) {8223return vec_perm(__a, __b, __c);8224}82258226static __inline__ vector unsigned int __ATTRS_o_ai8227vec_vperm(vector unsigned int __a, vector unsigned int __b,8228vector unsigned char __c) {8229return vec_perm(__a, __b, __c);8230}82318232static __inline__ vector bool int __ATTRS_o_ai8233vec_vperm(vector bool int __a, vector bool int __b, vector unsigned char __c) {8234return vec_perm(__a, __b, __c);8235}82368237static __inline__ vector float __ATTRS_o_ai8238vec_vperm(vector float __a, vector float __b, vector unsigned char __c) {8239return vec_perm(__a, __b, __c);8240}82418242#ifdef __VSX__8243static __inline__ vector long long __ATTRS_o_ai vec_vperm(8244vector long long __a, vector long long __b, vector unsigned char __c) {8245return vec_perm(__a, __b, __c);8246}82478248static __inline__ vector unsigned long long __ATTRS_o_ai8249vec_vperm(vector unsigned long long __a, vector unsigned long long __b,8250vector unsigned char __c) {8251return vec_perm(__a, __b, __c);8252}82538254static __inline__ vector double __ATTRS_o_ai8255vec_vperm(vector double __a, vector double __b, vector unsigned char __c) {8256return vec_perm(__a, __b, __c);8257}8258#endif82598260/* vec_re */82618262static __inline__ vector float __ATTRS_o_ai vec_re(vector float __a) {8263#ifdef __VSX__8264return __builtin_vsx_xvresp(__a);8265#else8266return __builtin_altivec_vrefp(__a);8267#endif8268}82698270#ifdef __VSX__8271static __inline__ vector double __ATTRS_o_ai vec_re(vector double __a) {8272return __builtin_vsx_xvredp(__a);8273}8274#endif82758276/* vec_vrefp */82778278static __inline__ vector float __attribute__((__always_inline__))8279vec_vrefp(vector float __a) {8280return __builtin_altivec_vrefp(__a);8281}82828283/* vec_rl */82848285static __inline__ vector signed char __ATTRS_o_ai8286vec_rl(vector signed char __a, vector unsigned char __b) {8287return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);8288}82898290static __inline__ vector unsigned char __ATTRS_o_ai8291vec_rl(vector unsigned char __a, vector unsigned char __b) {8292return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);8293}82948295static __inline__ vector short __ATTRS_o_ai vec_rl(vector short __a,8296vector unsigned short __b) {8297return __builtin_altivec_vrlh(__a, __b);8298}82998300static __inline__ vector unsigned short __ATTRS_o_ai8301vec_rl(vector unsigned short __a, vector unsigned short __b) {8302return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);8303}83048305static __inline__ vector int __ATTRS_o_ai vec_rl(vector int __a,8306vector unsigned int __b) {8307return __builtin_altivec_vrlw(__a, __b);8308}83098310static __inline__ vector unsigned int __ATTRS_o_ai8311vec_rl(vector unsigned int __a, vector unsigned int __b) {8312return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);8313}83148315#ifdef __POWER8_VECTOR__8316static __inline__ vector signed long long __ATTRS_o_ai8317vec_rl(vector signed long long __a, vector unsigned long long __b) {8318return __builtin_altivec_vrld(__a, __b);8319}83208321static __inline__ vector unsigned long long __ATTRS_o_ai8322vec_rl(vector unsigned long long __a, vector unsigned long long __b) {8323return (vector unsigned long long)__builtin_altivec_vrld(8324(vector long long)__a, __b);8325}8326#endif83278328#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)8329static __inline__ vector signed __int128 __ATTRS_o_ai8330vec_rl(vector signed __int128 __a, vector unsigned __int128 __b) {8331return (vector signed __int128)(((vector unsigned __int128)__b8332<< (vector unsigned __int128)__a) |8333((vector unsigned __int128)__b >>8334((__CHAR_BIT__ *8335sizeof(vector unsigned __int128)) -8336(vector unsigned __int128)__a)));8337}83388339static __inline__ vector unsigned __int128 __ATTRS_o_ai8340vec_rl(vector unsigned __int128 __a, vector unsigned __int128 __b) {8341return (__b << __a)|(__b >> ((__CHAR_BIT__ * sizeof(vector unsigned __int128)) - __a));8342}8343#endif83448345/* vec_rlmi */8346#ifdef __POWER9_VECTOR__8347static __inline__ vector unsigned int __ATTRS_o_ai8348vec_rlmi(vector unsigned int __a, vector unsigned int __b,8349vector unsigned int __c) {8350return __builtin_altivec_vrlwmi(__a, __c, __b);8351}83528353static __inline__ vector unsigned long long __ATTRS_o_ai8354vec_rlmi(vector unsigned long long __a, vector unsigned long long __b,8355vector unsigned long long __c) {8356return __builtin_altivec_vrldmi(__a, __c, __b);8357}8358#endif83598360#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)8361static __inline__ vector unsigned __int128 __ATTRS_o_ai8362vec_rlmi(vector unsigned __int128 __a, vector unsigned __int128 __b,8363vector unsigned __int128 __c) {8364return __builtin_altivec_vrlqmi(__a, __c, __b);8365}83668367static __inline__ vector signed __int128 __ATTRS_o_ai8368vec_rlmi(vector signed __int128 __a, vector signed __int128 __b,8369vector signed __int128 __c) {8370return (vector signed __int128)__builtin_altivec_vrlqmi(8371(vector unsigned __int128)__a, (vector unsigned __int128)__c,8372(vector unsigned __int128)__b);8373}8374#endif83758376/* vec_rlnm */8377#ifdef __POWER9_VECTOR__8378static __inline__ vector unsigned int __ATTRS_o_ai8379vec_rlnm(vector unsigned int __a, vector unsigned int __b,8380vector unsigned int __c) {8381vector unsigned int OneByte = { 0x8, 0x8, 0x8, 0x8 };8382return __builtin_altivec_vrlwnm(__a, ((__c << OneByte) | __b));8383}83848385static __inline__ vector unsigned long long __ATTRS_o_ai8386vec_rlnm(vector unsigned long long __a, vector unsigned long long __b,8387vector unsigned long long __c) {8388vector unsigned long long OneByte = { 0x8, 0x8 };8389return __builtin_altivec_vrldnm(__a, ((__c << OneByte) | __b));8390}8391#endif83928393#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)8394static __inline__ vector unsigned __int128 __ATTRS_o_ai8395vec_rlnm(vector unsigned __int128 __a, vector unsigned __int128 __b,8396vector unsigned __int128 __c) {8397// Merge __b and __c using an appropriate shuffle.8398vector unsigned char TmpB = (vector unsigned char)__b;8399vector unsigned char TmpC = (vector unsigned char)__c;8400vector unsigned char MaskAndShift =8401#ifdef __LITTLE_ENDIAN__8402__builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,84031, -1, -1, -1, -1, -1);8404#else8405__builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,8406-1, -1, -1, -1, -1, -1, -1);8407#endif8408return __builtin_altivec_vrlqnm(__a, (vector unsigned __int128) MaskAndShift);8409}84108411static __inline__ vector signed __int128 __ATTRS_o_ai8412vec_rlnm(vector signed __int128 __a, vector signed __int128 __b,8413vector signed __int128 __c) {8414// Merge __b and __c using an appropriate shuffle.8415vector unsigned char TmpB = (vector unsigned char)__b;8416vector unsigned char TmpC = (vector unsigned char)__c;8417vector unsigned char MaskAndShift =8418#ifdef __LITTLE_ENDIAN__8419__builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, -1, -1, -1, 16, 0,84201, -1, -1, -1, -1, -1);8421#else8422__builtin_shufflevector(TmpB, TmpC, -1, -1, -1, -1, -1, 31, 30, 15, -1,8423-1, -1, -1, -1, -1, -1, -1);8424#endif8425return (vector signed __int128)__builtin_altivec_vrlqnm(8426(vector unsigned __int128)__a, (vector unsigned __int128)MaskAndShift);8427}8428#endif84298430/* vec_vrlb */84318432static __inline__ vector signed char __ATTRS_o_ai8433vec_vrlb(vector signed char __a, vector unsigned char __b) {8434return (vector signed char)__builtin_altivec_vrlb((vector char)__a, __b);8435}84368437static __inline__ vector unsigned char __ATTRS_o_ai8438vec_vrlb(vector unsigned char __a, vector unsigned char __b) {8439return (vector unsigned char)__builtin_altivec_vrlb((vector char)__a, __b);8440}84418442/* vec_vrlh */84438444static __inline__ vector short __ATTRS_o_ai8445vec_vrlh(vector short __a, vector unsigned short __b) {8446return __builtin_altivec_vrlh(__a, __b);8447}84488449static __inline__ vector unsigned short __ATTRS_o_ai8450vec_vrlh(vector unsigned short __a, vector unsigned short __b) {8451return (vector unsigned short)__builtin_altivec_vrlh((vector short)__a, __b);8452}84538454/* vec_vrlw */84558456static __inline__ vector int __ATTRS_o_ai vec_vrlw(vector int __a,8457vector unsigned int __b) {8458return __builtin_altivec_vrlw(__a, __b);8459}84608461static __inline__ vector unsigned int __ATTRS_o_ai8462vec_vrlw(vector unsigned int __a, vector unsigned int __b) {8463return (vector unsigned int)__builtin_altivec_vrlw((vector int)__a, __b);8464}84658466/* vec_round */84678468static __inline__ vector float __ATTRS_o_ai vec_round(vector float __a) {8469return __builtin_altivec_vrfin(__a);8470}84718472#ifdef __VSX__8473#ifdef __XL_COMPAT_ALTIVEC__8474static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a);8475static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {8476double __fpscr = __builtin_readflm();8477__builtin_setrnd(0);8478vector double __rounded = vec_rint(__a);8479__builtin_setflm(__fpscr);8480return __rounded;8481}8482#else8483static __inline__ vector double __ATTRS_o_ai vec_round(vector double __a) {8484return __builtin_vsx_xvrdpi(__a);8485}8486#endif84878488/* vec_rint */84898490static __inline__ vector float __ATTRS_o_ai vec_rint(vector float __a) {8491return __builtin_vsx_xvrspic(__a);8492}84938494static __inline__ vector double __ATTRS_o_ai vec_rint(vector double __a) {8495return __builtin_vsx_xvrdpic(__a);8496}84978498/* vec_roundc */84998500static __inline__ vector float __ATTRS_o_ai vec_roundc(vector float __a) {8501return __builtin_vsx_xvrspic(__a);8502}85038504static __inline__ vector double __ATTRS_o_ai vec_roundc(vector double __a) {8505return __builtin_vsx_xvrdpic(__a);8506}85078508/* vec_nearbyint */85098510static __inline__ vector float __ATTRS_o_ai vec_nearbyint(vector float __a) {8511return __builtin_vsx_xvrspi(__a);8512}85138514static __inline__ vector double __ATTRS_o_ai vec_nearbyint(vector double __a) {8515return __builtin_vsx_xvrdpi(__a);8516}8517#endif85188519/* vec_vrfin */85208521static __inline__ vector float __attribute__((__always_inline__))8522vec_vrfin(vector float __a) {8523return __builtin_altivec_vrfin(__a);8524}85258526/* vec_sqrt */85278528#ifdef __VSX__8529static __inline__ vector float __ATTRS_o_ai vec_sqrt(vector float __a) {8530return __builtin_vsx_xvsqrtsp(__a);8531}85328533static __inline__ vector double __ATTRS_o_ai vec_sqrt(vector double __a) {8534return __builtin_vsx_xvsqrtdp(__a);8535}8536#endif85378538/* vec_rsqrte */85398540static __inline__ vector float __ATTRS_o_ai vec_rsqrte(vector float __a) {8541#ifdef __VSX__8542return __builtin_vsx_xvrsqrtesp(__a);8543#else8544return __builtin_altivec_vrsqrtefp(__a);8545#endif8546}85478548#ifdef __VSX__8549static __inline__ vector double __ATTRS_o_ai vec_rsqrte(vector double __a) {8550return __builtin_vsx_xvrsqrtedp(__a);8551}8552#endif85538554static vector float __ATTRS_o_ai vec_rsqrt(vector float __a) {8555return __builtin_ppc_rsqrtf(__a);8556}85578558#ifdef __VSX__8559static vector double __ATTRS_o_ai vec_rsqrt(vector double __a) {8560return __builtin_ppc_rsqrtd(__a);8561}8562#endif85638564/* vec_vrsqrtefp */85658566static __inline__ __vector float __attribute__((__always_inline__))8567vec_vrsqrtefp(vector float __a) {8568return __builtin_altivec_vrsqrtefp(__a);8569}85708571/* vec_xvtsqrt */85728573#ifdef __VSX__8574static __inline__ int __ATTRS_o_ai vec_test_swsqrt(vector double __a) {8575return __builtin_vsx_xvtsqrtdp(__a);8576}85778578static __inline__ int __ATTRS_o_ai vec_test_swsqrts(vector float __a) {8579return __builtin_vsx_xvtsqrtsp(__a);8580}8581#endif85828583/* vec_sel */85848585#define __builtin_altivec_vsel_4si vec_sel85868587static __inline__ vector signed char __ATTRS_o_ai vec_sel(8588vector signed char __a, vector signed char __b, vector unsigned char __c) {8589return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);8590}85918592static __inline__ vector signed char __ATTRS_o_ai8593vec_sel(vector signed char __a, vector signed char __b, vector bool char __c) {8594return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);8595}85968597static __inline__ vector unsigned char __ATTRS_o_ai8598vec_sel(vector unsigned char __a, vector unsigned char __b,8599vector unsigned char __c) {8600return (__a & ~__c) | (__b & __c);8601}86028603static __inline__ vector unsigned char __ATTRS_o_ai vec_sel(8604vector unsigned char __a, vector unsigned char __b, vector bool char __c) {8605return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);8606}86078608static __inline__ vector bool char __ATTRS_o_ai8609vec_sel(vector bool char __a, vector bool char __b, vector unsigned char __c) {8610return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);8611}86128613static __inline__ vector bool char __ATTRS_o_ai vec_sel(vector bool char __a,8614vector bool char __b,8615vector bool char __c) {8616return (__a & ~__c) | (__b & __c);8617}86188619static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,8620vector short __b,8621vector unsigned short __c) {8622return (__a & ~(vector short)__c) | (__b & (vector short)__c);8623}86248625static __inline__ vector short __ATTRS_o_ai vec_sel(vector short __a,8626vector short __b,8627vector bool short __c) {8628return (__a & ~(vector short)__c) | (__b & (vector short)__c);8629}86308631static __inline__ vector unsigned short __ATTRS_o_ai8632vec_sel(vector unsigned short __a, vector unsigned short __b,8633vector unsigned short __c) {8634return (__a & ~__c) | (__b & __c);8635}86368637static __inline__ vector unsigned short __ATTRS_o_ai8638vec_sel(vector unsigned short __a, vector unsigned short __b,8639vector bool short __c) {8640return (__a & ~(vector unsigned short)__c) |8641(__b & (vector unsigned short)__c);8642}86438644static __inline__ vector bool short __ATTRS_o_ai vec_sel(8645vector bool short __a, vector bool short __b, vector unsigned short __c) {8646return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);8647}86488649static __inline__ vector bool short __ATTRS_o_ai8650vec_sel(vector bool short __a, vector bool short __b, vector bool short __c) {8651return (__a & ~__c) | (__b & __c);8652}86538654static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,8655vector int __b,8656vector unsigned int __c) {8657return (__a & ~(vector int)__c) | (__b & (vector int)__c);8658}86598660static __inline__ vector int __ATTRS_o_ai vec_sel(vector int __a,8661vector int __b,8662vector bool int __c) {8663return (__a & ~(vector int)__c) | (__b & (vector int)__c);8664}86658666static __inline__ vector unsigned int __ATTRS_o_ai vec_sel(8667vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {8668return (__a & ~__c) | (__b & __c);8669}86708671static __inline__ vector unsigned int __ATTRS_o_ai8672vec_sel(vector unsigned int __a, vector unsigned int __b, vector bool int __c) {8673return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);8674}86758676static __inline__ vector bool int __ATTRS_o_ai8677vec_sel(vector bool int __a, vector bool int __b, vector unsigned int __c) {8678return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);8679}86808681static __inline__ vector bool int __ATTRS_o_ai vec_sel(vector bool int __a,8682vector bool int __b,8683vector bool int __c) {8684return (__a & ~__c) | (__b & __c);8685}86868687static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,8688vector float __b,8689vector unsigned int __c) {8690vector int __res = ((vector int)__a & ~(vector int)__c) |8691((vector int)__b & (vector int)__c);8692return (vector float)__res;8693}86948695static __inline__ vector float __ATTRS_o_ai vec_sel(vector float __a,8696vector float __b,8697vector bool int __c) {8698vector int __res = ((vector int)__a & ~(vector int)__c) |8699((vector int)__b & (vector int)__c);8700return (vector float)__res;8701}87028703#ifdef __VSX__8704static __inline__ vector double __ATTRS_o_ai8705vec_sel(vector double __a, vector double __b, vector bool long long __c) {8706vector long long __res = ((vector long long)__a & ~(vector long long)__c) |8707((vector long long)__b & (vector long long)__c);8708return (vector double)__res;8709}87108711static __inline__ vector double __ATTRS_o_ai8712vec_sel(vector double __a, vector double __b, vector unsigned long long __c) {8713vector long long __res = ((vector long long)__a & ~(vector long long)__c) |8714((vector long long)__b & (vector long long)__c);8715return (vector double)__res;8716}87178718static __inline__ vector bool long long __ATTRS_o_ai8719vec_sel(vector bool long long __a, vector bool long long __b,8720vector bool long long __c) {8721return (__a & ~__c) | (__b & __c);8722}87238724static __inline__ vector bool long long __ATTRS_o_ai8725vec_sel(vector bool long long __a, vector bool long long __b,8726vector unsigned long long __c) {8727return (__a & ~(vector bool long long)__c) |8728(__b & (vector bool long long)__c);8729}87308731static __inline__ vector signed long long __ATTRS_o_ai8732vec_sel(vector signed long long __a, vector signed long long __b,8733vector bool long long __c) {8734return (__a & ~(vector signed long long)__c) |8735(__b & (vector signed long long)__c);8736}87378738static __inline__ vector signed long long __ATTRS_o_ai8739vec_sel(vector signed long long __a, vector signed long long __b,8740vector unsigned long long __c) {8741return (__a & ~(vector signed long long)__c) |8742(__b & (vector signed long long)__c);8743}87448745static __inline__ vector unsigned long long __ATTRS_o_ai8746vec_sel(vector unsigned long long __a, vector unsigned long long __b,8747vector bool long long __c) {8748return (__a & ~(vector unsigned long long)__c) |8749(__b & (vector unsigned long long)__c);8750}87518752static __inline__ vector unsigned long long __ATTRS_o_ai8753vec_sel(vector unsigned long long __a, vector unsigned long long __b,8754vector unsigned long long __c) {8755return (__a & ~__c) | (__b & __c);8756}8757#endif87588759/* vec_vsel */87608761static __inline__ vector signed char __ATTRS_o_ai vec_vsel(8762vector signed char __a, vector signed char __b, vector unsigned char __c) {8763return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);8764}87658766static __inline__ vector signed char __ATTRS_o_ai8767vec_vsel(vector signed char __a, vector signed char __b, vector bool char __c) {8768return (__a & ~(vector signed char)__c) | (__b & (vector signed char)__c);8769}87708771static __inline__ vector unsigned char __ATTRS_o_ai8772vec_vsel(vector unsigned char __a, vector unsigned char __b,8773vector unsigned char __c) {8774return (__a & ~__c) | (__b & __c);8775}87768777static __inline__ vector unsigned char __ATTRS_o_ai vec_vsel(8778vector unsigned char __a, vector unsigned char __b, vector bool char __c) {8779return (__a & ~(vector unsigned char)__c) | (__b & (vector unsigned char)__c);8780}87818782static __inline__ vector bool char __ATTRS_o_ai8783vec_vsel(vector bool char __a, vector bool char __b, vector unsigned char __c) {8784return (__a & ~(vector bool char)__c) | (__b & (vector bool char)__c);8785}87868787static __inline__ vector bool char __ATTRS_o_ai vec_vsel(vector bool char __a,8788vector bool char __b,8789vector bool char __c) {8790return (__a & ~__c) | (__b & __c);8791}87928793static __inline__ vector short __ATTRS_o_ai8794vec_vsel(vector short __a, vector short __b, vector unsigned short __c) {8795return (__a & ~(vector short)__c) | (__b & (vector short)__c);8796}87978798static __inline__ vector short __ATTRS_o_ai vec_vsel(vector short __a,8799vector short __b,8800vector bool short __c) {8801return (__a & ~(vector short)__c) | (__b & (vector short)__c);8802}88038804static __inline__ vector unsigned short __ATTRS_o_ai8805vec_vsel(vector unsigned short __a, vector unsigned short __b,8806vector unsigned short __c) {8807return (__a & ~__c) | (__b & __c);8808}88098810static __inline__ vector unsigned short __ATTRS_o_ai8811vec_vsel(vector unsigned short __a, vector unsigned short __b,8812vector bool short __c) {8813return (__a & ~(vector unsigned short)__c) |8814(__b & (vector unsigned short)__c);8815}88168817static __inline__ vector bool short __ATTRS_o_ai vec_vsel(8818vector bool short __a, vector bool short __b, vector unsigned short __c) {8819return (__a & ~(vector bool short)__c) | (__b & (vector bool short)__c);8820}88218822static __inline__ vector bool short __ATTRS_o_ai8823vec_vsel(vector bool short __a, vector bool short __b, vector bool short __c) {8824return (__a & ~__c) | (__b & __c);8825}88268827static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,8828vector int __b,8829vector unsigned int __c) {8830return (__a & ~(vector int)__c) | (__b & (vector int)__c);8831}88328833static __inline__ vector int __ATTRS_o_ai vec_vsel(vector int __a,8834vector int __b,8835vector bool int __c) {8836return (__a & ~(vector int)__c) | (__b & (vector int)__c);8837}88388839static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(8840vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {8841return (__a & ~__c) | (__b & __c);8842}88438844static __inline__ vector unsigned int __ATTRS_o_ai vec_vsel(8845vector unsigned int __a, vector unsigned int __b, vector bool int __c) {8846return (__a & ~(vector unsigned int)__c) | (__b & (vector unsigned int)__c);8847}88488849static __inline__ vector bool int __ATTRS_o_ai8850vec_vsel(vector bool int __a, vector bool int __b, vector unsigned int __c) {8851return (__a & ~(vector bool int)__c) | (__b & (vector bool int)__c);8852}88538854static __inline__ vector bool int __ATTRS_o_ai vec_vsel(vector bool int __a,8855vector bool int __b,8856vector bool int __c) {8857return (__a & ~__c) | (__b & __c);8858}88598860static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,8861vector float __b,8862vector unsigned int __c) {8863vector int __res = ((vector int)__a & ~(vector int)__c) |8864((vector int)__b & (vector int)__c);8865return (vector float)__res;8866}88678868static __inline__ vector float __ATTRS_o_ai vec_vsel(vector float __a,8869vector float __b,8870vector bool int __c) {8871vector int __res = ((vector int)__a & ~(vector int)__c) |8872((vector int)__b & (vector int)__c);8873return (vector float)__res;8874}88758876/* vec_sl */88778878// vec_sl does modulo arithmetic on __b first, so __b is allowed to be more8879// than the length of __a.8880static __inline__ vector unsigned char __ATTRS_o_ai8881vec_sl(vector unsigned char __a, vector unsigned char __b) {8882return __a << (__b %8883(vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));8884}88858886static __inline__ vector signed char __ATTRS_o_ai8887vec_sl(vector signed char __a, vector unsigned char __b) {8888return (vector signed char)vec_sl((vector unsigned char)__a, __b);8889}88908891static __inline__ vector unsigned short __ATTRS_o_ai8892vec_sl(vector unsigned short __a, vector unsigned short __b) {8893return __a << (__b % (vector unsigned short)(sizeof(unsigned short) *8894__CHAR_BIT__));8895}88968897static __inline__ vector short __ATTRS_o_ai vec_sl(vector short __a,8898vector unsigned short __b) {8899return (vector short)vec_sl((vector unsigned short)__a, __b);8900}89018902static __inline__ vector unsigned int __ATTRS_o_ai8903vec_sl(vector unsigned int __a, vector unsigned int __b) {8904return __a << (__b %8905(vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));8906}89078908static __inline__ vector int __ATTRS_o_ai vec_sl(vector int __a,8909vector unsigned int __b) {8910return (vector int)vec_sl((vector unsigned int)__a, __b);8911}89128913#ifdef __POWER8_VECTOR__8914static __inline__ vector unsigned long long __ATTRS_o_ai8915vec_sl(vector unsigned long long __a, vector unsigned long long __b) {8916return __a << (__b % (vector unsigned long long)(sizeof(unsigned long long) *8917__CHAR_BIT__));8918}89198920static __inline__ vector long long __ATTRS_o_ai8921vec_sl(vector long long __a, vector unsigned long long __b) {8922return (vector long long)vec_sl((vector unsigned long long)__a, __b);8923}8924#elif defined(__VSX__)8925static __inline__ vector unsigned char __ATTRS_o_ai8926vec_vspltb(vector unsigned char __a, unsigned char __b);8927static __inline__ vector unsigned long long __ATTRS_o_ai8928vec_sl(vector unsigned long long __a, vector unsigned long long __b) {8929__b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);89308931// Big endian element one (the right doubleword) can be left shifted as-is.8932// The other element needs to be swapped into the right doubleword and8933// shifted. Then the right doublewords of the two result vectors are merged.8934vector signed long long __rightelt =8935(vector signed long long)__builtin_altivec_vslo((vector signed int)__a,8936(vector signed int)__b);8937#ifdef __LITTLE_ENDIAN__8938__rightelt = (vector signed long long)__builtin_altivec_vsl(8939(vector signed int)__rightelt,8940(vector signed int)vec_vspltb((vector unsigned char)__b, 0));8941#else8942__rightelt = (vector signed long long)__builtin_altivec_vsl(8943(vector signed int)__rightelt,8944(vector signed int)vec_vspltb((vector unsigned char)__b, 15));8945#endif8946__a = __builtin_shufflevector(__a, __a, 1, 0);8947__b = __builtin_shufflevector(__b, __b, 1, 0);8948vector signed long long __leftelt =8949(vector signed long long)__builtin_altivec_vslo((vector signed int)__a,8950(vector signed int)__b);8951#ifdef __LITTLE_ENDIAN__8952__leftelt = (vector signed long long)__builtin_altivec_vsl(8953(vector signed int)__leftelt,8954(vector signed int)vec_vspltb((vector unsigned char)__b, 0));8955return (vector unsigned long long)__builtin_shufflevector(__rightelt,8956__leftelt, 0, 2);8957#else8958__leftelt = (vector signed long long)__builtin_altivec_vsl(8959(vector signed int)__leftelt,8960(vector signed int)vec_vspltb((vector unsigned char)__b, 15));8961return (vector unsigned long long)__builtin_shufflevector(__leftelt,8962__rightelt, 1, 3);8963#endif8964}89658966static __inline__ vector long long __ATTRS_o_ai8967vec_sl(vector long long __a, vector unsigned long long __b) {8968return (vector long long)vec_sl((vector unsigned long long)__a, __b);8969}8970#endif /* __VSX__ */89718972/* vec_vslb */89738974#define __builtin_altivec_vslb vec_vslb89758976static __inline__ vector signed char __ATTRS_o_ai8977vec_vslb(vector signed char __a, vector unsigned char __b) {8978return vec_sl(__a, __b);8979}89808981static __inline__ vector unsigned char __ATTRS_o_ai8982vec_vslb(vector unsigned char __a, vector unsigned char __b) {8983return vec_sl(__a, __b);8984}89858986/* vec_vslh */89878988#define __builtin_altivec_vslh vec_vslh89898990static __inline__ vector short __ATTRS_o_ai8991vec_vslh(vector short __a, vector unsigned short __b) {8992return vec_sl(__a, __b);8993}89948995static __inline__ vector unsigned short __ATTRS_o_ai8996vec_vslh(vector unsigned short __a, vector unsigned short __b) {8997return vec_sl(__a, __b);8998}89999000/* vec_vslw */90019002#define __builtin_altivec_vslw vec_vslw90039004static __inline__ vector int __ATTRS_o_ai vec_vslw(vector int __a,9005vector unsigned int __b) {9006return vec_sl(__a, __b);9007}90089009static __inline__ vector unsigned int __ATTRS_o_ai9010vec_vslw(vector unsigned int __a, vector unsigned int __b) {9011return vec_sl(__a, __b);9012}90139014/* vec_sld */90159016#define __builtin_altivec_vsldoi_4si vec_sld90179018static __inline__ vector signed char __ATTRS_o_ai vec_sld(9019vector signed char __a, vector signed char __b, unsigned const int __c) {9020unsigned char __d = __c & 0x0F;9021#ifdef __LITTLE_ENDIAN__9022return vec_perm(9023__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,902420 - __d, 21 - __d, 22 - __d, 23 - __d,902524 - __d, 25 - __d, 26 - __d, 27 - __d,902628 - __d, 29 - __d, 30 - __d, 31 - __d));9027#else9028return vec_perm(9029__a, __b,9030(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9031__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9032__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9033#endif9034}90359036static __inline__ vector unsigned char __ATTRS_o_ai9037vec_sld(vector unsigned char __a, vector unsigned char __b,9038unsigned const int __c) {9039unsigned char __d = __c & 0x0F;9040#ifdef __LITTLE_ENDIAN__9041return vec_perm(9042__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,904320 - __d, 21 - __d, 22 - __d, 23 - __d,904424 - __d, 25 - __d, 26 - __d, 27 - __d,904528 - __d, 29 - __d, 30 - __d, 31 - __d));9046#else9047return vec_perm(9048__a, __b,9049(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9050__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9051__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9052#endif9053}90549055static __inline__ vector bool char __ATTRS_o_ai9056vec_sld(vector bool char __a, vector bool char __b, unsigned const int __c) {9057unsigned char __d = __c & 0x0F;9058#ifdef __LITTLE_ENDIAN__9059return vec_perm(9060__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,906120 - __d, 21 - __d, 22 - __d, 23 - __d,906224 - __d, 25 - __d, 26 - __d, 27 - __d,906328 - __d, 29 - __d, 30 - __d, 31 - __d));9064#else9065return vec_perm(9066__a, __b,9067(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9068__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9069__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9070#endif9071}90729073static __inline__ vector signed short __ATTRS_o_ai vec_sld(9074vector signed short __a, vector signed short __b, unsigned const int __c) {9075unsigned char __d = __c & 0x0F;9076#ifdef __LITTLE_ENDIAN__9077return vec_perm(9078__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,907920 - __d, 21 - __d, 22 - __d, 23 - __d,908024 - __d, 25 - __d, 26 - __d, 27 - __d,908128 - __d, 29 - __d, 30 - __d, 31 - __d));9082#else9083return vec_perm(9084__a, __b,9085(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9086__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9087__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9088#endif9089}90909091static __inline__ vector unsigned short __ATTRS_o_ai9092vec_sld(vector unsigned short __a, vector unsigned short __b,9093unsigned const int __c) {9094unsigned char __d = __c & 0x0F;9095#ifdef __LITTLE_ENDIAN__9096return vec_perm(9097__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,909820 - __d, 21 - __d, 22 - __d, 23 - __d,909924 - __d, 25 - __d, 26 - __d, 27 - __d,910028 - __d, 29 - __d, 30 - __d, 31 - __d));9101#else9102return vec_perm(9103__a, __b,9104(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9105__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9106__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9107#endif9108}91099110static __inline__ vector bool short __ATTRS_o_ai9111vec_sld(vector bool short __a, vector bool short __b, unsigned const int __c) {9112unsigned char __d = __c & 0x0F;9113#ifdef __LITTLE_ENDIAN__9114return vec_perm(9115__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,911620 - __d, 21 - __d, 22 - __d, 23 - __d,911724 - __d, 25 - __d, 26 - __d, 27 - __d,911828 - __d, 29 - __d, 30 - __d, 31 - __d));9119#else9120return vec_perm(9121__a, __b,9122(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9123__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9124__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9125#endif9126}91279128static __inline__ vector pixel __ATTRS_o_ai vec_sld(vector pixel __a,9129vector pixel __b,9130unsigned const int __c) {9131unsigned char __d = __c & 0x0F;9132#ifdef __LITTLE_ENDIAN__9133return vec_perm(9134__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,913520 - __d, 21 - __d, 22 - __d, 23 - __d,913624 - __d, 25 - __d, 26 - __d, 27 - __d,913728 - __d, 29 - __d, 30 - __d, 31 - __d));9138#else9139return vec_perm(9140__a, __b,9141(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9142__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9143__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9144#endif9145}91469147static __inline__ vector signed int __ATTRS_o_ai9148vec_sld(vector signed int __a, vector signed int __b, unsigned const int __c) {9149unsigned char __d = __c & 0x0F;9150#ifdef __LITTLE_ENDIAN__9151return vec_perm(9152__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,915320 - __d, 21 - __d, 22 - __d, 23 - __d,915424 - __d, 25 - __d, 26 - __d, 27 - __d,915528 - __d, 29 - __d, 30 - __d, 31 - __d));9156#else9157return vec_perm(9158__a, __b,9159(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9160__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9161__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9162#endif9163}91649165static __inline__ vector unsigned int __ATTRS_o_ai vec_sld(9166vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {9167unsigned char __d = __c & 0x0F;9168#ifdef __LITTLE_ENDIAN__9169return vec_perm(9170__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,917120 - __d, 21 - __d, 22 - __d, 23 - __d,917224 - __d, 25 - __d, 26 - __d, 27 - __d,917328 - __d, 29 - __d, 30 - __d, 31 - __d));9174#else9175return vec_perm(9176__a, __b,9177(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9178__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9179__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9180#endif9181}91829183static __inline__ vector bool int __ATTRS_o_ai vec_sld(vector bool int __a,9184vector bool int __b,9185unsigned const int __c) {9186unsigned char __d = __c & 0x0F;9187#ifdef __LITTLE_ENDIAN__9188return vec_perm(9189__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,919020 - __d, 21 - __d, 22 - __d, 23 - __d,919124 - __d, 25 - __d, 26 - __d, 27 - __d,919228 - __d, 29 - __d, 30 - __d, 31 - __d));9193#else9194return vec_perm(9195__a, __b,9196(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9197__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9198__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9199#endif9200}92019202static __inline__ vector float __ATTRS_o_ai vec_sld(vector float __a,9203vector float __b,9204unsigned const int __c) {9205unsigned char __d = __c & 0x0F;9206#ifdef __LITTLE_ENDIAN__9207return vec_perm(9208__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,920920 - __d, 21 - __d, 22 - __d, 23 - __d,921024 - __d, 25 - __d, 26 - __d, 27 - __d,921128 - __d, 29 - __d, 30 - __d, 31 - __d));9212#else9213return vec_perm(9214__a, __b,9215(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9216__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9217__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9218#endif9219}92209221#ifdef __VSX__9222static __inline__ vector bool long long __ATTRS_o_ai9223vec_sld(vector bool long long __a, vector bool long long __b,9224unsigned const int __c) {9225unsigned char __d = __c & 0x0F;9226#ifdef __LITTLE_ENDIAN__9227return vec_perm(9228__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,922920 - __d, 21 - __d, 22 - __d, 23 - __d,923024 - __d, 25 - __d, 26 - __d, 27 - __d,923128 - __d, 29 - __d, 30 - __d, 31 - __d));9232#else9233return vec_perm(9234__a, __b,9235(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9236__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9237__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9238#endif9239}92409241static __inline__ vector signed long long __ATTRS_o_ai9242vec_sld(vector signed long long __a, vector signed long long __b,9243unsigned const int __c) {9244unsigned char __d = __c & 0x0F;9245#ifdef __LITTLE_ENDIAN__9246return vec_perm(9247__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,924820 - __d, 21 - __d, 22 - __d, 23 - __d,924924 - __d, 25 - __d, 26 - __d, 27 - __d,925028 - __d, 29 - __d, 30 - __d, 31 - __d));9251#else9252return vec_perm(9253__a, __b,9254(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9255__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9256__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9257#endif9258}92599260static __inline__ vector unsigned long long __ATTRS_o_ai9261vec_sld(vector unsigned long long __a, vector unsigned long long __b,9262unsigned const int __c) {9263unsigned char __d = __c & 0x0F;9264#ifdef __LITTLE_ENDIAN__9265return vec_perm(9266__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,926720 - __d, 21 - __d, 22 - __d, 23 - __d,926824 - __d, 25 - __d, 26 - __d, 27 - __d,926928 - __d, 29 - __d, 30 - __d, 31 - __d));9270#else9271return vec_perm(9272__a, __b,9273(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9274__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9275__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9276#endif9277}92789279static __inline__ vector double __ATTRS_o_ai vec_sld(vector double __a,9280vector double __b,9281unsigned const int __c) {9282unsigned char __d = __c & 0x0F;9283#ifdef __LITTLE_ENDIAN__9284return vec_perm(9285__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,928620 - __d, 21 - __d, 22 - __d, 23 - __d,928724 - __d, 25 - __d, 26 - __d, 27 - __d,928828 - __d, 29 - __d, 30 - __d, 31 - __d));9289#else9290return vec_perm(9291__a, __b,9292(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9293__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9294__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9295#endif9296}9297#endif92989299/* vec_sldw */9300static __inline__ vector signed char __ATTRS_o_ai vec_sldw(9301vector signed char __a, vector signed char __b, unsigned const int __c) {9302return vec_sld(__a, __b, ((__c << 2) & 0x0F));9303}93049305static __inline__ vector unsigned char __ATTRS_o_ai9306vec_sldw(vector unsigned char __a, vector unsigned char __b,9307unsigned const int __c) {9308return vec_sld(__a, __b, ((__c << 2) & 0x0F));9309}93109311static __inline__ vector signed short __ATTRS_o_ai vec_sldw(9312vector signed short __a, vector signed short __b, unsigned const int __c) {9313return vec_sld(__a, __b, ((__c << 2) & 0x0F));9314}93159316static __inline__ vector unsigned short __ATTRS_o_ai9317vec_sldw(vector unsigned short __a, vector unsigned short __b,9318unsigned const int __c) {9319return vec_sld(__a, __b, ((__c << 2) & 0x0F));9320}93219322static __inline__ vector signed int __ATTRS_o_ai9323vec_sldw(vector signed int __a, vector signed int __b, unsigned const int __c) {9324return vec_sld(__a, __b, ((__c << 2) & 0x0F));9325}93269327static __inline__ vector unsigned int __ATTRS_o_ai vec_sldw(9328vector unsigned int __a, vector unsigned int __b, unsigned const int __c) {9329return vec_sld(__a, __b, ((__c << 2) & 0x0F));9330}93319332static __inline__ vector float __ATTRS_o_ai vec_sldw(9333vector float __a, vector float __b, unsigned const int __c) {9334return vec_sld(__a, __b, ((__c << 2) & 0x0F));9335}93369337#ifdef __VSX__9338static __inline__ vector signed long long __ATTRS_o_ai9339vec_sldw(vector signed long long __a, vector signed long long __b,9340unsigned const int __c) {9341return vec_sld(__a, __b, ((__c << 2) & 0x0F));9342}93439344static __inline__ vector unsigned long long __ATTRS_o_ai9345vec_sldw(vector unsigned long long __a, vector unsigned long long __b,9346unsigned const int __c) {9347return vec_sld(__a, __b, ((__c << 2) & 0x0F));9348}93499350static __inline__ vector double __ATTRS_o_ai vec_sldw(9351vector double __a, vector double __b, unsigned const int __c) {9352return vec_sld(__a, __b, ((__c << 2) & 0x0F));9353}9354#endif93559356#ifdef __POWER9_VECTOR__9357/* vec_slv */9358static __inline__ vector unsigned char __ATTRS_o_ai9359vec_slv(vector unsigned char __a, vector unsigned char __b) {9360return __builtin_altivec_vslv(__a, __b);9361}93629363/* vec_srv */9364static __inline__ vector unsigned char __ATTRS_o_ai9365vec_srv(vector unsigned char __a, vector unsigned char __b) {9366return __builtin_altivec_vsrv(__a, __b);9367}9368#endif93699370/* vec_vsldoi */93719372static __inline__ vector signed char __ATTRS_o_ai9373vec_vsldoi(vector signed char __a, vector signed char __b, unsigned char __c) {9374unsigned char __d = __c & 0x0F;9375#ifdef __LITTLE_ENDIAN__9376return vec_perm(9377__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,937820 - __d, 21 - __d, 22 - __d, 23 - __d,937924 - __d, 25 - __d, 26 - __d, 27 - __d,938028 - __d, 29 - __d, 30 - __d, 31 - __d));9381#else9382return vec_perm(9383__a, __b,9384(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9385__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9386__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9387#endif9388}93899390static __inline__ vector unsigned char __ATTRS_o_ai vec_vsldoi(9391vector unsigned char __a, vector unsigned char __b, unsigned char __c) {9392unsigned char __d = __c & 0x0F;9393#ifdef __LITTLE_ENDIAN__9394return vec_perm(9395__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,939620 - __d, 21 - __d, 22 - __d, 23 - __d,939724 - __d, 25 - __d, 26 - __d, 27 - __d,939828 - __d, 29 - __d, 30 - __d, 31 - __d));9399#else9400return vec_perm(9401__a, __b,9402(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9403__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9404__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9405#endif9406}94079408static __inline__ vector short __ATTRS_o_ai vec_vsldoi(vector short __a,9409vector short __b,9410unsigned char __c) {9411unsigned char __d = __c & 0x0F;9412#ifdef __LITTLE_ENDIAN__9413return vec_perm(9414__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,941520 - __d, 21 - __d, 22 - __d, 23 - __d,941624 - __d, 25 - __d, 26 - __d, 27 - __d,941728 - __d, 29 - __d, 30 - __d, 31 - __d));9418#else9419return vec_perm(9420__a, __b,9421(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9422__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9423__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9424#endif9425}94269427static __inline__ vector unsigned short __ATTRS_o_ai vec_vsldoi(9428vector unsigned short __a, vector unsigned short __b, unsigned char __c) {9429unsigned char __d = __c & 0x0F;9430#ifdef __LITTLE_ENDIAN__9431return vec_perm(9432__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,943320 - __d, 21 - __d, 22 - __d, 23 - __d,943424 - __d, 25 - __d, 26 - __d, 27 - __d,943528 - __d, 29 - __d, 30 - __d, 31 - __d));9436#else9437return vec_perm(9438__a, __b,9439(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9440__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9441__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9442#endif9443}94449445static __inline__ vector pixel __ATTRS_o_ai vec_vsldoi(vector pixel __a,9446vector pixel __b,9447unsigned char __c) {9448unsigned char __d = __c & 0x0F;9449#ifdef __LITTLE_ENDIAN__9450return vec_perm(9451__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,945220 - __d, 21 - __d, 22 - __d, 23 - __d,945324 - __d, 25 - __d, 26 - __d, 27 - __d,945428 - __d, 29 - __d, 30 - __d, 31 - __d));9455#else9456return vec_perm(9457__a, __b,9458(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9459__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9460__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9461#endif9462}94639464static __inline__ vector int __ATTRS_o_ai vec_vsldoi(vector int __a,9465vector int __b,9466unsigned char __c) {9467unsigned char __d = __c & 0x0F;9468#ifdef __LITTLE_ENDIAN__9469return vec_perm(9470__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,947120 - __d, 21 - __d, 22 - __d, 23 - __d,947224 - __d, 25 - __d, 26 - __d, 27 - __d,947328 - __d, 29 - __d, 30 - __d, 31 - __d));9474#else9475return vec_perm(9476__a, __b,9477(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9478__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9479__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9480#endif9481}94829483static __inline__ vector unsigned int __ATTRS_o_ai vec_vsldoi(9484vector unsigned int __a, vector unsigned int __b, unsigned char __c) {9485unsigned char __d = __c & 0x0F;9486#ifdef __LITTLE_ENDIAN__9487return vec_perm(9488__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,948920 - __d, 21 - __d, 22 - __d, 23 - __d,949024 - __d, 25 - __d, 26 - __d, 27 - __d,949128 - __d, 29 - __d, 30 - __d, 31 - __d));9492#else9493return vec_perm(9494__a, __b,9495(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9496__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9497__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9498#endif9499}95009501static __inline__ vector float __ATTRS_o_ai vec_vsldoi(vector float __a,9502vector float __b,9503unsigned char __c) {9504unsigned char __d = __c & 0x0F;9505#ifdef __LITTLE_ENDIAN__9506return vec_perm(9507__b, __a, (vector unsigned char)(16 - __d, 17 - __d, 18 - __d, 19 - __d,950820 - __d, 21 - __d, 22 - __d, 23 - __d,950924 - __d, 25 - __d, 26 - __d, 27 - __d,951028 - __d, 29 - __d, 30 - __d, 31 - __d));9511#else9512return vec_perm(9513__a, __b,9514(vector unsigned char)(__d, __d + 1, __d + 2, __d + 3, __d + 4, __d + 5,9515__d + 6, __d + 7, __d + 8, __d + 9, __d + 10,9516__d + 11, __d + 12, __d + 13, __d + 14, __d + 15));9517#endif9518}95199520/* vec_sll */95219522static __inline__ vector signed char __ATTRS_o_ai9523vec_sll(vector signed char __a, vector unsigned char __b) {9524return (vector signed char)__builtin_altivec_vsl((vector int)__a,9525(vector int)__b);9526}95279528static __inline__ vector signed char __ATTRS_o_ai9529vec_sll(vector signed char __a, vector unsigned short __b) {9530return (vector signed char)__builtin_altivec_vsl((vector int)__a,9531(vector int)__b);9532}95339534static __inline__ vector signed char __ATTRS_o_ai9535vec_sll(vector signed char __a, vector unsigned int __b) {9536return (vector signed char)__builtin_altivec_vsl((vector int)__a,9537(vector int)__b);9538}95399540static __inline__ vector unsigned char __ATTRS_o_ai9541vec_sll(vector unsigned char __a, vector unsigned char __b) {9542return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9543(vector int)__b);9544}95459546static __inline__ vector unsigned char __ATTRS_o_ai9547vec_sll(vector unsigned char __a, vector unsigned short __b) {9548return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9549(vector int)__b);9550}95519552static __inline__ vector unsigned char __ATTRS_o_ai9553vec_sll(vector unsigned char __a, vector unsigned int __b) {9554return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9555(vector int)__b);9556}95579558static __inline__ vector bool char __ATTRS_o_ai9559vec_sll(vector bool char __a, vector unsigned char __b) {9560return (vector bool char)__builtin_altivec_vsl((vector int)__a,9561(vector int)__b);9562}95639564static __inline__ vector bool char __ATTRS_o_ai9565vec_sll(vector bool char __a, vector unsigned short __b) {9566return (vector bool char)__builtin_altivec_vsl((vector int)__a,9567(vector int)__b);9568}95699570static __inline__ vector bool char __ATTRS_o_ai9571vec_sll(vector bool char __a, vector unsigned int __b) {9572return (vector bool char)__builtin_altivec_vsl((vector int)__a,9573(vector int)__b);9574}95759576static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,9577vector unsigned char __b) {9578return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9579}95809581static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,9582vector unsigned short __b) {9583return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9584}95859586static __inline__ vector short __ATTRS_o_ai vec_sll(vector short __a,9587vector unsigned int __b) {9588return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9589}95909591static __inline__ vector unsigned short __ATTRS_o_ai9592vec_sll(vector unsigned short __a, vector unsigned char __b) {9593return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9594(vector int)__b);9595}95969597static __inline__ vector unsigned short __ATTRS_o_ai9598vec_sll(vector unsigned short __a, vector unsigned short __b) {9599return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9600(vector int)__b);9601}96029603static __inline__ vector unsigned short __ATTRS_o_ai9604vec_sll(vector unsigned short __a, vector unsigned int __b) {9605return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9606(vector int)__b);9607}96089609static __inline__ vector bool short __ATTRS_o_ai9610vec_sll(vector bool short __a, vector unsigned char __b) {9611return (vector bool short)__builtin_altivec_vsl((vector int)__a,9612(vector int)__b);9613}96149615static __inline__ vector bool short __ATTRS_o_ai9616vec_sll(vector bool short __a, vector unsigned short __b) {9617return (vector bool short)__builtin_altivec_vsl((vector int)__a,9618(vector int)__b);9619}96209621static __inline__ vector bool short __ATTRS_o_ai9622vec_sll(vector bool short __a, vector unsigned int __b) {9623return (vector bool short)__builtin_altivec_vsl((vector int)__a,9624(vector int)__b);9625}96269627static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,9628vector unsigned char __b) {9629return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9630}96319632static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,9633vector unsigned short __b) {9634return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9635}96369637static __inline__ vector pixel __ATTRS_o_ai vec_sll(vector pixel __a,9638vector unsigned int __b) {9639return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9640}96419642static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,9643vector unsigned char __b) {9644return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9645}96469647static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,9648vector unsigned short __b) {9649return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9650}96519652static __inline__ vector int __ATTRS_o_ai vec_sll(vector int __a,9653vector unsigned int __b) {9654return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9655}96569657static __inline__ vector unsigned int __ATTRS_o_ai9658vec_sll(vector unsigned int __a, vector unsigned char __b) {9659return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9660(vector int)__b);9661}96629663static __inline__ vector unsigned int __ATTRS_o_ai9664vec_sll(vector unsigned int __a, vector unsigned short __b) {9665return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9666(vector int)__b);9667}96689669static __inline__ vector unsigned int __ATTRS_o_ai9670vec_sll(vector unsigned int __a, vector unsigned int __b) {9671return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9672(vector int)__b);9673}96749675static __inline__ vector bool int __ATTRS_o_ai9676vec_sll(vector bool int __a, vector unsigned char __b) {9677return (vector bool int)__builtin_altivec_vsl((vector int)__a,9678(vector int)__b);9679}96809681static __inline__ vector bool int __ATTRS_o_ai9682vec_sll(vector bool int __a, vector unsigned short __b) {9683return (vector bool int)__builtin_altivec_vsl((vector int)__a,9684(vector int)__b);9685}96869687static __inline__ vector bool int __ATTRS_o_ai9688vec_sll(vector bool int __a, vector unsigned int __b) {9689return (vector bool int)__builtin_altivec_vsl((vector int)__a,9690(vector int)__b);9691}96929693#ifdef __VSX__9694static __inline__ vector signed long long __ATTRS_o_ai9695vec_sll(vector signed long long __a, vector unsigned char __b) {9696return (vector signed long long)__builtin_altivec_vsl((vector int)__a,9697(vector int)__b);9698}96999700static __inline__ vector unsigned long long __ATTRS_o_ai9701vec_sll(vector unsigned long long __a, vector unsigned char __b) {9702return (vector unsigned long long)__builtin_altivec_vsl((vector int)__a,9703(vector int)__b);9704}9705#endif97069707/* vec_vsl */97089709static __inline__ vector signed char __ATTRS_o_ai9710vec_vsl(vector signed char __a, vector unsigned char __b) {9711return (vector signed char)__builtin_altivec_vsl((vector int)__a,9712(vector int)__b);9713}97149715static __inline__ vector signed char __ATTRS_o_ai9716vec_vsl(vector signed char __a, vector unsigned short __b) {9717return (vector signed char)__builtin_altivec_vsl((vector int)__a,9718(vector int)__b);9719}97209721static __inline__ vector signed char __ATTRS_o_ai9722vec_vsl(vector signed char __a, vector unsigned int __b) {9723return (vector signed char)__builtin_altivec_vsl((vector int)__a,9724(vector int)__b);9725}97269727static __inline__ vector unsigned char __ATTRS_o_ai9728vec_vsl(vector unsigned char __a, vector unsigned char __b) {9729return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9730(vector int)__b);9731}97329733static __inline__ vector unsigned char __ATTRS_o_ai9734vec_vsl(vector unsigned char __a, vector unsigned short __b) {9735return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9736(vector int)__b);9737}97389739static __inline__ vector unsigned char __ATTRS_o_ai9740vec_vsl(vector unsigned char __a, vector unsigned int __b) {9741return (vector unsigned char)__builtin_altivec_vsl((vector int)__a,9742(vector int)__b);9743}97449745static __inline__ vector bool char __ATTRS_o_ai9746vec_vsl(vector bool char __a, vector unsigned char __b) {9747return (vector bool char)__builtin_altivec_vsl((vector int)__a,9748(vector int)__b);9749}97509751static __inline__ vector bool char __ATTRS_o_ai9752vec_vsl(vector bool char __a, vector unsigned short __b) {9753return (vector bool char)__builtin_altivec_vsl((vector int)__a,9754(vector int)__b);9755}97569757static __inline__ vector bool char __ATTRS_o_ai9758vec_vsl(vector bool char __a, vector unsigned int __b) {9759return (vector bool char)__builtin_altivec_vsl((vector int)__a,9760(vector int)__b);9761}97629763static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,9764vector unsigned char __b) {9765return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9766}97679768static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,9769vector unsigned short __b) {9770return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9771}97729773static __inline__ vector short __ATTRS_o_ai vec_vsl(vector short __a,9774vector unsigned int __b) {9775return (vector short)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9776}97779778static __inline__ vector unsigned short __ATTRS_o_ai9779vec_vsl(vector unsigned short __a, vector unsigned char __b) {9780return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9781(vector int)__b);9782}97839784static __inline__ vector unsigned short __ATTRS_o_ai9785vec_vsl(vector unsigned short __a, vector unsigned short __b) {9786return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9787(vector int)__b);9788}97899790static __inline__ vector unsigned short __ATTRS_o_ai9791vec_vsl(vector unsigned short __a, vector unsigned int __b) {9792return (vector unsigned short)__builtin_altivec_vsl((vector int)__a,9793(vector int)__b);9794}97959796static __inline__ vector bool short __ATTRS_o_ai9797vec_vsl(vector bool short __a, vector unsigned char __b) {9798return (vector bool short)__builtin_altivec_vsl((vector int)__a,9799(vector int)__b);9800}98019802static __inline__ vector bool short __ATTRS_o_ai9803vec_vsl(vector bool short __a, vector unsigned short __b) {9804return (vector bool short)__builtin_altivec_vsl((vector int)__a,9805(vector int)__b);9806}98079808static __inline__ vector bool short __ATTRS_o_ai9809vec_vsl(vector bool short __a, vector unsigned int __b) {9810return (vector bool short)__builtin_altivec_vsl((vector int)__a,9811(vector int)__b);9812}98139814static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,9815vector unsigned char __b) {9816return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9817}98189819static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,9820vector unsigned short __b) {9821return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9822}98239824static __inline__ vector pixel __ATTRS_o_ai vec_vsl(vector pixel __a,9825vector unsigned int __b) {9826return (vector pixel)__builtin_altivec_vsl((vector int)__a, (vector int)__b);9827}98289829static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,9830vector unsigned char __b) {9831return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9832}98339834static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,9835vector unsigned short __b) {9836return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9837}98389839static __inline__ vector int __ATTRS_o_ai vec_vsl(vector int __a,9840vector unsigned int __b) {9841return (vector int)__builtin_altivec_vsl(__a, (vector int)__b);9842}98439844static __inline__ vector unsigned int __ATTRS_o_ai9845vec_vsl(vector unsigned int __a, vector unsigned char __b) {9846return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9847(vector int)__b);9848}98499850static __inline__ vector unsigned int __ATTRS_o_ai9851vec_vsl(vector unsigned int __a, vector unsigned short __b) {9852return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9853(vector int)__b);9854}98559856static __inline__ vector unsigned int __ATTRS_o_ai9857vec_vsl(vector unsigned int __a, vector unsigned int __b) {9858return (vector unsigned int)__builtin_altivec_vsl((vector int)__a,9859(vector int)__b);9860}98619862static __inline__ vector bool int __ATTRS_o_ai9863vec_vsl(vector bool int __a, vector unsigned char __b) {9864return (vector bool int)__builtin_altivec_vsl((vector int)__a,9865(vector int)__b);9866}98679868static __inline__ vector bool int __ATTRS_o_ai9869vec_vsl(vector bool int __a, vector unsigned short __b) {9870return (vector bool int)__builtin_altivec_vsl((vector int)__a,9871(vector int)__b);9872}98739874static __inline__ vector bool int __ATTRS_o_ai9875vec_vsl(vector bool int __a, vector unsigned int __b) {9876return (vector bool int)__builtin_altivec_vsl((vector int)__a,9877(vector int)__b);9878}98799880/* vec_slo */98819882static __inline__ vector signed char __ATTRS_o_ai9883vec_slo(vector signed char __a, vector signed char __b) {9884return (vector signed char)__builtin_altivec_vslo((vector int)__a,9885(vector int)__b);9886}98879888static __inline__ vector signed char __ATTRS_o_ai9889vec_slo(vector signed char __a, vector unsigned char __b) {9890return (vector signed char)__builtin_altivec_vslo((vector int)__a,9891(vector int)__b);9892}98939894static __inline__ vector unsigned char __ATTRS_o_ai9895vec_slo(vector unsigned char __a, vector signed char __b) {9896return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,9897(vector int)__b);9898}98999900static __inline__ vector unsigned char __ATTRS_o_ai9901vec_slo(vector unsigned char __a, vector unsigned char __b) {9902return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,9903(vector int)__b);9904}99059906static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,9907vector signed char __b) {9908return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9909}99109911static __inline__ vector short __ATTRS_o_ai vec_slo(vector short __a,9912vector unsigned char __b) {9913return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9914}99159916static __inline__ vector unsigned short __ATTRS_o_ai9917vec_slo(vector unsigned short __a, vector signed char __b) {9918return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,9919(vector int)__b);9920}99219922static __inline__ vector unsigned short __ATTRS_o_ai9923vec_slo(vector unsigned short __a, vector unsigned char __b) {9924return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,9925(vector int)__b);9926}99279928static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,9929vector signed char __b) {9930return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9931}99329933static __inline__ vector pixel __ATTRS_o_ai vec_slo(vector pixel __a,9934vector unsigned char __b) {9935return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9936}99379938static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,9939vector signed char __b) {9940return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);9941}99429943static __inline__ vector int __ATTRS_o_ai vec_slo(vector int __a,9944vector unsigned char __b) {9945return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);9946}99479948static __inline__ vector unsigned int __ATTRS_o_ai9949vec_slo(vector unsigned int __a, vector signed char __b) {9950return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,9951(vector int)__b);9952}99539954static __inline__ vector unsigned int __ATTRS_o_ai9955vec_slo(vector unsigned int __a, vector unsigned char __b) {9956return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,9957(vector int)__b);9958}99599960static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,9961vector signed char __b) {9962return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9963}99649965static __inline__ vector float __ATTRS_o_ai vec_slo(vector float __a,9966vector unsigned char __b) {9967return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);9968}99699970#ifdef __VSX__9971static __inline__ vector signed long long __ATTRS_o_ai9972vec_slo(vector signed long long __a, vector signed char __b) {9973return (vector signed long long)__builtin_altivec_vslo((vector int)__a,9974(vector int)__b);9975}99769977static __inline__ vector signed long long __ATTRS_o_ai9978vec_slo(vector signed long long __a, vector unsigned char __b) {9979return (vector signed long long)__builtin_altivec_vslo((vector int)__a,9980(vector int)__b);9981}99829983static __inline__ vector unsigned long long __ATTRS_o_ai9984vec_slo(vector unsigned long long __a, vector signed char __b) {9985return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,9986(vector int)__b);9987}99889989static __inline__ vector unsigned long long __ATTRS_o_ai9990vec_slo(vector unsigned long long __a, vector unsigned char __b) {9991return (vector unsigned long long)__builtin_altivec_vslo((vector int)__a,9992(vector int)__b);9993}9994#endif99959996/* vec_vslo */99979998static __inline__ vector signed char __ATTRS_o_ai9999vec_vslo(vector signed char __a, vector signed char __b) {10000return (vector signed char)__builtin_altivec_vslo((vector int)__a,10001(vector int)__b);10002}1000310004static __inline__ vector signed char __ATTRS_o_ai10005vec_vslo(vector signed char __a, vector unsigned char __b) {10006return (vector signed char)__builtin_altivec_vslo((vector int)__a,10007(vector int)__b);10008}1000910010static __inline__ vector unsigned char __ATTRS_o_ai10011vec_vslo(vector unsigned char __a, vector signed char __b) {10012return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,10013(vector int)__b);10014}1001510016static __inline__ vector unsigned char __ATTRS_o_ai10017vec_vslo(vector unsigned char __a, vector unsigned char __b) {10018return (vector unsigned char)__builtin_altivec_vslo((vector int)__a,10019(vector int)__b);10020}1002110022static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,10023vector signed char __b) {10024return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10025}1002610027static __inline__ vector short __ATTRS_o_ai vec_vslo(vector short __a,10028vector unsigned char __b) {10029return (vector short)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10030}1003110032static __inline__ vector unsigned short __ATTRS_o_ai10033vec_vslo(vector unsigned short __a, vector signed char __b) {10034return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,10035(vector int)__b);10036}1003710038static __inline__ vector unsigned short __ATTRS_o_ai10039vec_vslo(vector unsigned short __a, vector unsigned char __b) {10040return (vector unsigned short)__builtin_altivec_vslo((vector int)__a,10041(vector int)__b);10042}1004310044static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,10045vector signed char __b) {10046return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10047}1004810049static __inline__ vector pixel __ATTRS_o_ai vec_vslo(vector pixel __a,10050vector unsigned char __b) {10051return (vector pixel)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10052}1005310054static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,10055vector signed char __b) {10056return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);10057}1005810059static __inline__ vector int __ATTRS_o_ai vec_vslo(vector int __a,10060vector unsigned char __b) {10061return (vector int)__builtin_altivec_vslo(__a, (vector int)__b);10062}1006310064static __inline__ vector unsigned int __ATTRS_o_ai10065vec_vslo(vector unsigned int __a, vector signed char __b) {10066return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,10067(vector int)__b);10068}1006910070static __inline__ vector unsigned int __ATTRS_o_ai10071vec_vslo(vector unsigned int __a, vector unsigned char __b) {10072return (vector unsigned int)__builtin_altivec_vslo((vector int)__a,10073(vector int)__b);10074}1007510076static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,10077vector signed char __b) {10078return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10079}1008010081static __inline__ vector float __ATTRS_o_ai vec_vslo(vector float __a,10082vector unsigned char __b) {10083return (vector float)__builtin_altivec_vslo((vector int)__a, (vector int)__b);10084}1008510086/* vec_splat */1008710088static __inline__ vector signed char __ATTRS_o_ai10089vec_splat(vector signed char __a, unsigned const int __b) {10090return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));10091}1009210093static __inline__ vector unsigned char __ATTRS_o_ai10094vec_splat(vector unsigned char __a, unsigned const int __b) {10095return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));10096}1009710098static __inline__ vector bool char __ATTRS_o_ai10099vec_splat(vector bool char __a, unsigned const int __b) {10100return vec_perm(__a, __a, (vector unsigned char)(__b & 0x0F));10101}1010210103static __inline__ vector signed short __ATTRS_o_ai10104vec_splat(vector signed short __a, unsigned const int __b) {10105unsigned char b0 = (__b & 0x07) * 2;10106unsigned char b1 = b0 + 1;10107return vec_perm(__a, __a,10108(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,10109b0, b1, b0, b1, b0, b1));10110}1011110112static __inline__ vector unsigned short __ATTRS_o_ai10113vec_splat(vector unsigned short __a, unsigned const int __b) {10114unsigned char b0 = (__b & 0x07) * 2;10115unsigned char b1 = b0 + 1;10116return vec_perm(__a, __a,10117(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,10118b0, b1, b0, b1, b0, b1));10119}1012010121static __inline__ vector bool short __ATTRS_o_ai10122vec_splat(vector bool short __a, unsigned const int __b) {10123unsigned char b0 = (__b & 0x07) * 2;10124unsigned char b1 = b0 + 1;10125return vec_perm(__a, __a,10126(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,10127b0, b1, b0, b1, b0, b1));10128}1012910130static __inline__ vector pixel __ATTRS_o_ai vec_splat(vector pixel __a,10131unsigned const int __b) {10132unsigned char b0 = (__b & 0x07) * 2;10133unsigned char b1 = b0 + 1;10134return vec_perm(__a, __a,10135(vector unsigned char)(b0, b1, b0, b1, b0, b1, b0, b1, b0, b1,10136b0, b1, b0, b1, b0, b1));10137}1013810139static __inline__ vector signed int __ATTRS_o_ai10140vec_splat(vector signed int __a, unsigned const int __b) {10141unsigned char b0 = (__b & 0x03) * 4;10142unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;10143return vec_perm(__a, __a,10144(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,10145b2, b3, b0, b1, b2, b3));10146}1014710148static __inline__ vector unsigned int __ATTRS_o_ai10149vec_splat(vector unsigned int __a, unsigned const int __b) {10150unsigned char b0 = (__b & 0x03) * 4;10151unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;10152return vec_perm(__a, __a,10153(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,10154b2, b3, b0, b1, b2, b3));10155}1015610157static __inline__ vector bool int __ATTRS_o_ai10158vec_splat(vector bool int __a, unsigned const int __b) {10159unsigned char b0 = (__b & 0x03) * 4;10160unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;10161return vec_perm(__a, __a,10162(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,10163b2, b3, b0, b1, b2, b3));10164}1016510166static __inline__ vector float __ATTRS_o_ai vec_splat(vector float __a,10167unsigned const int __b) {10168unsigned char b0 = (__b & 0x03) * 4;10169unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3;10170return vec_perm(__a, __a,10171(vector unsigned char)(b0, b1, b2, b3, b0, b1, b2, b3, b0, b1,10172b2, b3, b0, b1, b2, b3));10173}1017410175#ifdef __VSX__10176static __inline__ vector double __ATTRS_o_ai vec_splat(vector double __a,10177unsigned const int __b) {10178unsigned char b0 = (__b & 0x01) * 8;10179unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,10180b6 = b0 + 6, b7 = b0 + 7;10181return vec_perm(__a, __a,10182(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,10183b2, b3, b4, b5, b6, b7));10184}10185static __inline__ vector bool long long __ATTRS_o_ai10186vec_splat(vector bool long long __a, unsigned const int __b) {10187unsigned char b0 = (__b & 0x01) * 8;10188unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,10189b6 = b0 + 6, b7 = b0 + 7;10190return vec_perm(__a, __a,10191(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,10192b2, b3, b4, b5, b6, b7));10193}10194static __inline__ vector signed long long __ATTRS_o_ai10195vec_splat(vector signed long long __a, unsigned const int __b) {10196unsigned char b0 = (__b & 0x01) * 8;10197unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,10198b6 = b0 + 6, b7 = b0 + 7;10199return vec_perm(__a, __a,10200(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,10201b2, b3, b4, b5, b6, b7));10202}10203static __inline__ vector unsigned long long __ATTRS_o_ai10204vec_splat(vector unsigned long long __a, unsigned const int __b) {10205unsigned char b0 = (__b & 0x01) * 8;10206unsigned char b1 = b0 + 1, b2 = b0 + 2, b3 = b0 + 3, b4 = b0 + 4, b5 = b0 + 5,10207b6 = b0 + 6, b7 = b0 + 7;10208return vec_perm(__a, __a,10209(vector unsigned char)(b0, b1, b2, b3, b4, b5, b6, b7, b0, b1,10210b2, b3, b4, b5, b6, b7));10211}10212#endif1021310214/* vec_vspltb */1021510216#define __builtin_altivec_vspltb vec_vspltb1021710218static __inline__ vector signed char __ATTRS_o_ai10219vec_vspltb(vector signed char __a, unsigned char __b) {10220return vec_perm(__a, __a, (vector unsigned char)(__b));10221}1022210223static __inline__ vector unsigned char __ATTRS_o_ai10224vec_vspltb(vector unsigned char __a, unsigned char __b) {10225return vec_perm(__a, __a, (vector unsigned char)(__b));10226}1022710228static __inline__ vector bool char __ATTRS_o_ai vec_vspltb(vector bool char __a,10229unsigned char __b) {10230return vec_perm(__a, __a, (vector unsigned char)(__b));10231}1023210233/* vec_vsplth */1023410235#define __builtin_altivec_vsplth vec_vsplth1023610237static __inline__ vector short __ATTRS_o_ai vec_vsplth(vector short __a,10238unsigned char __b) {10239__b *= 2;10240unsigned char b1 = __b + 1;10241return vec_perm(__a, __a,10242(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,10243__b, b1, __b, b1, __b, b1, __b, b1));10244}1024510246static __inline__ vector unsigned short __ATTRS_o_ai10247vec_vsplth(vector unsigned short __a, unsigned char __b) {10248__b *= 2;10249unsigned char b1 = __b + 1;10250return vec_perm(__a, __a,10251(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,10252__b, b1, __b, b1, __b, b1, __b, b1));10253}1025410255static __inline__ vector bool short __ATTRS_o_ai10256vec_vsplth(vector bool short __a, unsigned char __b) {10257__b *= 2;10258unsigned char b1 = __b + 1;10259return vec_perm(__a, __a,10260(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,10261__b, b1, __b, b1, __b, b1, __b, b1));10262}1026310264static __inline__ vector pixel __ATTRS_o_ai vec_vsplth(vector pixel __a,10265unsigned char __b) {10266__b *= 2;10267unsigned char b1 = __b + 1;10268return vec_perm(__a, __a,10269(vector unsigned char)(__b, b1, __b, b1, __b, b1, __b, b1,10270__b, b1, __b, b1, __b, b1, __b, b1));10271}1027210273/* vec_vspltw */1027410275#define __builtin_altivec_vspltw vec_vspltw1027610277static __inline__ vector int __ATTRS_o_ai vec_vspltw(vector int __a,10278unsigned char __b) {10279__b *= 4;10280unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;10281return vec_perm(__a, __a,10282(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,10283b1, b2, b3, __b, b1, b2, b3));10284}1028510286static __inline__ vector unsigned int __ATTRS_o_ai10287vec_vspltw(vector unsigned int __a, unsigned char __b) {10288__b *= 4;10289unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;10290return vec_perm(__a, __a,10291(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,10292b1, b2, b3, __b, b1, b2, b3));10293}1029410295static __inline__ vector bool int __ATTRS_o_ai vec_vspltw(vector bool int __a,10296unsigned char __b) {10297__b *= 4;10298unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;10299return vec_perm(__a, __a,10300(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,10301b1, b2, b3, __b, b1, b2, b3));10302}1030310304static __inline__ vector float __ATTRS_o_ai vec_vspltw(vector float __a,10305unsigned char __b) {10306__b *= 4;10307unsigned char b1 = __b + 1, b2 = __b + 2, b3 = __b + 3;10308return vec_perm(__a, __a,10309(vector unsigned char)(__b, b1, b2, b3, __b, b1, b2, b3, __b,10310b1, b2, b3, __b, b1, b2, b3));10311}1031210313/* vec_splat_s8 */1031410315#define __builtin_altivec_vspltisb vec_splat_s81031610317// FIXME: parameter should be treated as 5-bit signed literal10318static __inline__ vector signed char __ATTRS_o_ai10319vec_splat_s8(signed char __a) {10320return (vector signed char)(__a);10321}1032210323/* vec_vspltisb */1032410325// FIXME: parameter should be treated as 5-bit signed literal10326static __inline__ vector signed char __ATTRS_o_ai10327vec_vspltisb(signed char __a) {10328return (vector signed char)(__a);10329}1033010331/* vec_splat_s16 */1033210333#define __builtin_altivec_vspltish vec_splat_s161033410335// FIXME: parameter should be treated as 5-bit signed literal10336static __inline__ vector short __ATTRS_o_ai vec_splat_s16(signed char __a) {10337return (vector short)(__a);10338}1033910340/* vec_vspltish */1034110342// FIXME: parameter should be treated as 5-bit signed literal10343static __inline__ vector short __ATTRS_o_ai vec_vspltish(signed char __a) {10344return (vector short)(__a);10345}1034610347/* vec_splat_s32 */1034810349#define __builtin_altivec_vspltisw vec_splat_s321035010351// FIXME: parameter should be treated as 5-bit signed literal10352static __inline__ vector int __ATTRS_o_ai vec_splat_s32(signed char __a) {10353return (vector int)(__a);10354}1035510356/* vec_vspltisw */1035710358// FIXME: parameter should be treated as 5-bit signed literal10359static __inline__ vector int __ATTRS_o_ai vec_vspltisw(signed char __a) {10360return (vector int)(__a);10361}1036210363/* vec_splat_u8 */1036410365// FIXME: parameter should be treated as 5-bit signed literal10366static __inline__ vector unsigned char __ATTRS_o_ai10367vec_splat_u8(unsigned char __a) {10368return (vector unsigned char)(__a);10369}1037010371/* vec_splat_u16 */1037210373// FIXME: parameter should be treated as 5-bit signed literal10374static __inline__ vector unsigned short __ATTRS_o_ai10375vec_splat_u16(signed char __a) {10376return (vector unsigned short)(__a);10377}1037810379/* vec_splat_u32 */1038010381// FIXME: parameter should be treated as 5-bit signed literal10382static __inline__ vector unsigned int __ATTRS_o_ai10383vec_splat_u32(signed char __a) {10384return (vector unsigned int)(__a);10385}1038610387/* vec_sr */1038810389// vec_sr does modulo arithmetic on __b first, so __b is allowed to be more10390// than the length of __a.10391static __inline__ vector unsigned char __ATTRS_o_ai10392vec_sr(vector unsigned char __a, vector unsigned char __b) {10393return __a >>10394(__b % (vector unsigned char)(sizeof(unsigned char) * __CHAR_BIT__));10395}1039610397static __inline__ vector signed char __ATTRS_o_ai10398vec_sr(vector signed char __a, vector unsigned char __b) {10399return (vector signed char)vec_sr((vector unsigned char)__a, __b);10400}1040110402static __inline__ vector unsigned short __ATTRS_o_ai10403vec_sr(vector unsigned short __a, vector unsigned short __b) {10404return __a >>10405(__b % (vector unsigned short)(sizeof(unsigned short) * __CHAR_BIT__));10406}1040710408static __inline__ vector short __ATTRS_o_ai vec_sr(vector short __a,10409vector unsigned short __b) {10410return (vector short)vec_sr((vector unsigned short)__a, __b);10411}1041210413static __inline__ vector unsigned int __ATTRS_o_ai10414vec_sr(vector unsigned int __a, vector unsigned int __b) {10415return __a >>10416(__b % (vector unsigned int)(sizeof(unsigned int) * __CHAR_BIT__));10417}1041810419static __inline__ vector int __ATTRS_o_ai vec_sr(vector int __a,10420vector unsigned int __b) {10421return (vector int)vec_sr((vector unsigned int)__a, __b);10422}1042310424#ifdef __POWER8_VECTOR__10425static __inline__ vector unsigned long long __ATTRS_o_ai10426vec_sr(vector unsigned long long __a, vector unsigned long long __b) {10427return __a >> (__b % (vector unsigned long long)(sizeof(unsigned long long) *10428__CHAR_BIT__));10429}1043010431static __inline__ vector long long __ATTRS_o_ai10432vec_sr(vector long long __a, vector unsigned long long __b) {10433return (vector long long)vec_sr((vector unsigned long long)__a, __b);10434}10435#elif defined(__VSX__)10436static __inline__ vector unsigned long long __ATTRS_o_ai10437vec_sr(vector unsigned long long __a, vector unsigned long long __b) {10438__b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);1043910440// Big endian element zero (the left doubleword) can be right shifted as-is.10441// However the shift amount must be in the right doubleword.10442// The other element needs to be swapped into the left doubleword and10443// shifted. Then the left doublewords of the two result vectors are merged.10444vector unsigned long long __swapshift =10445__builtin_shufflevector(__b, __b, 1, 0);10446vector unsigned long long __leftelt =10447(vector unsigned long long)__builtin_altivec_vsro(10448(vector signed int)__a, (vector signed int)__swapshift);10449#ifdef __LITTLE_ENDIAN__10450__leftelt = (vector unsigned long long)__builtin_altivec_vsr(10451(vector signed int)__leftelt,10452(vector signed int)vec_vspltb((vector unsigned char)__swapshift, 0));10453#else10454__leftelt = (vector unsigned long long)__builtin_altivec_vsr(10455(vector signed int)__leftelt,10456(vector signed int)vec_vspltb((vector unsigned char)__swapshift, 15));10457#endif10458__a = __builtin_shufflevector(__a, __a, 1, 0);10459vector unsigned long long __rightelt =10460(vector unsigned long long)__builtin_altivec_vsro((vector signed int)__a,10461(vector signed int)__b);10462#ifdef __LITTLE_ENDIAN__10463__rightelt = (vector unsigned long long)__builtin_altivec_vsr(10464(vector signed int)__rightelt,10465(vector signed int)vec_vspltb((vector unsigned char)__b, 0));10466return __builtin_shufflevector(__rightelt, __leftelt, 1, 3);10467#else10468__rightelt = (vector unsigned long long)__builtin_altivec_vsr(10469(vector signed int)__rightelt,10470(vector signed int)vec_vspltb((vector unsigned char)__b, 15));10471return __builtin_shufflevector(__leftelt, __rightelt, 0, 2);10472#endif10473}1047410475static __inline__ vector long long __ATTRS_o_ai10476vec_sr(vector long long __a, vector unsigned long long __b) {10477return (vector long long)vec_sr((vector unsigned long long)__a, __b);10478}10479#endif /* __VSX__ */1048010481/* vec_vsrb */1048210483#define __builtin_altivec_vsrb vec_vsrb1048410485static __inline__ vector signed char __ATTRS_o_ai10486vec_vsrb(vector signed char __a, vector unsigned char __b) {10487return vec_sr(__a, __b);10488}1048910490static __inline__ vector unsigned char __ATTRS_o_ai10491vec_vsrb(vector unsigned char __a, vector unsigned char __b) {10492return vec_sr(__a, __b);10493}1049410495/* vec_vsrh */1049610497#define __builtin_altivec_vsrh vec_vsrh1049810499static __inline__ vector short __ATTRS_o_ai10500vec_vsrh(vector short __a, vector unsigned short __b) {10501return vec_sr(__a, __b);10502}1050310504static __inline__ vector unsigned short __ATTRS_o_ai10505vec_vsrh(vector unsigned short __a, vector unsigned short __b) {10506return vec_sr(__a, __b);10507}1050810509/* vec_vsrw */1051010511#define __builtin_altivec_vsrw vec_vsrw1051210513static __inline__ vector int __ATTRS_o_ai vec_vsrw(vector int __a,10514vector unsigned int __b) {10515return vec_sr(__a, __b);10516}1051710518static __inline__ vector unsigned int __ATTRS_o_ai10519vec_vsrw(vector unsigned int __a, vector unsigned int __b) {10520return vec_sr(__a, __b);10521}1052210523/* vec_sra */1052410525static __inline__ vector signed char __ATTRS_o_ai10526vec_sra(vector signed char __a, vector unsigned char __b) {10527return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);10528}1052910530static __inline__ vector unsigned char __ATTRS_o_ai10531vec_sra(vector unsigned char __a, vector unsigned char __b) {10532return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);10533}1053410535static __inline__ vector short __ATTRS_o_ai vec_sra(vector short __a,10536vector unsigned short __b) {10537return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);10538}1053910540static __inline__ vector unsigned short __ATTRS_o_ai10541vec_sra(vector unsigned short __a, vector unsigned short __b) {10542return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);10543}1054410545static __inline__ vector int __ATTRS_o_ai vec_sra(vector int __a,10546vector unsigned int __b) {10547return __builtin_altivec_vsraw(__a, __b);10548}1054910550static __inline__ vector unsigned int __ATTRS_o_ai10551vec_sra(vector unsigned int __a, vector unsigned int __b) {10552return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);10553}1055410555#ifdef __POWER8_VECTOR__10556static __inline__ vector signed long long __ATTRS_o_ai10557vec_sra(vector signed long long __a, vector unsigned long long __b) {10558return __a >> __b;10559}1056010561static __inline__ vector unsigned long long __ATTRS_o_ai10562vec_sra(vector unsigned long long __a, vector unsigned long long __b) {10563return (vector unsigned long long)((vector signed long long)__a >> __b);10564}10565#elif defined(__VSX__)10566static __inline__ vector signed long long __ATTRS_o_ai10567vec_sra(vector signed long long __a, vector unsigned long long __b) {10568__b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);10569return __a >> __b;10570}1057110572static __inline__ vector unsigned long long __ATTRS_o_ai10573vec_sra(vector unsigned long long __a, vector unsigned long long __b) {10574__b %= (vector unsigned long long)(sizeof(unsigned long long) * __CHAR_BIT__);10575return (vector unsigned long long)((vector signed long long)__a >> __b);10576}10577#endif /* __VSX__ */1057810579/* vec_vsrab */1058010581static __inline__ vector signed char __ATTRS_o_ai10582vec_vsrab(vector signed char __a, vector unsigned char __b) {10583return (vector signed char)__builtin_altivec_vsrab((vector char)__a, __b);10584}1058510586static __inline__ vector unsigned char __ATTRS_o_ai10587vec_vsrab(vector unsigned char __a, vector unsigned char __b) {10588return (vector unsigned char)__builtin_altivec_vsrab((vector char)__a, __b);10589}1059010591/* vec_vsrah */1059210593static __inline__ vector short __ATTRS_o_ai10594vec_vsrah(vector short __a, vector unsigned short __b) {10595return __builtin_altivec_vsrah(__a, (vector unsigned short)__b);10596}1059710598static __inline__ vector unsigned short __ATTRS_o_ai10599vec_vsrah(vector unsigned short __a, vector unsigned short __b) {10600return (vector unsigned short)__builtin_altivec_vsrah((vector short)__a, __b);10601}1060210603/* vec_vsraw */1060410605static __inline__ vector int __ATTRS_o_ai vec_vsraw(vector int __a,10606vector unsigned int __b) {10607return __builtin_altivec_vsraw(__a, __b);10608}1060910610static __inline__ vector unsigned int __ATTRS_o_ai10611vec_vsraw(vector unsigned int __a, vector unsigned int __b) {10612return (vector unsigned int)__builtin_altivec_vsraw((vector int)__a, __b);10613}1061410615/* vec_srl */1061610617static __inline__ vector signed char __ATTRS_o_ai10618vec_srl(vector signed char __a, vector unsigned char __b) {10619return (vector signed char)__builtin_altivec_vsr((vector int)__a,10620(vector int)__b);10621}1062210623static __inline__ vector signed char __ATTRS_o_ai10624vec_srl(vector signed char __a, vector unsigned short __b) {10625return (vector signed char)__builtin_altivec_vsr((vector int)__a,10626(vector int)__b);10627}1062810629static __inline__ vector signed char __ATTRS_o_ai10630vec_srl(vector signed char __a, vector unsigned int __b) {10631return (vector signed char)__builtin_altivec_vsr((vector int)__a,10632(vector int)__b);10633}1063410635static __inline__ vector unsigned char __ATTRS_o_ai10636vec_srl(vector unsigned char __a, vector unsigned char __b) {10637return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10638(vector int)__b);10639}1064010641static __inline__ vector unsigned char __ATTRS_o_ai10642vec_srl(vector unsigned char __a, vector unsigned short __b) {10643return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10644(vector int)__b);10645}1064610647static __inline__ vector unsigned char __ATTRS_o_ai10648vec_srl(vector unsigned char __a, vector unsigned int __b) {10649return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10650(vector int)__b);10651}1065210653static __inline__ vector bool char __ATTRS_o_ai10654vec_srl(vector bool char __a, vector unsigned char __b) {10655return (vector bool char)__builtin_altivec_vsr((vector int)__a,10656(vector int)__b);10657}1065810659static __inline__ vector bool char __ATTRS_o_ai10660vec_srl(vector bool char __a, vector unsigned short __b) {10661return (vector bool char)__builtin_altivec_vsr((vector int)__a,10662(vector int)__b);10663}1066410665static __inline__ vector bool char __ATTRS_o_ai10666vec_srl(vector bool char __a, vector unsigned int __b) {10667return (vector bool char)__builtin_altivec_vsr((vector int)__a,10668(vector int)__b);10669}1067010671static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,10672vector unsigned char __b) {10673return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10674}1067510676static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,10677vector unsigned short __b) {10678return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10679}1068010681static __inline__ vector short __ATTRS_o_ai vec_srl(vector short __a,10682vector unsigned int __b) {10683return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10684}1068510686static __inline__ vector unsigned short __ATTRS_o_ai10687vec_srl(vector unsigned short __a, vector unsigned char __b) {10688return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10689(vector int)__b);10690}1069110692static __inline__ vector unsigned short __ATTRS_o_ai10693vec_srl(vector unsigned short __a, vector unsigned short __b) {10694return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10695(vector int)__b);10696}1069710698static __inline__ vector unsigned short __ATTRS_o_ai10699vec_srl(vector unsigned short __a, vector unsigned int __b) {10700return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10701(vector int)__b);10702}1070310704static __inline__ vector bool short __ATTRS_o_ai10705vec_srl(vector bool short __a, vector unsigned char __b) {10706return (vector bool short)__builtin_altivec_vsr((vector int)__a,10707(vector int)__b);10708}1070910710static __inline__ vector bool short __ATTRS_o_ai10711vec_srl(vector bool short __a, vector unsigned short __b) {10712return (vector bool short)__builtin_altivec_vsr((vector int)__a,10713(vector int)__b);10714}1071510716static __inline__ vector bool short __ATTRS_o_ai10717vec_srl(vector bool short __a, vector unsigned int __b) {10718return (vector bool short)__builtin_altivec_vsr((vector int)__a,10719(vector int)__b);10720}1072110722static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,10723vector unsigned char __b) {10724return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10725}1072610727static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,10728vector unsigned short __b) {10729return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10730}1073110732static __inline__ vector pixel __ATTRS_o_ai vec_srl(vector pixel __a,10733vector unsigned int __b) {10734return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10735}1073610737static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,10738vector unsigned char __b) {10739return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10740}1074110742static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,10743vector unsigned short __b) {10744return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10745}1074610747static __inline__ vector int __ATTRS_o_ai vec_srl(vector int __a,10748vector unsigned int __b) {10749return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10750}1075110752static __inline__ vector unsigned int __ATTRS_o_ai10753vec_srl(vector unsigned int __a, vector unsigned char __b) {10754return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10755(vector int)__b);10756}1075710758static __inline__ vector unsigned int __ATTRS_o_ai10759vec_srl(vector unsigned int __a, vector unsigned short __b) {10760return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10761(vector int)__b);10762}1076310764static __inline__ vector unsigned int __ATTRS_o_ai10765vec_srl(vector unsigned int __a, vector unsigned int __b) {10766return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10767(vector int)__b);10768}1076910770static __inline__ vector bool int __ATTRS_o_ai10771vec_srl(vector bool int __a, vector unsigned char __b) {10772return (vector bool int)__builtin_altivec_vsr((vector int)__a,10773(vector int)__b);10774}1077510776static __inline__ vector bool int __ATTRS_o_ai10777vec_srl(vector bool int __a, vector unsigned short __b) {10778return (vector bool int)__builtin_altivec_vsr((vector int)__a,10779(vector int)__b);10780}1078110782static __inline__ vector bool int __ATTRS_o_ai10783vec_srl(vector bool int __a, vector unsigned int __b) {10784return (vector bool int)__builtin_altivec_vsr((vector int)__a,10785(vector int)__b);10786}1078710788#ifdef __VSX__10789static __inline__ vector signed long long __ATTRS_o_ai10790vec_srl(vector signed long long __a, vector unsigned char __b) {10791return (vector signed long long)__builtin_altivec_vsr((vector int)__a,10792(vector int)__b);10793}1079410795static __inline__ vector unsigned long long __ATTRS_o_ai10796vec_srl(vector unsigned long long __a, vector unsigned char __b) {10797return (vector unsigned long long)__builtin_altivec_vsr((vector int)__a,10798(vector int)__b);10799}10800#endif1080110802/* vec_vsr */1080310804static __inline__ vector signed char __ATTRS_o_ai10805vec_vsr(vector signed char __a, vector unsigned char __b) {10806return (vector signed char)__builtin_altivec_vsr((vector int)__a,10807(vector int)__b);10808}1080910810static __inline__ vector signed char __ATTRS_o_ai10811vec_vsr(vector signed char __a, vector unsigned short __b) {10812return (vector signed char)__builtin_altivec_vsr((vector int)__a,10813(vector int)__b);10814}1081510816static __inline__ vector signed char __ATTRS_o_ai10817vec_vsr(vector signed char __a, vector unsigned int __b) {10818return (vector signed char)__builtin_altivec_vsr((vector int)__a,10819(vector int)__b);10820}1082110822static __inline__ vector unsigned char __ATTRS_o_ai10823vec_vsr(vector unsigned char __a, vector unsigned char __b) {10824return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10825(vector int)__b);10826}1082710828static __inline__ vector unsigned char __ATTRS_o_ai10829vec_vsr(vector unsigned char __a, vector unsigned short __b) {10830return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10831(vector int)__b);10832}1083310834static __inline__ vector unsigned char __ATTRS_o_ai10835vec_vsr(vector unsigned char __a, vector unsigned int __b) {10836return (vector unsigned char)__builtin_altivec_vsr((vector int)__a,10837(vector int)__b);10838}1083910840static __inline__ vector bool char __ATTRS_o_ai10841vec_vsr(vector bool char __a, vector unsigned char __b) {10842return (vector bool char)__builtin_altivec_vsr((vector int)__a,10843(vector int)__b);10844}1084510846static __inline__ vector bool char __ATTRS_o_ai10847vec_vsr(vector bool char __a, vector unsigned short __b) {10848return (vector bool char)__builtin_altivec_vsr((vector int)__a,10849(vector int)__b);10850}1085110852static __inline__ vector bool char __ATTRS_o_ai10853vec_vsr(vector bool char __a, vector unsigned int __b) {10854return (vector bool char)__builtin_altivec_vsr((vector int)__a,10855(vector int)__b);10856}1085710858static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,10859vector unsigned char __b) {10860return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10861}1086210863static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,10864vector unsigned short __b) {10865return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10866}1086710868static __inline__ vector short __ATTRS_o_ai vec_vsr(vector short __a,10869vector unsigned int __b) {10870return (vector short)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10871}1087210873static __inline__ vector unsigned short __ATTRS_o_ai10874vec_vsr(vector unsigned short __a, vector unsigned char __b) {10875return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10876(vector int)__b);10877}1087810879static __inline__ vector unsigned short __ATTRS_o_ai10880vec_vsr(vector unsigned short __a, vector unsigned short __b) {10881return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10882(vector int)__b);10883}1088410885static __inline__ vector unsigned short __ATTRS_o_ai10886vec_vsr(vector unsigned short __a, vector unsigned int __b) {10887return (vector unsigned short)__builtin_altivec_vsr((vector int)__a,10888(vector int)__b);10889}1089010891static __inline__ vector bool short __ATTRS_o_ai10892vec_vsr(vector bool short __a, vector unsigned char __b) {10893return (vector bool short)__builtin_altivec_vsr((vector int)__a,10894(vector int)__b);10895}1089610897static __inline__ vector bool short __ATTRS_o_ai10898vec_vsr(vector bool short __a, vector unsigned short __b) {10899return (vector bool short)__builtin_altivec_vsr((vector int)__a,10900(vector int)__b);10901}1090210903static __inline__ vector bool short __ATTRS_o_ai10904vec_vsr(vector bool short __a, vector unsigned int __b) {10905return (vector bool short)__builtin_altivec_vsr((vector int)__a,10906(vector int)__b);10907}1090810909static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,10910vector unsigned char __b) {10911return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10912}1091310914static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,10915vector unsigned short __b) {10916return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10917}1091810919static __inline__ vector pixel __ATTRS_o_ai vec_vsr(vector pixel __a,10920vector unsigned int __b) {10921return (vector pixel)__builtin_altivec_vsr((vector int)__a, (vector int)__b);10922}1092310924static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,10925vector unsigned char __b) {10926return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10927}1092810929static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,10930vector unsigned short __b) {10931return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10932}1093310934static __inline__ vector int __ATTRS_o_ai vec_vsr(vector int __a,10935vector unsigned int __b) {10936return (vector int)__builtin_altivec_vsr(__a, (vector int)__b);10937}1093810939static __inline__ vector unsigned int __ATTRS_o_ai10940vec_vsr(vector unsigned int __a, vector unsigned char __b) {10941return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10942(vector int)__b);10943}1094410945static __inline__ vector unsigned int __ATTRS_o_ai10946vec_vsr(vector unsigned int __a, vector unsigned short __b) {10947return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10948(vector int)__b);10949}1095010951static __inline__ vector unsigned int __ATTRS_o_ai10952vec_vsr(vector unsigned int __a, vector unsigned int __b) {10953return (vector unsigned int)__builtin_altivec_vsr((vector int)__a,10954(vector int)__b);10955}1095610957static __inline__ vector bool int __ATTRS_o_ai10958vec_vsr(vector bool int __a, vector unsigned char __b) {10959return (vector bool int)__builtin_altivec_vsr((vector int)__a,10960(vector int)__b);10961}1096210963static __inline__ vector bool int __ATTRS_o_ai10964vec_vsr(vector bool int __a, vector unsigned short __b) {10965return (vector bool int)__builtin_altivec_vsr((vector int)__a,10966(vector int)__b);10967}1096810969static __inline__ vector bool int __ATTRS_o_ai10970vec_vsr(vector bool int __a, vector unsigned int __b) {10971return (vector bool int)__builtin_altivec_vsr((vector int)__a,10972(vector int)__b);10973}1097410975/* vec_sro */1097610977static __inline__ vector signed char __ATTRS_o_ai10978vec_sro(vector signed char __a, vector signed char __b) {10979return (vector signed char)__builtin_altivec_vsro((vector int)__a,10980(vector int)__b);10981}1098210983static __inline__ vector signed char __ATTRS_o_ai10984vec_sro(vector signed char __a, vector unsigned char __b) {10985return (vector signed char)__builtin_altivec_vsro((vector int)__a,10986(vector int)__b);10987}1098810989static __inline__ vector unsigned char __ATTRS_o_ai10990vec_sro(vector unsigned char __a, vector signed char __b) {10991return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,10992(vector int)__b);10993}1099410995static __inline__ vector unsigned char __ATTRS_o_ai10996vec_sro(vector unsigned char __a, vector unsigned char __b) {10997return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,10998(vector int)__b);10999}1100011001static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,11002vector signed char __b) {11003return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11004}1100511006static __inline__ vector short __ATTRS_o_ai vec_sro(vector short __a,11007vector unsigned char __b) {11008return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11009}1101011011static __inline__ vector unsigned short __ATTRS_o_ai11012vec_sro(vector unsigned short __a, vector signed char __b) {11013return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,11014(vector int)__b);11015}1101611017static __inline__ vector unsigned short __ATTRS_o_ai11018vec_sro(vector unsigned short __a, vector unsigned char __b) {11019return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,11020(vector int)__b);11021}1102211023static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,11024vector signed char __b) {11025return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11026}1102711028static __inline__ vector pixel __ATTRS_o_ai vec_sro(vector pixel __a,11029vector unsigned char __b) {11030return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11031}1103211033static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,11034vector signed char __b) {11035return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);11036}1103711038static __inline__ vector int __ATTRS_o_ai vec_sro(vector int __a,11039vector unsigned char __b) {11040return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);11041}1104211043static __inline__ vector unsigned int __ATTRS_o_ai11044vec_sro(vector unsigned int __a, vector signed char __b) {11045return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,11046(vector int)__b);11047}1104811049static __inline__ vector unsigned int __ATTRS_o_ai11050vec_sro(vector unsigned int __a, vector unsigned char __b) {11051return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,11052(vector int)__b);11053}1105411055static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,11056vector signed char __b) {11057return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11058}1105911060static __inline__ vector float __ATTRS_o_ai vec_sro(vector float __a,11061vector unsigned char __b) {11062return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11063}1106411065#ifdef __VSX__11066static __inline__ vector signed long long __ATTRS_o_ai11067vec_sro(vector signed long long __a, vector signed char __b) {11068return (vector signed long long)__builtin_altivec_vsro((vector int)__a,11069(vector int)__b);11070}1107111072static __inline__ vector signed long long __ATTRS_o_ai11073vec_sro(vector signed long long __a, vector unsigned char __b) {11074return (vector signed long long)__builtin_altivec_vsro((vector int)__a,11075(vector int)__b);11076}1107711078static __inline__ vector unsigned long long __ATTRS_o_ai11079vec_sro(vector unsigned long long __a, vector signed char __b) {11080return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,11081(vector int)__b);11082}1108311084static __inline__ vector unsigned long long __ATTRS_o_ai11085vec_sro(vector unsigned long long __a, vector unsigned char __b) {11086return (vector unsigned long long)__builtin_altivec_vsro((vector int)__a,11087(vector int)__b);11088}11089#endif1109011091/* vec_vsro */1109211093static __inline__ vector signed char __ATTRS_o_ai11094vec_vsro(vector signed char __a, vector signed char __b) {11095return (vector signed char)__builtin_altivec_vsro((vector int)__a,11096(vector int)__b);11097}1109811099static __inline__ vector signed char __ATTRS_o_ai11100vec_vsro(vector signed char __a, vector unsigned char __b) {11101return (vector signed char)__builtin_altivec_vsro((vector int)__a,11102(vector int)__b);11103}1110411105static __inline__ vector unsigned char __ATTRS_o_ai11106vec_vsro(vector unsigned char __a, vector signed char __b) {11107return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,11108(vector int)__b);11109}1111011111static __inline__ vector unsigned char __ATTRS_o_ai11112vec_vsro(vector unsigned char __a, vector unsigned char __b) {11113return (vector unsigned char)__builtin_altivec_vsro((vector int)__a,11114(vector int)__b);11115}1111611117static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,11118vector signed char __b) {11119return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11120}1112111122static __inline__ vector short __ATTRS_o_ai vec_vsro(vector short __a,11123vector unsigned char __b) {11124return (vector short)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11125}1112611127static __inline__ vector unsigned short __ATTRS_o_ai11128vec_vsro(vector unsigned short __a, vector signed char __b) {11129return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,11130(vector int)__b);11131}1113211133static __inline__ vector unsigned short __ATTRS_o_ai11134vec_vsro(vector unsigned short __a, vector unsigned char __b) {11135return (vector unsigned short)__builtin_altivec_vsro((vector int)__a,11136(vector int)__b);11137}1113811139static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,11140vector signed char __b) {11141return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11142}1114311144static __inline__ vector pixel __ATTRS_o_ai vec_vsro(vector pixel __a,11145vector unsigned char __b) {11146return (vector pixel)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11147}1114811149static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,11150vector signed char __b) {11151return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);11152}1115311154static __inline__ vector int __ATTRS_o_ai vec_vsro(vector int __a,11155vector unsigned char __b) {11156return (vector int)__builtin_altivec_vsro(__a, (vector int)__b);11157}1115811159static __inline__ vector unsigned int __ATTRS_o_ai11160vec_vsro(vector unsigned int __a, vector signed char __b) {11161return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,11162(vector int)__b);11163}1116411165static __inline__ vector unsigned int __ATTRS_o_ai11166vec_vsro(vector unsigned int __a, vector unsigned char __b) {11167return (vector unsigned int)__builtin_altivec_vsro((vector int)__a,11168(vector int)__b);11169}1117011171static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,11172vector signed char __b) {11173return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11174}1117511176static __inline__ vector float __ATTRS_o_ai vec_vsro(vector float __a,11177vector unsigned char __b) {11178return (vector float)__builtin_altivec_vsro((vector int)__a, (vector int)__b);11179}1118011181/* vec_st */1118211183static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,11184vector signed char *__c) {11185__builtin_altivec_stvx((vector int)__a, __b, __c);11186}1118711188static __inline__ void __ATTRS_o_ai vec_st(vector signed char __a, long __b,11189signed char *__c) {11190__builtin_altivec_stvx((vector int)__a, __b, __c);11191}1119211193static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,11194vector unsigned char *__c) {11195__builtin_altivec_stvx((vector int)__a, __b, __c);11196}1119711198static __inline__ void __ATTRS_o_ai vec_st(vector unsigned char __a, long __b,11199unsigned char *__c) {11200__builtin_altivec_stvx((vector int)__a, __b, __c);11201}1120211203static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,11204signed char *__c) {11205__builtin_altivec_stvx((vector int)__a, __b, __c);11206}1120711208static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,11209unsigned char *__c) {11210__builtin_altivec_stvx((vector int)__a, __b, __c);11211}1121211213static __inline__ void __ATTRS_o_ai vec_st(vector bool char __a, long __b,11214vector bool char *__c) {11215__builtin_altivec_stvx((vector int)__a, __b, __c);11216}1121711218static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,11219vector short *__c) {11220__builtin_altivec_stvx((vector int)__a, __b, __c);11221}1122211223static __inline__ void __ATTRS_o_ai vec_st(vector short __a, long __b,11224short *__c) {11225__builtin_altivec_stvx((vector int)__a, __b, __c);11226}1122711228static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,11229vector unsigned short *__c) {11230__builtin_altivec_stvx((vector int)__a, __b, __c);11231}1123211233static __inline__ void __ATTRS_o_ai vec_st(vector unsigned short __a, long __b,11234unsigned short *__c) {11235__builtin_altivec_stvx((vector int)__a, __b, __c);11236}1123711238static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,11239short *__c) {11240__builtin_altivec_stvx((vector int)__a, __b, __c);11241}1124211243static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,11244unsigned short *__c) {11245__builtin_altivec_stvx((vector int)__a, __b, __c);11246}1124711248static __inline__ void __ATTRS_o_ai vec_st(vector bool short __a, long __b,11249vector bool short *__c) {11250__builtin_altivec_stvx((vector int)__a, __b, __c);11251}1125211253static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,11254short *__c) {11255__builtin_altivec_stvx((vector int)__a, __b, __c);11256}1125711258static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,11259unsigned short *__c) {11260__builtin_altivec_stvx((vector int)__a, __b, __c);11261}1126211263static __inline__ void __ATTRS_o_ai vec_st(vector pixel __a, long __b,11264vector pixel *__c) {11265__builtin_altivec_stvx((vector int)__a, __b, __c);11266}1126711268static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b,11269vector int *__c) {11270__builtin_altivec_stvx(__a, __b, __c);11271}1127211273static __inline__ void __ATTRS_o_ai vec_st(vector int __a, long __b, int *__c) {11274__builtin_altivec_stvx(__a, __b, __c);11275}1127611277static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,11278vector unsigned int *__c) {11279__builtin_altivec_stvx((vector int)__a, __b, __c);11280}1128111282static __inline__ void __ATTRS_o_ai vec_st(vector unsigned int __a, long __b,11283unsigned int *__c) {11284__builtin_altivec_stvx((vector int)__a, __b, __c);11285}1128611287static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,11288int *__c) {11289__builtin_altivec_stvx((vector int)__a, __b, __c);11290}1129111292static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,11293unsigned int *__c) {11294__builtin_altivec_stvx((vector int)__a, __b, __c);11295}1129611297static __inline__ void __ATTRS_o_ai vec_st(vector bool int __a, long __b,11298vector bool int *__c) {11299__builtin_altivec_stvx((vector int)__a, __b, __c);11300}1130111302static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,11303vector float *__c) {11304__builtin_altivec_stvx((vector int)__a, __b, __c);11305}1130611307static __inline__ void __ATTRS_o_ai vec_st(vector float __a, long __b,11308float *__c) {11309__builtin_altivec_stvx((vector int)__a, __b, __c);11310}1131111312/* vec_stvx */1131311314static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,11315vector signed char *__c) {11316__builtin_altivec_stvx((vector int)__a, __b, __c);11317}1131811319static __inline__ void __ATTRS_o_ai vec_stvx(vector signed char __a, long __b,11320signed char *__c) {11321__builtin_altivec_stvx((vector int)__a, __b, __c);11322}1132311324static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,11325vector unsigned char *__c) {11326__builtin_altivec_stvx((vector int)__a, __b, __c);11327}1132811329static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned char __a, long __b,11330unsigned char *__c) {11331__builtin_altivec_stvx((vector int)__a, __b, __c);11332}1133311334static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,11335signed char *__c) {11336__builtin_altivec_stvx((vector int)__a, __b, __c);11337}1133811339static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,11340unsigned char *__c) {11341__builtin_altivec_stvx((vector int)__a, __b, __c);11342}1134311344static __inline__ void __ATTRS_o_ai vec_stvx(vector bool char __a, long __b,11345vector bool char *__c) {11346__builtin_altivec_stvx((vector int)__a, __b, __c);11347}1134811349static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,11350vector short *__c) {11351__builtin_altivec_stvx((vector int)__a, __b, __c);11352}1135311354static __inline__ void __ATTRS_o_ai vec_stvx(vector short __a, long __b,11355short *__c) {11356__builtin_altivec_stvx((vector int)__a, __b, __c);11357}1135811359static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,11360vector unsigned short *__c) {11361__builtin_altivec_stvx((vector int)__a, __b, __c);11362}1136311364static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned short __a, long __b,11365unsigned short *__c) {11366__builtin_altivec_stvx((vector int)__a, __b, __c);11367}1136811369static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,11370short *__c) {11371__builtin_altivec_stvx((vector int)__a, __b, __c);11372}1137311374static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,11375unsigned short *__c) {11376__builtin_altivec_stvx((vector int)__a, __b, __c);11377}1137811379static __inline__ void __ATTRS_o_ai vec_stvx(vector bool short __a, long __b,11380vector bool short *__c) {11381__builtin_altivec_stvx((vector int)__a, __b, __c);11382}1138311384static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,11385short *__c) {11386__builtin_altivec_stvx((vector int)__a, __b, __c);11387}1138811389static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,11390unsigned short *__c) {11391__builtin_altivec_stvx((vector int)__a, __b, __c);11392}1139311394static __inline__ void __ATTRS_o_ai vec_stvx(vector pixel __a, long __b,11395vector pixel *__c) {11396__builtin_altivec_stvx((vector int)__a, __b, __c);11397}1139811399static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,11400vector int *__c) {11401__builtin_altivec_stvx(__a, __b, __c);11402}1140311404static __inline__ void __ATTRS_o_ai vec_stvx(vector int __a, long __b,11405int *__c) {11406__builtin_altivec_stvx(__a, __b, __c);11407}1140811409static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,11410vector unsigned int *__c) {11411__builtin_altivec_stvx((vector int)__a, __b, __c);11412}1141311414static __inline__ void __ATTRS_o_ai vec_stvx(vector unsigned int __a, long __b,11415unsigned int *__c) {11416__builtin_altivec_stvx((vector int)__a, __b, __c);11417}1141811419static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,11420int *__c) {11421__builtin_altivec_stvx((vector int)__a, __b, __c);11422}1142311424static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,11425unsigned int *__c) {11426__builtin_altivec_stvx((vector int)__a, __b, __c);11427}1142811429static __inline__ void __ATTRS_o_ai vec_stvx(vector bool int __a, long __b,11430vector bool int *__c) {11431__builtin_altivec_stvx((vector int)__a, __b, __c);11432}1143311434static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,11435vector float *__c) {11436__builtin_altivec_stvx((vector int)__a, __b, __c);11437}1143811439static __inline__ void __ATTRS_o_ai vec_stvx(vector float __a, long __b,11440float *__c) {11441__builtin_altivec_stvx((vector int)__a, __b, __c);11442}1144311444/* vec_ste */1144511446static __inline__ void __ATTRS_o_ai vec_ste(vector signed char __a, long __b,11447signed char *__c) {11448__builtin_altivec_stvebx((vector char)__a, __b, __c);11449}1145011451static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned char __a, long __b,11452unsigned char *__c) {11453__builtin_altivec_stvebx((vector char)__a, __b, __c);11454}1145511456static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,11457signed char *__c) {11458__builtin_altivec_stvebx((vector char)__a, __b, __c);11459}1146011461static __inline__ void __ATTRS_o_ai vec_ste(vector bool char __a, long __b,11462unsigned char *__c) {11463__builtin_altivec_stvebx((vector char)__a, __b, __c);11464}1146511466static __inline__ void __ATTRS_o_ai vec_ste(vector short __a, long __b,11467short *__c) {11468__builtin_altivec_stvehx(__a, __b, __c);11469}1147011471static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned short __a, long __b,11472unsigned short *__c) {11473__builtin_altivec_stvehx((vector short)__a, __b, __c);11474}1147511476static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,11477short *__c) {11478__builtin_altivec_stvehx((vector short)__a, __b, __c);11479}1148011481static __inline__ void __ATTRS_o_ai vec_ste(vector bool short __a, long __b,11482unsigned short *__c) {11483__builtin_altivec_stvehx((vector short)__a, __b, __c);11484}1148511486static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,11487short *__c) {11488__builtin_altivec_stvehx((vector short)__a, __b, __c);11489}1149011491static __inline__ void __ATTRS_o_ai vec_ste(vector pixel __a, long __b,11492unsigned short *__c) {11493__builtin_altivec_stvehx((vector short)__a, __b, __c);11494}1149511496static __inline__ void __ATTRS_o_ai vec_ste(vector int __a, long __b, int *__c) {11497__builtin_altivec_stvewx(__a, __b, __c);11498}1149911500static __inline__ void __ATTRS_o_ai vec_ste(vector unsigned int __a, long __b,11501unsigned int *__c) {11502__builtin_altivec_stvewx((vector int)__a, __b, __c);11503}1150411505static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,11506int *__c) {11507__builtin_altivec_stvewx((vector int)__a, __b, __c);11508}1150911510static __inline__ void __ATTRS_o_ai vec_ste(vector bool int __a, long __b,11511unsigned int *__c) {11512__builtin_altivec_stvewx((vector int)__a, __b, __c);11513}1151411515static __inline__ void __ATTRS_o_ai vec_ste(vector float __a, long __b,11516float *__c) {11517__builtin_altivec_stvewx((vector int)__a, __b, __c);11518}1151911520/* vec_stvebx */1152111522static __inline__ void __ATTRS_o_ai vec_stvebx(vector signed char __a, long __b,11523signed char *__c) {11524__builtin_altivec_stvebx((vector char)__a, __b, __c);11525}1152611527static __inline__ void __ATTRS_o_ai vec_stvebx(vector unsigned char __a,11528long __b, unsigned char *__c) {11529__builtin_altivec_stvebx((vector char)__a, __b, __c);11530}1153111532static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,11533signed char *__c) {11534__builtin_altivec_stvebx((vector char)__a, __b, __c);11535}1153611537static __inline__ void __ATTRS_o_ai vec_stvebx(vector bool char __a, long __b,11538unsigned char *__c) {11539__builtin_altivec_stvebx((vector char)__a, __b, __c);11540}1154111542/* vec_stvehx */1154311544static __inline__ void __ATTRS_o_ai vec_stvehx(vector short __a, long __b,11545short *__c) {11546__builtin_altivec_stvehx(__a, __b, __c);11547}1154811549static __inline__ void __ATTRS_o_ai vec_stvehx(vector unsigned short __a,11550long __b, unsigned short *__c) {11551__builtin_altivec_stvehx((vector short)__a, __b, __c);11552}1155311554static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,11555short *__c) {11556__builtin_altivec_stvehx((vector short)__a, __b, __c);11557}1155811559static __inline__ void __ATTRS_o_ai vec_stvehx(vector bool short __a, long __b,11560unsigned short *__c) {11561__builtin_altivec_stvehx((vector short)__a, __b, __c);11562}1156311564static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,11565short *__c) {11566__builtin_altivec_stvehx((vector short)__a, __b, __c);11567}1156811569static __inline__ void __ATTRS_o_ai vec_stvehx(vector pixel __a, long __b,11570unsigned short *__c) {11571__builtin_altivec_stvehx((vector short)__a, __b, __c);11572}1157311574/* vec_stvewx */1157511576static __inline__ void __ATTRS_o_ai vec_stvewx(vector int __a, long __b,11577int *__c) {11578__builtin_altivec_stvewx(__a, __b, __c);11579}1158011581static __inline__ void __ATTRS_o_ai vec_stvewx(vector unsigned int __a, long __b,11582unsigned int *__c) {11583__builtin_altivec_stvewx((vector int)__a, __b, __c);11584}1158511586static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,11587int *__c) {11588__builtin_altivec_stvewx((vector int)__a, __b, __c);11589}1159011591static __inline__ void __ATTRS_o_ai vec_stvewx(vector bool int __a, long __b,11592unsigned int *__c) {11593__builtin_altivec_stvewx((vector int)__a, __b, __c);11594}1159511596static __inline__ void __ATTRS_o_ai vec_stvewx(vector float __a, long __b,11597float *__c) {11598__builtin_altivec_stvewx((vector int)__a, __b, __c);11599}1160011601/* vec_stl */1160211603static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,11604vector signed char *__c) {11605__builtin_altivec_stvxl((vector int)__a, __b, __c);11606}1160711608static __inline__ void __ATTRS_o_ai vec_stl(vector signed char __a, int __b,11609signed char *__c) {11610__builtin_altivec_stvxl((vector int)__a, __b, __c);11611}1161211613static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,11614vector unsigned char *__c) {11615__builtin_altivec_stvxl((vector int)__a, __b, __c);11616}1161711618static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned char __a, int __b,11619unsigned char *__c) {11620__builtin_altivec_stvxl((vector int)__a, __b, __c);11621}1162211623static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,11624signed char *__c) {11625__builtin_altivec_stvxl((vector int)__a, __b, __c);11626}1162711628static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,11629unsigned char *__c) {11630__builtin_altivec_stvxl((vector int)__a, __b, __c);11631}1163211633static __inline__ void __ATTRS_o_ai vec_stl(vector bool char __a, int __b,11634vector bool char *__c) {11635__builtin_altivec_stvxl((vector int)__a, __b, __c);11636}1163711638static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,11639vector short *__c) {11640__builtin_altivec_stvxl((vector int)__a, __b, __c);11641}1164211643static __inline__ void __ATTRS_o_ai vec_stl(vector short __a, int __b,11644short *__c) {11645__builtin_altivec_stvxl((vector int)__a, __b, __c);11646}1164711648static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,11649vector unsigned short *__c) {11650__builtin_altivec_stvxl((vector int)__a, __b, __c);11651}1165211653static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned short __a, int __b,11654unsigned short *__c) {11655__builtin_altivec_stvxl((vector int)__a, __b, __c);11656}1165711658static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,11659short *__c) {11660__builtin_altivec_stvxl((vector int)__a, __b, __c);11661}1166211663static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,11664unsigned short *__c) {11665__builtin_altivec_stvxl((vector int)__a, __b, __c);11666}1166711668static __inline__ void __ATTRS_o_ai vec_stl(vector bool short __a, int __b,11669vector bool short *__c) {11670__builtin_altivec_stvxl((vector int)__a, __b, __c);11671}1167211673static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,11674short *__c) {11675__builtin_altivec_stvxl((vector int)__a, __b, __c);11676}1167711678static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,11679unsigned short *__c) {11680__builtin_altivec_stvxl((vector int)__a, __b, __c);11681}1168211683static __inline__ void __ATTRS_o_ai vec_stl(vector pixel __a, int __b,11684vector pixel *__c) {11685__builtin_altivec_stvxl((vector int)__a, __b, __c);11686}1168711688static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b,11689vector int *__c) {11690__builtin_altivec_stvxl(__a, __b, __c);11691}1169211693static __inline__ void __ATTRS_o_ai vec_stl(vector int __a, int __b, int *__c) {11694__builtin_altivec_stvxl(__a, __b, __c);11695}1169611697static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,11698vector unsigned int *__c) {11699__builtin_altivec_stvxl((vector int)__a, __b, __c);11700}1170111702static __inline__ void __ATTRS_o_ai vec_stl(vector unsigned int __a, int __b,11703unsigned int *__c) {11704__builtin_altivec_stvxl((vector int)__a, __b, __c);11705}1170611707static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,11708int *__c) {11709__builtin_altivec_stvxl((vector int)__a, __b, __c);11710}1171111712static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,11713unsigned int *__c) {11714__builtin_altivec_stvxl((vector int)__a, __b, __c);11715}1171611717static __inline__ void __ATTRS_o_ai vec_stl(vector bool int __a, int __b,11718vector bool int *__c) {11719__builtin_altivec_stvxl((vector int)__a, __b, __c);11720}1172111722static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,11723vector float *__c) {11724__builtin_altivec_stvxl((vector int)__a, __b, __c);11725}1172611727static __inline__ void __ATTRS_o_ai vec_stl(vector float __a, int __b,11728float *__c) {11729__builtin_altivec_stvxl((vector int)__a, __b, __c);11730}1173111732/* vec_stvxl */1173311734static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,11735vector signed char *__c) {11736__builtin_altivec_stvxl((vector int)__a, __b, __c);11737}1173811739static __inline__ void __ATTRS_o_ai vec_stvxl(vector signed char __a, int __b,11740signed char *__c) {11741__builtin_altivec_stvxl((vector int)__a, __b, __c);11742}1174311744static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,11745vector unsigned char *__c) {11746__builtin_altivec_stvxl((vector int)__a, __b, __c);11747}1174811749static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned char __a, int __b,11750unsigned char *__c) {11751__builtin_altivec_stvxl((vector int)__a, __b, __c);11752}1175311754static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,11755signed char *__c) {11756__builtin_altivec_stvxl((vector int)__a, __b, __c);11757}1175811759static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,11760unsigned char *__c) {11761__builtin_altivec_stvxl((vector int)__a, __b, __c);11762}1176311764static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool char __a, int __b,11765vector bool char *__c) {11766__builtin_altivec_stvxl((vector int)__a, __b, __c);11767}1176811769static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,11770vector short *__c) {11771__builtin_altivec_stvxl((vector int)__a, __b, __c);11772}1177311774static __inline__ void __ATTRS_o_ai vec_stvxl(vector short __a, int __b,11775short *__c) {11776__builtin_altivec_stvxl((vector int)__a, __b, __c);11777}1177811779static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,11780int __b,11781vector unsigned short *__c) {11782__builtin_altivec_stvxl((vector int)__a, __b, __c);11783}1178411785static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned short __a,11786int __b, unsigned short *__c) {11787__builtin_altivec_stvxl((vector int)__a, __b, __c);11788}1178911790static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,11791short *__c) {11792__builtin_altivec_stvxl((vector int)__a, __b, __c);11793}1179411795static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,11796unsigned short *__c) {11797__builtin_altivec_stvxl((vector int)__a, __b, __c);11798}1179911800static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool short __a, int __b,11801vector bool short *__c) {11802__builtin_altivec_stvxl((vector int)__a, __b, __c);11803}1180411805static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,11806short *__c) {11807__builtin_altivec_stvxl((vector int)__a, __b, __c);11808}1180911810static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,11811unsigned short *__c) {11812__builtin_altivec_stvxl((vector int)__a, __b, __c);11813}1181411815static __inline__ void __ATTRS_o_ai vec_stvxl(vector pixel __a, int __b,11816vector pixel *__c) {11817__builtin_altivec_stvxl((vector int)__a, __b, __c);11818}1181911820static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,11821vector int *__c) {11822__builtin_altivec_stvxl(__a, __b, __c);11823}1182411825static __inline__ void __ATTRS_o_ai vec_stvxl(vector int __a, int __b,11826int *__c) {11827__builtin_altivec_stvxl(__a, __b, __c);11828}1182911830static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,11831vector unsigned int *__c) {11832__builtin_altivec_stvxl((vector int)__a, __b, __c);11833}1183411835static __inline__ void __ATTRS_o_ai vec_stvxl(vector unsigned int __a, int __b,11836unsigned int *__c) {11837__builtin_altivec_stvxl((vector int)__a, __b, __c);11838}1183911840static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,11841int *__c) {11842__builtin_altivec_stvxl((vector int)__a, __b, __c);11843}1184411845static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,11846unsigned int *__c) {11847__builtin_altivec_stvxl((vector int)__a, __b, __c);11848}1184911850static __inline__ void __ATTRS_o_ai vec_stvxl(vector bool int __a, int __b,11851vector bool int *__c) {11852__builtin_altivec_stvxl((vector int)__a, __b, __c);11853}1185411855static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,11856vector float *__c) {11857__builtin_altivec_stvxl((vector int)__a, __b, __c);11858}1185911860static __inline__ void __ATTRS_o_ai vec_stvxl(vector float __a, int __b,11861float *__c) {11862__builtin_altivec_stvxl((vector int)__a, __b, __c);11863}1186411865/* vec_sub */1186611867static __inline__ vector signed char __ATTRS_o_ai11868vec_sub(vector signed char __a, vector signed char __b) {11869return __a - __b;11870}1187111872static __inline__ vector signed char __ATTRS_o_ai11873vec_sub(vector bool char __a, vector signed char __b) {11874return (vector signed char)__a - __b;11875}1187611877static __inline__ vector signed char __ATTRS_o_ai11878vec_sub(vector signed char __a, vector bool char __b) {11879return __a - (vector signed char)__b;11880}1188111882static __inline__ vector unsigned char __ATTRS_o_ai11883vec_sub(vector unsigned char __a, vector unsigned char __b) {11884return __a - __b;11885}1188611887static __inline__ vector unsigned char __ATTRS_o_ai11888vec_sub(vector bool char __a, vector unsigned char __b) {11889return (vector unsigned char)__a - __b;11890}1189111892static __inline__ vector unsigned char __ATTRS_o_ai11893vec_sub(vector unsigned char __a, vector bool char __b) {11894return __a - (vector unsigned char)__b;11895}1189611897static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,11898vector short __b) {11899return __a - __b;11900}1190111902static __inline__ vector short __ATTRS_o_ai vec_sub(vector bool short __a,11903vector short __b) {11904return (vector short)__a - __b;11905}1190611907static __inline__ vector short __ATTRS_o_ai vec_sub(vector short __a,11908vector bool short __b) {11909return __a - (vector short)__b;11910}1191111912static __inline__ vector unsigned short __ATTRS_o_ai11913vec_sub(vector unsigned short __a, vector unsigned short __b) {11914return __a - __b;11915}1191611917static __inline__ vector unsigned short __ATTRS_o_ai11918vec_sub(vector bool short __a, vector unsigned short __b) {11919return (vector unsigned short)__a - __b;11920}1192111922static __inline__ vector unsigned short __ATTRS_o_ai11923vec_sub(vector unsigned short __a, vector bool short __b) {11924return __a - (vector unsigned short)__b;11925}1192611927static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,11928vector int __b) {11929return __a - __b;11930}1193111932static __inline__ vector int __ATTRS_o_ai vec_sub(vector bool int __a,11933vector int __b) {11934return (vector int)__a - __b;11935}1193611937static __inline__ vector int __ATTRS_o_ai vec_sub(vector int __a,11938vector bool int __b) {11939return __a - (vector int)__b;11940}1194111942static __inline__ vector unsigned int __ATTRS_o_ai11943vec_sub(vector unsigned int __a, vector unsigned int __b) {11944return __a - __b;11945}1194611947static __inline__ vector unsigned int __ATTRS_o_ai11948vec_sub(vector bool int __a, vector unsigned int __b) {11949return (vector unsigned int)__a - __b;11950}1195111952static __inline__ vector unsigned int __ATTRS_o_ai11953vec_sub(vector unsigned int __a, vector bool int __b) {11954return __a - (vector unsigned int)__b;11955}1195611957#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \11958defined(__SIZEOF_INT128__)11959static __inline__ vector signed __int128 __ATTRS_o_ai11960vec_sub(vector signed __int128 __a, vector signed __int128 __b) {11961return __a - __b;11962}1196311964static __inline__ vector unsigned __int128 __ATTRS_o_ai11965vec_sub(vector unsigned __int128 __a, vector unsigned __int128 __b) {11966return __a - __b;11967}11968#endif // defined(__POWER8_VECTOR__) && defined(__powerpc64__) &&11969// defined(__SIZEOF_INT128__)1197011971#ifdef __VSX__11972static __inline__ vector signed long long __ATTRS_o_ai11973vec_sub(vector signed long long __a, vector signed long long __b) {11974return __a - __b;11975}1197611977static __inline__ vector unsigned long long __ATTRS_o_ai11978vec_sub(vector unsigned long long __a, vector unsigned long long __b) {11979return __a - __b;11980}1198111982static __inline__ vector double __ATTRS_o_ai vec_sub(vector double __a,11983vector double __b) {11984return __a - __b;11985}11986#endif1198711988static __inline__ vector float __ATTRS_o_ai vec_sub(vector float __a,11989vector float __b) {11990return __a - __b;11991}1199211993/* vec_vsububm */1199411995#define __builtin_altivec_vsububm vec_vsububm1199611997static __inline__ vector signed char __ATTRS_o_ai11998vec_vsububm(vector signed char __a, vector signed char __b) {11999return __a - __b;12000}1200112002static __inline__ vector signed char __ATTRS_o_ai12003vec_vsububm(vector bool char __a, vector signed char __b) {12004return (vector signed char)__a - __b;12005}1200612007static __inline__ vector signed char __ATTRS_o_ai12008vec_vsububm(vector signed char __a, vector bool char __b) {12009return __a - (vector signed char)__b;12010}1201112012static __inline__ vector unsigned char __ATTRS_o_ai12013vec_vsububm(vector unsigned char __a, vector unsigned char __b) {12014return __a - __b;12015}1201612017static __inline__ vector unsigned char __ATTRS_o_ai12018vec_vsububm(vector bool char __a, vector unsigned char __b) {12019return (vector unsigned char)__a - __b;12020}1202112022static __inline__ vector unsigned char __ATTRS_o_ai12023vec_vsububm(vector unsigned char __a, vector bool char __b) {12024return __a - (vector unsigned char)__b;12025}1202612027/* vec_vsubuhm */1202812029#define __builtin_altivec_vsubuhm vec_vsubuhm1203012031static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,12032vector short __b) {12033return __a - __b;12034}1203512036static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector bool short __a,12037vector short __b) {12038return (vector short)__a - __b;12039}1204012041static __inline__ vector short __ATTRS_o_ai vec_vsubuhm(vector short __a,12042vector bool short __b) {12043return __a - (vector short)__b;12044}1204512046static __inline__ vector unsigned short __ATTRS_o_ai12047vec_vsubuhm(vector unsigned short __a, vector unsigned short __b) {12048return __a - __b;12049}1205012051static __inline__ vector unsigned short __ATTRS_o_ai12052vec_vsubuhm(vector bool short __a, vector unsigned short __b) {12053return (vector unsigned short)__a - __b;12054}1205512056static __inline__ vector unsigned short __ATTRS_o_ai12057vec_vsubuhm(vector unsigned short __a, vector bool short __b) {12058return __a - (vector unsigned short)__b;12059}1206012061/* vec_vsubuwm */1206212063#define __builtin_altivec_vsubuwm vec_vsubuwm1206412065static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,12066vector int __b) {12067return __a - __b;12068}1206912070static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector bool int __a,12071vector int __b) {12072return (vector int)__a - __b;12073}1207412075static __inline__ vector int __ATTRS_o_ai vec_vsubuwm(vector int __a,12076vector bool int __b) {12077return __a - (vector int)__b;12078}1207912080static __inline__ vector unsigned int __ATTRS_o_ai12081vec_vsubuwm(vector unsigned int __a, vector unsigned int __b) {12082return __a - __b;12083}1208412085static __inline__ vector unsigned int __ATTRS_o_ai12086vec_vsubuwm(vector bool int __a, vector unsigned int __b) {12087return (vector unsigned int)__a - __b;12088}1208912090static __inline__ vector unsigned int __ATTRS_o_ai12091vec_vsubuwm(vector unsigned int __a, vector bool int __b) {12092return __a - (vector unsigned int)__b;12093}1209412095/* vec_vsubfp */1209612097#define __builtin_altivec_vsubfp vec_vsubfp1209812099static __inline__ vector float __attribute__((__always_inline__))12100vec_vsubfp(vector float __a, vector float __b) {12101return __a - __b;12102}1210312104/* vec_subc */1210512106static __inline__ vector signed int __ATTRS_o_ai12107vec_subc(vector signed int __a, vector signed int __b) {12108return (vector signed int)__builtin_altivec_vsubcuw((vector unsigned int)__a,12109(vector unsigned int) __b);12110}1211112112static __inline__ vector unsigned int __ATTRS_o_ai12113vec_subc(vector unsigned int __a, vector unsigned int __b) {12114return __builtin_altivec_vsubcuw(__a, __b);12115}1211612117#ifdef __POWER8_VECTOR__12118#ifdef __SIZEOF_INT128__12119static __inline__ vector unsigned __int128 __ATTRS_o_ai12120vec_subc(vector unsigned __int128 __a, vector unsigned __int128 __b) {12121return __builtin_altivec_vsubcuq(__a, __b);12122}1212312124static __inline__ vector signed __int128 __ATTRS_o_ai12125vec_subc(vector signed __int128 __a, vector signed __int128 __b) {12126return (vector signed __int128)__builtin_altivec_vsubcuq(12127(vector unsigned __int128)__a, (vector unsigned __int128)__b);12128}12129#endif1213012131static __inline__ vector unsigned char __attribute__((__always_inline__))12132vec_subc_u128(vector unsigned char __a, vector unsigned char __b) {12133return (vector unsigned char)__builtin_altivec_vsubcuq_c(12134(vector unsigned char)__a, (vector unsigned char)__b);12135}12136#endif // __POWER8_VECTOR__1213712138/* vec_vsubcuw */1213912140static __inline__ vector unsigned int __attribute__((__always_inline__))12141vec_vsubcuw(vector unsigned int __a, vector unsigned int __b) {12142return __builtin_altivec_vsubcuw(__a, __b);12143}1214412145/* vec_subs */1214612147static __inline__ vector signed char __ATTRS_o_ai12148vec_subs(vector signed char __a, vector signed char __b) {12149return __builtin_altivec_vsubsbs(__a, __b);12150}1215112152static __inline__ vector signed char __ATTRS_o_ai12153vec_subs(vector bool char __a, vector signed char __b) {12154return __builtin_altivec_vsubsbs((vector signed char)__a, __b);12155}1215612157static __inline__ vector signed char __ATTRS_o_ai12158vec_subs(vector signed char __a, vector bool char __b) {12159return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);12160}1216112162static __inline__ vector unsigned char __ATTRS_o_ai12163vec_subs(vector unsigned char __a, vector unsigned char __b) {12164return __builtin_altivec_vsububs(__a, __b);12165}1216612167static __inline__ vector unsigned char __ATTRS_o_ai12168vec_subs(vector bool char __a, vector unsigned char __b) {12169return __builtin_altivec_vsububs((vector unsigned char)__a, __b);12170}1217112172static __inline__ vector unsigned char __ATTRS_o_ai12173vec_subs(vector unsigned char __a, vector bool char __b) {12174return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);12175}1217612177static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,12178vector short __b) {12179return __builtin_altivec_vsubshs(__a, __b);12180}1218112182static __inline__ vector short __ATTRS_o_ai vec_subs(vector bool short __a,12183vector short __b) {12184return __builtin_altivec_vsubshs((vector short)__a, __b);12185}1218612187static __inline__ vector short __ATTRS_o_ai vec_subs(vector short __a,12188vector bool short __b) {12189return __builtin_altivec_vsubshs(__a, (vector short)__b);12190}1219112192static __inline__ vector unsigned short __ATTRS_o_ai12193vec_subs(vector unsigned short __a, vector unsigned short __b) {12194return __builtin_altivec_vsubuhs(__a, __b);12195}1219612197static __inline__ vector unsigned short __ATTRS_o_ai12198vec_subs(vector bool short __a, vector unsigned short __b) {12199return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);12200}1220112202static __inline__ vector unsigned short __ATTRS_o_ai12203vec_subs(vector unsigned short __a, vector bool short __b) {12204return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);12205}1220612207static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,12208vector int __b) {12209return __builtin_altivec_vsubsws(__a, __b);12210}1221112212static __inline__ vector int __ATTRS_o_ai vec_subs(vector bool int __a,12213vector int __b) {12214return __builtin_altivec_vsubsws((vector int)__a, __b);12215}1221612217static __inline__ vector int __ATTRS_o_ai vec_subs(vector int __a,12218vector bool int __b) {12219return __builtin_altivec_vsubsws(__a, (vector int)__b);12220}1222112222static __inline__ vector unsigned int __ATTRS_o_ai12223vec_subs(vector unsigned int __a, vector unsigned int __b) {12224return __builtin_altivec_vsubuws(__a, __b);12225}1222612227static __inline__ vector unsigned int __ATTRS_o_ai12228vec_subs(vector bool int __a, vector unsigned int __b) {12229return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);12230}1223112232static __inline__ vector unsigned int __ATTRS_o_ai12233vec_subs(vector unsigned int __a, vector bool int __b) {12234return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);12235}1223612237/* vec_vsubsbs */1223812239static __inline__ vector signed char __ATTRS_o_ai12240vec_vsubsbs(vector signed char __a, vector signed char __b) {12241return __builtin_altivec_vsubsbs(__a, __b);12242}1224312244static __inline__ vector signed char __ATTRS_o_ai12245vec_vsubsbs(vector bool char __a, vector signed char __b) {12246return __builtin_altivec_vsubsbs((vector signed char)__a, __b);12247}1224812249static __inline__ vector signed char __ATTRS_o_ai12250vec_vsubsbs(vector signed char __a, vector bool char __b) {12251return __builtin_altivec_vsubsbs(__a, (vector signed char)__b);12252}1225312254/* vec_vsububs */1225512256static __inline__ vector unsigned char __ATTRS_o_ai12257vec_vsububs(vector unsigned char __a, vector unsigned char __b) {12258return __builtin_altivec_vsububs(__a, __b);12259}1226012261static __inline__ vector unsigned char __ATTRS_o_ai12262vec_vsububs(vector bool char __a, vector unsigned char __b) {12263return __builtin_altivec_vsububs((vector unsigned char)__a, __b);12264}1226512266static __inline__ vector unsigned char __ATTRS_o_ai12267vec_vsububs(vector unsigned char __a, vector bool char __b) {12268return __builtin_altivec_vsububs(__a, (vector unsigned char)__b);12269}1227012271/* vec_vsubshs */1227212273static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,12274vector short __b) {12275return __builtin_altivec_vsubshs(__a, __b);12276}1227712278static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector bool short __a,12279vector short __b) {12280return __builtin_altivec_vsubshs((vector short)__a, __b);12281}1228212283static __inline__ vector short __ATTRS_o_ai vec_vsubshs(vector short __a,12284vector bool short __b) {12285return __builtin_altivec_vsubshs(__a, (vector short)__b);12286}1228712288/* vec_vsubuhs */1228912290static __inline__ vector unsigned short __ATTRS_o_ai12291vec_vsubuhs(vector unsigned short __a, vector unsigned short __b) {12292return __builtin_altivec_vsubuhs(__a, __b);12293}1229412295static __inline__ vector unsigned short __ATTRS_o_ai12296vec_vsubuhs(vector bool short __a, vector unsigned short __b) {12297return __builtin_altivec_vsubuhs((vector unsigned short)__a, __b);12298}1229912300static __inline__ vector unsigned short __ATTRS_o_ai12301vec_vsubuhs(vector unsigned short __a, vector bool short __b) {12302return __builtin_altivec_vsubuhs(__a, (vector unsigned short)__b);12303}1230412305/* vec_vsubsws */1230612307static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,12308vector int __b) {12309return __builtin_altivec_vsubsws(__a, __b);12310}1231112312static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector bool int __a,12313vector int __b) {12314return __builtin_altivec_vsubsws((vector int)__a, __b);12315}1231612317static __inline__ vector int __ATTRS_o_ai vec_vsubsws(vector int __a,12318vector bool int __b) {12319return __builtin_altivec_vsubsws(__a, (vector int)__b);12320}1232112322/* vec_vsubuws */1232312324static __inline__ vector unsigned int __ATTRS_o_ai12325vec_vsubuws(vector unsigned int __a, vector unsigned int __b) {12326return __builtin_altivec_vsubuws(__a, __b);12327}1232812329static __inline__ vector unsigned int __ATTRS_o_ai12330vec_vsubuws(vector bool int __a, vector unsigned int __b) {12331return __builtin_altivec_vsubuws((vector unsigned int)__a, __b);12332}1233312334static __inline__ vector unsigned int __ATTRS_o_ai12335vec_vsubuws(vector unsigned int __a, vector bool int __b) {12336return __builtin_altivec_vsubuws(__a, (vector unsigned int)__b);12337}1233812339#ifdef __POWER8_VECTOR__12340/* vec_vsubuqm */1234112342#ifdef __SIZEOF_INT128__12343static __inline__ vector signed __int128 __ATTRS_o_ai12344vec_vsubuqm(vector signed __int128 __a, vector signed __int128 __b) {12345return __a - __b;12346}1234712348static __inline__ vector unsigned __int128 __ATTRS_o_ai12349vec_vsubuqm(vector unsigned __int128 __a, vector unsigned __int128 __b) {12350return __a - __b;12351}12352#endif1235312354static __inline__ vector unsigned char __attribute__((__always_inline__))12355vec_sub_u128(vector unsigned char __a, vector unsigned char __b) {12356return (vector unsigned char)__builtin_altivec_vsubuqm(__a, __b);12357}1235812359/* vec_vsubeuqm */1236012361#ifdef __SIZEOF_INT128__12362static __inline__ vector signed __int128 __ATTRS_o_ai12363vec_vsubeuqm(vector signed __int128 __a, vector signed __int128 __b,12364vector signed __int128 __c) {12365return (vector signed __int128)__builtin_altivec_vsubeuqm(12366(vector unsigned __int128)__a, (vector unsigned __int128)__b,12367(vector unsigned __int128)__c);12368}1236912370static __inline__ vector unsigned __int128 __ATTRS_o_ai12371vec_vsubeuqm(vector unsigned __int128 __a, vector unsigned __int128 __b,12372vector unsigned __int128 __c) {12373return __builtin_altivec_vsubeuqm(__a, __b, __c);12374}1237512376static __inline__ vector signed __int128 __ATTRS_o_ai12377vec_sube(vector signed __int128 __a, vector signed __int128 __b,12378vector signed __int128 __c) {12379return (vector signed __int128)__builtin_altivec_vsubeuqm(12380(vector unsigned __int128)__a, (vector unsigned __int128)__b,12381(vector unsigned __int128)__c);12382}1238312384static __inline__ vector unsigned __int128 __ATTRS_o_ai12385vec_sube(vector unsigned __int128 __a, vector unsigned __int128 __b,12386vector unsigned __int128 __c) {12387return __builtin_altivec_vsubeuqm(__a, __b, __c);12388}12389#endif1239012391static __inline__ vector unsigned char __attribute__((__always_inline__))12392vec_sube_u128(vector unsigned char __a, vector unsigned char __b,12393vector unsigned char __c) {12394return (vector unsigned char)__builtin_altivec_vsubeuqm_c(12395(vector unsigned char)__a, (vector unsigned char)__b,12396(vector unsigned char)__c);12397}1239812399/* vec_vsubcuq */1240012401#ifdef __SIZEOF_INT128__12402static __inline__ vector signed __int128 __ATTRS_o_ai12403vec_vsubcuq(vector signed __int128 __a, vector signed __int128 __b) {12404return (vector signed __int128)__builtin_altivec_vsubcuq(12405(vector unsigned __int128)__a, (vector unsigned __int128)__b);12406}1240712408static __inline__ vector unsigned __int128 __ATTRS_o_ai12409vec_vsubcuq(vector unsigned __int128 __a, vector unsigned __int128 __b) {12410return __builtin_altivec_vsubcuq(__a, __b);12411}1241212413/* vec_vsubecuq */1241412415static __inline__ vector signed __int128 __ATTRS_o_ai12416vec_vsubecuq(vector signed __int128 __a, vector signed __int128 __b,12417vector signed __int128 __c) {12418return (vector signed __int128)__builtin_altivec_vsubecuq(12419(vector unsigned __int128)__a, (vector unsigned __int128)__b,12420(vector unsigned __int128)__c);12421}1242212423static __inline__ vector unsigned __int128 __ATTRS_o_ai12424vec_vsubecuq(vector unsigned __int128 __a, vector unsigned __int128 __b,12425vector unsigned __int128 __c) {12426return __builtin_altivec_vsubecuq(__a, __b, __c);12427}12428#endif1242912430#ifdef __powerpc64__12431static __inline__ vector signed int __ATTRS_o_ai12432vec_subec(vector signed int __a, vector signed int __b,12433vector signed int __c) {12434return vec_addec(__a, ~__b, __c);12435}1243612437static __inline__ vector unsigned int __ATTRS_o_ai12438vec_subec(vector unsigned int __a, vector unsigned int __b,12439vector unsigned int __c) {12440return vec_addec(__a, ~__b, __c);12441}12442#endif1244312444#ifdef __SIZEOF_INT128__12445static __inline__ vector signed __int128 __ATTRS_o_ai12446vec_subec(vector signed __int128 __a, vector signed __int128 __b,12447vector signed __int128 __c) {12448return (vector signed __int128)__builtin_altivec_vsubecuq(12449(vector unsigned __int128)__a, (vector unsigned __int128)__b,12450(vector unsigned __int128)__c);12451}1245212453static __inline__ vector unsigned __int128 __ATTRS_o_ai12454vec_subec(vector unsigned __int128 __a, vector unsigned __int128 __b,12455vector unsigned __int128 __c) {12456return __builtin_altivec_vsubecuq(__a, __b, __c);12457}12458#endif1245912460static __inline__ vector unsigned char __attribute__((__always_inline__))12461vec_subec_u128(vector unsigned char __a, vector unsigned char __b,12462vector unsigned char __c) {12463return (vector unsigned char)__builtin_altivec_vsubecuq_c(12464(vector unsigned char)__a, (vector unsigned char)__b,12465(vector unsigned char)__c);12466}12467#endif // __POWER8_VECTOR__1246812469static __inline__ vector signed int __ATTRS_o_ai12470vec_sube(vector signed int __a, vector signed int __b,12471vector signed int __c) {12472vector signed int __mask = {1, 1, 1, 1};12473vector signed int __carry = __c & __mask;12474return vec_adde(__a, ~__b, __carry);12475}1247612477static __inline__ vector unsigned int __ATTRS_o_ai12478vec_sube(vector unsigned int __a, vector unsigned int __b,12479vector unsigned int __c) {12480vector unsigned int __mask = {1, 1, 1, 1};12481vector unsigned int __carry = __c & __mask;12482return vec_adde(__a, ~__b, __carry);12483}12484/* vec_sum4s */1248512486static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed char __a,12487vector int __b) {12488return __builtin_altivec_vsum4sbs(__a, __b);12489}1249012491static __inline__ vector unsigned int __ATTRS_o_ai12492vec_sum4s(vector unsigned char __a, vector unsigned int __b) {12493return __builtin_altivec_vsum4ubs(__a, __b);12494}1249512496static __inline__ vector int __ATTRS_o_ai vec_sum4s(vector signed short __a,12497vector int __b) {12498return __builtin_altivec_vsum4shs(__a, __b);12499}1250012501/* vec_vsum4sbs */1250212503static __inline__ vector int __attribute__((__always_inline__))12504vec_vsum4sbs(vector signed char __a, vector int __b) {12505return __builtin_altivec_vsum4sbs(__a, __b);12506}1250712508/* vec_vsum4ubs */1250912510static __inline__ vector unsigned int __attribute__((__always_inline__))12511vec_vsum4ubs(vector unsigned char __a, vector unsigned int __b) {12512return __builtin_altivec_vsum4ubs(__a, __b);12513}1251412515/* vec_vsum4shs */1251612517static __inline__ vector int __attribute__((__always_inline__))12518vec_vsum4shs(vector signed short __a, vector int __b) {12519return __builtin_altivec_vsum4shs(__a, __b);12520}1252112522/* vec_sum2s */1252312524/* The vsum2sws instruction has a big-endian bias, so that the second12525input vector and the result always reference big-endian elements125261 and 3 (little-endian element 0 and 2). For ease of porting the12527programmer wants elements 1 and 3 in both cases, so for little12528endian we must perform some permutes. */1252912530static __inline__ vector signed int __attribute__((__always_inline__))12531vec_sum2s(vector int __a, vector int __b) {12532#ifdef __LITTLE_ENDIAN__12533vector int __c = (vector signed int)vec_perm(12534__b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,125358, 9, 10, 11));12536__c = __builtin_altivec_vsum2sws(__a, __c);12537return (vector signed int)vec_perm(12538__c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,125398, 9, 10, 11));12540#else12541return __builtin_altivec_vsum2sws(__a, __b);12542#endif12543}1254412545/* vec_vsum2sws */1254612547static __inline__ vector signed int __attribute__((__always_inline__))12548vec_vsum2sws(vector int __a, vector int __b) {12549#ifdef __LITTLE_ENDIAN__12550vector int __c = (vector signed int)vec_perm(12551__b, __b, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,125528, 9, 10, 11));12553__c = __builtin_altivec_vsum2sws(__a, __c);12554return (vector signed int)vec_perm(12555__c, __c, (vector unsigned char)(4, 5, 6, 7, 0, 1, 2, 3, 12, 13, 14, 15,125568, 9, 10, 11));12557#else12558return __builtin_altivec_vsum2sws(__a, __b);12559#endif12560}1256112562/* vec_sums */1256312564/* The vsumsws instruction has a big-endian bias, so that the second12565input vector and the result always reference big-endian element 312566(little-endian element 0). For ease of porting the programmer12567wants element 3 in both cases, so for little endian we must perform12568some permutes. */1256912570static __inline__ vector signed int __attribute__((__always_inline__))12571vec_sums(vector signed int __a, vector signed int __b) {12572#ifdef __LITTLE_ENDIAN__12573__b = (vector signed int)vec_splat(__b, 3);12574__b = __builtin_altivec_vsumsws(__a, __b);12575return (vector signed int)(0, 0, 0, __b[0]);12576#else12577return __builtin_altivec_vsumsws(__a, __b);12578#endif12579}1258012581/* vec_vsumsws */1258212583static __inline__ vector signed int __attribute__((__always_inline__))12584vec_vsumsws(vector signed int __a, vector signed int __b) {12585#ifdef __LITTLE_ENDIAN__12586__b = (vector signed int)vec_splat(__b, 3);12587__b = __builtin_altivec_vsumsws(__a, __b);12588return (vector signed int)(0, 0, 0, __b[0]);12589#else12590return __builtin_altivec_vsumsws(__a, __b);12591#endif12592}1259312594/* vec_trunc */1259512596static __inline__ vector float __ATTRS_o_ai vec_trunc(vector float __a) {12597#ifdef __VSX__12598return __builtin_vsx_xvrspiz(__a);12599#else12600return __builtin_altivec_vrfiz(__a);12601#endif12602}1260312604#ifdef __VSX__12605static __inline__ vector double __ATTRS_o_ai vec_trunc(vector double __a) {12606return __builtin_vsx_xvrdpiz(__a);12607}12608#endif1260912610/* vec_roundz */12611static __inline__ vector float __ATTRS_o_ai vec_roundz(vector float __a) {12612return vec_trunc(__a);12613}1261412615#ifdef __VSX__12616static __inline__ vector double __ATTRS_o_ai vec_roundz(vector double __a) {12617return vec_trunc(__a);12618}12619#endif1262012621/* vec_vrfiz */1262212623static __inline__ vector float __attribute__((__always_inline__))12624vec_vrfiz(vector float __a) {12625return __builtin_altivec_vrfiz(__a);12626}1262712628/* vec_unpackh */1262912630/* The vector unpack instructions all have a big-endian bias, so for12631little endian we must reverse the meanings of "high" and "low." */12632#ifdef __LITTLE_ENDIAN__12633#define vec_vupkhpx(__a) __builtin_altivec_vupklpx((vector short)(__a))12634#define vec_vupklpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))12635#else12636#define vec_vupkhpx(__a) __builtin_altivec_vupkhpx((vector short)(__a))12637#define vec_vupklpx(__a) __builtin_altivec_vupklpx((vector short)(__a))12638#endif1263912640static __inline__ vector short __ATTRS_o_ai12641vec_unpackh(vector signed char __a) {12642#ifdef __LITTLE_ENDIAN__12643return __builtin_altivec_vupklsb((vector char)__a);12644#else12645return __builtin_altivec_vupkhsb((vector char)__a);12646#endif12647}1264812649static __inline__ vector bool short __ATTRS_o_ai12650vec_unpackh(vector bool char __a) {12651#ifdef __LITTLE_ENDIAN__12652return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);12653#else12654return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);12655#endif12656}1265712658static __inline__ vector int __ATTRS_o_ai vec_unpackh(vector short __a) {12659#ifdef __LITTLE_ENDIAN__12660return __builtin_altivec_vupklsh(__a);12661#else12662return __builtin_altivec_vupkhsh(__a);12663#endif12664}1266512666static __inline__ vector bool int __ATTRS_o_ai12667vec_unpackh(vector bool short __a) {12668#ifdef __LITTLE_ENDIAN__12669return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);12670#else12671return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);12672#endif12673}1267412675static __inline__ vector unsigned int __ATTRS_o_ai12676vec_unpackh(vector pixel __a) {12677#ifdef __LITTLE_ENDIAN__12678return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);12679#else12680return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);12681#endif12682}1268312684#ifdef __POWER8_VECTOR__12685static __inline__ vector long long __ATTRS_o_ai vec_unpackh(vector int __a) {12686#ifdef __LITTLE_ENDIAN__12687return __builtin_altivec_vupklsw(__a);12688#else12689return __builtin_altivec_vupkhsw(__a);12690#endif12691}1269212693static __inline__ vector bool long long __ATTRS_o_ai12694vec_unpackh(vector bool int __a) {12695#ifdef __LITTLE_ENDIAN__12696return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);12697#else12698return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);12699#endif12700}1270112702static __inline__ vector double __ATTRS_o_ai12703vec_unpackh(vector float __a) {12704return (vector double)(__a[0], __a[1]);12705}12706#endif1270712708/* vec_vupkhsb */1270912710static __inline__ vector short __ATTRS_o_ai12711vec_vupkhsb(vector signed char __a) {12712#ifdef __LITTLE_ENDIAN__12713return __builtin_altivec_vupklsb((vector char)__a);12714#else12715return __builtin_altivec_vupkhsb((vector char)__a);12716#endif12717}1271812719static __inline__ vector bool short __ATTRS_o_ai12720vec_vupkhsb(vector bool char __a) {12721#ifdef __LITTLE_ENDIAN__12722return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);12723#else12724return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);12725#endif12726}1272712728/* vec_vupkhsh */1272912730static __inline__ vector int __ATTRS_o_ai vec_vupkhsh(vector short __a) {12731#ifdef __LITTLE_ENDIAN__12732return __builtin_altivec_vupklsh(__a);12733#else12734return __builtin_altivec_vupkhsh(__a);12735#endif12736}1273712738static __inline__ vector bool int __ATTRS_o_ai12739vec_vupkhsh(vector bool short __a) {12740#ifdef __LITTLE_ENDIAN__12741return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);12742#else12743return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);12744#endif12745}1274612747static __inline__ vector unsigned int __ATTRS_o_ai12748vec_vupkhsh(vector pixel __a) {12749#ifdef __LITTLE_ENDIAN__12750return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);12751#else12752return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);12753#endif12754}1275512756/* vec_vupkhsw */1275712758#ifdef __POWER8_VECTOR__12759static __inline__ vector long long __ATTRS_o_ai vec_vupkhsw(vector int __a) {12760#ifdef __LITTLE_ENDIAN__12761return __builtin_altivec_vupklsw(__a);12762#else12763return __builtin_altivec_vupkhsw(__a);12764#endif12765}1276612767static __inline__ vector bool long long __ATTRS_o_ai12768vec_vupkhsw(vector bool int __a) {12769#ifdef __LITTLE_ENDIAN__12770return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);12771#else12772return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);12773#endif12774}12775#endif1277612777/* vec_unpackl */1277812779static __inline__ vector short __ATTRS_o_ai12780vec_unpackl(vector signed char __a) {12781#ifdef __LITTLE_ENDIAN__12782return __builtin_altivec_vupkhsb((vector char)__a);12783#else12784return __builtin_altivec_vupklsb((vector char)__a);12785#endif12786}1278712788static __inline__ vector bool short __ATTRS_o_ai12789vec_unpackl(vector bool char __a) {12790#ifdef __LITTLE_ENDIAN__12791return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);12792#else12793return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);12794#endif12795}1279612797static __inline__ vector int __ATTRS_o_ai vec_unpackl(vector short __a) {12798#ifdef __LITTLE_ENDIAN__12799return __builtin_altivec_vupkhsh(__a);12800#else12801return __builtin_altivec_vupklsh(__a);12802#endif12803}1280412805static __inline__ vector bool int __ATTRS_o_ai12806vec_unpackl(vector bool short __a) {12807#ifdef __LITTLE_ENDIAN__12808return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);12809#else12810return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);12811#endif12812}1281312814static __inline__ vector unsigned int __ATTRS_o_ai12815vec_unpackl(vector pixel __a) {12816#ifdef __LITTLE_ENDIAN__12817return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);12818#else12819return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);12820#endif12821}1282212823#ifdef __POWER8_VECTOR__12824static __inline__ vector long long __ATTRS_o_ai vec_unpackl(vector int __a) {12825#ifdef __LITTLE_ENDIAN__12826return __builtin_altivec_vupkhsw(__a);12827#else12828return __builtin_altivec_vupklsw(__a);12829#endif12830}1283112832static __inline__ vector bool long long __ATTRS_o_ai12833vec_unpackl(vector bool int __a) {12834#ifdef __LITTLE_ENDIAN__12835return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);12836#else12837return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);12838#endif12839}1284012841static __inline__ vector double __ATTRS_o_ai12842vec_unpackl(vector float __a) {12843return (vector double)(__a[2], __a[3]);12844}12845#endif1284612847/* vec_vupklsb */1284812849static __inline__ vector short __ATTRS_o_ai12850vec_vupklsb(vector signed char __a) {12851#ifdef __LITTLE_ENDIAN__12852return __builtin_altivec_vupkhsb((vector char)__a);12853#else12854return __builtin_altivec_vupklsb((vector char)__a);12855#endif12856}1285712858static __inline__ vector bool short __ATTRS_o_ai12859vec_vupklsb(vector bool char __a) {12860#ifdef __LITTLE_ENDIAN__12861return (vector bool short)__builtin_altivec_vupkhsb((vector char)__a);12862#else12863return (vector bool short)__builtin_altivec_vupklsb((vector char)__a);12864#endif12865}1286612867/* vec_vupklsh */1286812869static __inline__ vector int __ATTRS_o_ai vec_vupklsh(vector short __a) {12870#ifdef __LITTLE_ENDIAN__12871return __builtin_altivec_vupkhsh(__a);12872#else12873return __builtin_altivec_vupklsh(__a);12874#endif12875}1287612877static __inline__ vector bool int __ATTRS_o_ai12878vec_vupklsh(vector bool short __a) {12879#ifdef __LITTLE_ENDIAN__12880return (vector bool int)__builtin_altivec_vupkhsh((vector short)__a);12881#else12882return (vector bool int)__builtin_altivec_vupklsh((vector short)__a);12883#endif12884}1288512886static __inline__ vector unsigned int __ATTRS_o_ai12887vec_vupklsh(vector pixel __a) {12888#ifdef __LITTLE_ENDIAN__12889return (vector unsigned int)__builtin_altivec_vupkhpx((vector short)__a);12890#else12891return (vector unsigned int)__builtin_altivec_vupklpx((vector short)__a);12892#endif12893}1289412895/* vec_vupklsw */1289612897#ifdef __POWER8_VECTOR__12898static __inline__ vector long long __ATTRS_o_ai vec_vupklsw(vector int __a) {12899#ifdef __LITTLE_ENDIAN__12900return __builtin_altivec_vupkhsw(__a);12901#else12902return __builtin_altivec_vupklsw(__a);12903#endif12904}1290512906static __inline__ vector bool long long __ATTRS_o_ai12907vec_vupklsw(vector bool int __a) {12908#ifdef __LITTLE_ENDIAN__12909return (vector bool long long)__builtin_altivec_vupkhsw((vector int)__a);12910#else12911return (vector bool long long)__builtin_altivec_vupklsw((vector int)__a);12912#endif12913}12914#endif1291512916/* vec_vsx_ld */1291712918#ifdef __VSX__1291912920static __inline__ vector bool int __ATTRS_o_ai12921vec_vsx_ld(int __a, const vector bool int *__b) {12922return (vector bool int)__builtin_vsx_lxvw4x(__a, __b);12923}1292412925static __inline__ vector signed int __ATTRS_o_ai12926vec_vsx_ld(int __a, const vector signed int *__b) {12927return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);12928}1292912930static __inline__ vector signed int __ATTRS_o_ai12931vec_vsx_ld(int __a, const signed int *__b) {12932return (vector signed int)__builtin_vsx_lxvw4x(__a, __b);12933}1293412935static __inline__ vector unsigned int __ATTRS_o_ai12936vec_vsx_ld(int __a, const vector unsigned int *__b) {12937return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);12938}1293912940static __inline__ vector unsigned int __ATTRS_o_ai12941vec_vsx_ld(int __a, const unsigned int *__b) {12942return (vector unsigned int)__builtin_vsx_lxvw4x(__a, __b);12943}1294412945static __inline__ vector float __ATTRS_o_ai12946vec_vsx_ld(int __a, const vector float *__b) {12947return (vector float)__builtin_vsx_lxvw4x(__a, __b);12948}1294912950static __inline__ vector float __ATTRS_o_ai vec_vsx_ld(int __a,12951const float *__b) {12952return (vector float)__builtin_vsx_lxvw4x(__a, __b);12953}1295412955static __inline__ vector signed long long __ATTRS_o_ai12956vec_vsx_ld(int __a, const vector signed long long *__b) {12957return (vector signed long long)__builtin_vsx_lxvd2x(__a, __b);12958}1295912960static __inline__ vector unsigned long long __ATTRS_o_ai12961vec_vsx_ld(int __a, const vector unsigned long long *__b) {12962return (vector unsigned long long)__builtin_vsx_lxvd2x(__a, __b);12963}1296412965static __inline__ vector double __ATTRS_o_ai12966vec_vsx_ld(int __a, const vector double *__b) {12967return (vector double)__builtin_vsx_lxvd2x(__a, __b);12968}1296912970static __inline__ vector double __ATTRS_o_ai12971vec_vsx_ld(int __a, const double *__b) {12972return (vector double)__builtin_vsx_lxvd2x(__a, __b);12973}1297412975static __inline__ vector bool short __ATTRS_o_ai12976vec_vsx_ld(int __a, const vector bool short *__b) {12977return (vector bool short)__builtin_vsx_lxvw4x(__a, __b);12978}1297912980static __inline__ vector signed short __ATTRS_o_ai12981vec_vsx_ld(int __a, const vector signed short *__b) {12982return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);12983}1298412985static __inline__ vector signed short __ATTRS_o_ai12986vec_vsx_ld(int __a, const signed short *__b) {12987return (vector signed short)__builtin_vsx_lxvw4x(__a, __b);12988}1298912990static __inline__ vector unsigned short __ATTRS_o_ai12991vec_vsx_ld(int __a, const vector unsigned short *__b) {12992return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);12993}1299412995static __inline__ vector unsigned short __ATTRS_o_ai12996vec_vsx_ld(int __a, const unsigned short *__b) {12997return (vector unsigned short)__builtin_vsx_lxvw4x(__a, __b);12998}1299913000static __inline__ vector bool char __ATTRS_o_ai13001vec_vsx_ld(int __a, const vector bool char *__b) {13002return (vector bool char)__builtin_vsx_lxvw4x(__a, __b);13003}1300413005static __inline__ vector signed char __ATTRS_o_ai13006vec_vsx_ld(int __a, const vector signed char *__b) {13007return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);13008}1300913010static __inline__ vector signed char __ATTRS_o_ai13011vec_vsx_ld(int __a, const signed char *__b) {13012return (vector signed char)__builtin_vsx_lxvw4x(__a, __b);13013}1301413015static __inline__ vector unsigned char __ATTRS_o_ai13016vec_vsx_ld(int __a, const vector unsigned char *__b) {13017return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);13018}1301913020static __inline__ vector unsigned char __ATTRS_o_ai13021vec_vsx_ld(int __a, const unsigned char *__b) {13022return (vector unsigned char)__builtin_vsx_lxvw4x(__a, __b);13023}1302413025#endif1302613027/* vec_vsx_st */1302813029#ifdef __VSX__1303013031static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,13032vector bool int *__c) {13033__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13034}1303513036static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,13037signed int *__c) {13038__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13039}1304013041static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool int __a, int __b,13042unsigned int *__c) {13043__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13044}1304513046static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,13047vector signed int *__c) {13048__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13049}1305013051static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed int __a, int __b,13052signed int *__c) {13053__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13054}1305513056static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,13057vector unsigned int *__c) {13058__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13059}1306013061static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned int __a, int __b,13062unsigned int *__c) {13063__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13064}1306513066static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,13067vector float *__c) {13068__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13069}1307013071static __inline__ void __ATTRS_o_ai vec_vsx_st(vector float __a, int __b,13072float *__c) {13073__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13074}1307513076static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed long long __a,13077int __b,13078vector signed long long *__c) {13079__builtin_vsx_stxvd2x((vector double)__a, __b, __c);13080}1308113082static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned long long __a,13083int __b,13084vector unsigned long long *__c) {13085__builtin_vsx_stxvd2x((vector double)__a, __b, __c);13086}1308713088static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,13089vector double *__c) {13090__builtin_vsx_stxvd2x((vector double)__a, __b, __c);13091}1309213093static __inline__ void __ATTRS_o_ai vec_vsx_st(vector double __a, int __b,13094double *__c) {13095__builtin_vsx_stxvd2x((vector double)__a, __b, __c);13096}1309713098static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,13099vector bool short *__c) {13100__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13101}1310213103static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,13104signed short *__c) {13105__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13106}1310713108static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool short __a, int __b,13109unsigned short *__c) {13110__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13111}13112static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,13113vector signed short *__c) {13114__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13115}1311613117static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed short __a, int __b,13118signed short *__c) {13119__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13120}1312113122static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,13123int __b,13124vector unsigned short *__c) {13125__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13126}1312713128static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned short __a,13129int __b, unsigned short *__c) {13130__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13131}1313213133static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,13134vector bool char *__c) {13135__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13136}1313713138static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,13139signed char *__c) {13140__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13141}1314213143static __inline__ void __ATTRS_o_ai vec_vsx_st(vector bool char __a, int __b,13144unsigned char *__c) {13145__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13146}1314713148static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,13149vector signed char *__c) {13150__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13151}1315213153static __inline__ void __ATTRS_o_ai vec_vsx_st(vector signed char __a, int __b,13154signed char *__c) {13155__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13156}1315713158static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,13159int __b,13160vector unsigned char *__c) {13161__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13162}1316313164static __inline__ void __ATTRS_o_ai vec_vsx_st(vector unsigned char __a,13165int __b, unsigned char *__c) {13166__builtin_vsx_stxvw4x((vector int)__a, __b, __c);13167}1316813169#endif1317013171#ifdef __VSX__13172#define vec_xxpermdi __builtin_vsx_xxpermdi13173#define vec_xxsldwi __builtin_vsx_xxsldwi13174#define vec_permi(__a, __b, __c) \13175_Generic((__a), vector signed long long \13176: __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \13177(((__c)&0x1) + 2)), \13178vector unsigned long long \13179: __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \13180(((__c)&0x1) + 2)), \13181vector double \13182: __builtin_shufflevector((__a), (__b), (((__c) >> 1) & 0x1), \13183(((__c)&0x1) + 2)))13184#endif1318513186/* vec_xor */1318713188#define __builtin_altivec_vxor vec_xor1318913190static __inline__ vector signed char __ATTRS_o_ai13191vec_xor(vector signed char __a, vector signed char __b) {13192return __a ^ __b;13193}1319413195static __inline__ vector signed char __ATTRS_o_ai13196vec_xor(vector bool char __a, vector signed char __b) {13197return (vector signed char)__a ^ __b;13198}1319913200static __inline__ vector signed char __ATTRS_o_ai13201vec_xor(vector signed char __a, vector bool char __b) {13202return __a ^ (vector signed char)__b;13203}1320413205static __inline__ vector unsigned char __ATTRS_o_ai13206vec_xor(vector unsigned char __a, vector unsigned char __b) {13207return __a ^ __b;13208}1320913210static __inline__ vector unsigned char __ATTRS_o_ai13211vec_xor(vector bool char __a, vector unsigned char __b) {13212return (vector unsigned char)__a ^ __b;13213}1321413215static __inline__ vector unsigned char __ATTRS_o_ai13216vec_xor(vector unsigned char __a, vector bool char __b) {13217return __a ^ (vector unsigned char)__b;13218}1321913220static __inline__ vector bool char __ATTRS_o_ai vec_xor(vector bool char __a,13221vector bool char __b) {13222return __a ^ __b;13223}1322413225static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,13226vector short __b) {13227return __a ^ __b;13228}1322913230static __inline__ vector short __ATTRS_o_ai vec_xor(vector bool short __a,13231vector short __b) {13232return (vector short)__a ^ __b;13233}1323413235static __inline__ vector short __ATTRS_o_ai vec_xor(vector short __a,13236vector bool short __b) {13237return __a ^ (vector short)__b;13238}1323913240static __inline__ vector unsigned short __ATTRS_o_ai13241vec_xor(vector unsigned short __a, vector unsigned short __b) {13242return __a ^ __b;13243}1324413245static __inline__ vector unsigned short __ATTRS_o_ai13246vec_xor(vector bool short __a, vector unsigned short __b) {13247return (vector unsigned short)__a ^ __b;13248}1324913250static __inline__ vector unsigned short __ATTRS_o_ai13251vec_xor(vector unsigned short __a, vector bool short __b) {13252return __a ^ (vector unsigned short)__b;13253}1325413255static __inline__ vector bool short __ATTRS_o_ai13256vec_xor(vector bool short __a, vector bool short __b) {13257return __a ^ __b;13258}1325913260static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,13261vector int __b) {13262return __a ^ __b;13263}1326413265static __inline__ vector int __ATTRS_o_ai vec_xor(vector bool int __a,13266vector int __b) {13267return (vector int)__a ^ __b;13268}1326913270static __inline__ vector int __ATTRS_o_ai vec_xor(vector int __a,13271vector bool int __b) {13272return __a ^ (vector int)__b;13273}1327413275static __inline__ vector unsigned int __ATTRS_o_ai13276vec_xor(vector unsigned int __a, vector unsigned int __b) {13277return __a ^ __b;13278}1327913280static __inline__ vector unsigned int __ATTRS_o_ai13281vec_xor(vector bool int __a, vector unsigned int __b) {13282return (vector unsigned int)__a ^ __b;13283}1328413285static __inline__ vector unsigned int __ATTRS_o_ai13286vec_xor(vector unsigned int __a, vector bool int __b) {13287return __a ^ (vector unsigned int)__b;13288}1328913290static __inline__ vector bool int __ATTRS_o_ai vec_xor(vector bool int __a,13291vector bool int __b) {13292return __a ^ __b;13293}1329413295static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,13296vector float __b) {13297vector unsigned int __res =13298(vector unsigned int)__a ^ (vector unsigned int)__b;13299return (vector float)__res;13300}1330113302static __inline__ vector float __ATTRS_o_ai vec_xor(vector bool int __a,13303vector float __b) {13304vector unsigned int __res =13305(vector unsigned int)__a ^ (vector unsigned int)__b;13306return (vector float)__res;13307}1330813309static __inline__ vector float __ATTRS_o_ai vec_xor(vector float __a,13310vector bool int __b) {13311vector unsigned int __res =13312(vector unsigned int)__a ^ (vector unsigned int)__b;13313return (vector float)__res;13314}1331513316#ifdef __VSX__13317static __inline__ vector signed long long __ATTRS_o_ai13318vec_xor(vector signed long long __a, vector signed long long __b) {13319return __a ^ __b;13320}1332113322static __inline__ vector signed long long __ATTRS_o_ai13323vec_xor(vector bool long long __a, vector signed long long __b) {13324return (vector signed long long)__a ^ __b;13325}1332613327static __inline__ vector signed long long __ATTRS_o_ai13328vec_xor(vector signed long long __a, vector bool long long __b) {13329return __a ^ (vector signed long long)__b;13330}1333113332static __inline__ vector unsigned long long __ATTRS_o_ai13333vec_xor(vector unsigned long long __a, vector unsigned long long __b) {13334return __a ^ __b;13335}1333613337static __inline__ vector unsigned long long __ATTRS_o_ai13338vec_xor(vector bool long long __a, vector unsigned long long __b) {13339return (vector unsigned long long)__a ^ __b;13340}1334113342static __inline__ vector unsigned long long __ATTRS_o_ai13343vec_xor(vector unsigned long long __a, vector bool long long __b) {13344return __a ^ (vector unsigned long long)__b;13345}1334613347static __inline__ vector bool long long __ATTRS_o_ai13348vec_xor(vector bool long long __a, vector bool long long __b) {13349return __a ^ __b;13350}1335113352static __inline__ vector double __ATTRS_o_ai vec_xor(vector double __a,13353vector double __b) {13354return (vector double)((vector unsigned long long)__a ^13355(vector unsigned long long)__b);13356}1335713358static __inline__ vector double __ATTRS_o_ai13359vec_xor(vector double __a, vector bool long long __b) {13360return (vector double)((vector unsigned long long)__a ^13361(vector unsigned long long)__b);13362}1336313364static __inline__ vector double __ATTRS_o_ai vec_xor(vector bool long long __a,13365vector double __b) {13366return (vector double)((vector unsigned long long)__a ^13367(vector unsigned long long)__b);13368}13369#endif1337013371/* vec_vxor */1337213373static __inline__ vector signed char __ATTRS_o_ai13374vec_vxor(vector signed char __a, vector signed char __b) {13375return __a ^ __b;13376}1337713378static __inline__ vector signed char __ATTRS_o_ai13379vec_vxor(vector bool char __a, vector signed char __b) {13380return (vector signed char)__a ^ __b;13381}1338213383static __inline__ vector signed char __ATTRS_o_ai13384vec_vxor(vector signed char __a, vector bool char __b) {13385return __a ^ (vector signed char)__b;13386}1338713388static __inline__ vector unsigned char __ATTRS_o_ai13389vec_vxor(vector unsigned char __a, vector unsigned char __b) {13390return __a ^ __b;13391}1339213393static __inline__ vector unsigned char __ATTRS_o_ai13394vec_vxor(vector bool char __a, vector unsigned char __b) {13395return (vector unsigned char)__a ^ __b;13396}1339713398static __inline__ vector unsigned char __ATTRS_o_ai13399vec_vxor(vector unsigned char __a, vector bool char __b) {13400return __a ^ (vector unsigned char)__b;13401}1340213403static __inline__ vector bool char __ATTRS_o_ai vec_vxor(vector bool char __a,13404vector bool char __b) {13405return __a ^ __b;13406}1340713408static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,13409vector short __b) {13410return __a ^ __b;13411}1341213413static __inline__ vector short __ATTRS_o_ai vec_vxor(vector bool short __a,13414vector short __b) {13415return (vector short)__a ^ __b;13416}1341713418static __inline__ vector short __ATTRS_o_ai vec_vxor(vector short __a,13419vector bool short __b) {13420return __a ^ (vector short)__b;13421}1342213423static __inline__ vector unsigned short __ATTRS_o_ai13424vec_vxor(vector unsigned short __a, vector unsigned short __b) {13425return __a ^ __b;13426}1342713428static __inline__ vector unsigned short __ATTRS_o_ai13429vec_vxor(vector bool short __a, vector unsigned short __b) {13430return (vector unsigned short)__a ^ __b;13431}1343213433static __inline__ vector unsigned short __ATTRS_o_ai13434vec_vxor(vector unsigned short __a, vector bool short __b) {13435return __a ^ (vector unsigned short)__b;13436}1343713438static __inline__ vector bool short __ATTRS_o_ai13439vec_vxor(vector bool short __a, vector bool short __b) {13440return __a ^ __b;13441}1344213443static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,13444vector int __b) {13445return __a ^ __b;13446}1344713448static __inline__ vector int __ATTRS_o_ai vec_vxor(vector bool int __a,13449vector int __b) {13450return (vector int)__a ^ __b;13451}1345213453static __inline__ vector int __ATTRS_o_ai vec_vxor(vector int __a,13454vector bool int __b) {13455return __a ^ (vector int)__b;13456}1345713458static __inline__ vector unsigned int __ATTRS_o_ai13459vec_vxor(vector unsigned int __a, vector unsigned int __b) {13460return __a ^ __b;13461}1346213463static __inline__ vector unsigned int __ATTRS_o_ai13464vec_vxor(vector bool int __a, vector unsigned int __b) {13465return (vector unsigned int)__a ^ __b;13466}1346713468static __inline__ vector unsigned int __ATTRS_o_ai13469vec_vxor(vector unsigned int __a, vector bool int __b) {13470return __a ^ (vector unsigned int)__b;13471}1347213473static __inline__ vector bool int __ATTRS_o_ai vec_vxor(vector bool int __a,13474vector bool int __b) {13475return __a ^ __b;13476}1347713478static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,13479vector float __b) {13480vector unsigned int __res =13481(vector unsigned int)__a ^ (vector unsigned int)__b;13482return (vector float)__res;13483}1348413485static __inline__ vector float __ATTRS_o_ai vec_vxor(vector bool int __a,13486vector float __b) {13487vector unsigned int __res =13488(vector unsigned int)__a ^ (vector unsigned int)__b;13489return (vector float)__res;13490}1349113492static __inline__ vector float __ATTRS_o_ai vec_vxor(vector float __a,13493vector bool int __b) {13494vector unsigned int __res =13495(vector unsigned int)__a ^ (vector unsigned int)__b;13496return (vector float)__res;13497}1349813499#ifdef __VSX__13500static __inline__ vector signed long long __ATTRS_o_ai13501vec_vxor(vector signed long long __a, vector signed long long __b) {13502return __a ^ __b;13503}1350413505static __inline__ vector signed long long __ATTRS_o_ai13506vec_vxor(vector bool long long __a, vector signed long long __b) {13507return (vector signed long long)__a ^ __b;13508}1350913510static __inline__ vector signed long long __ATTRS_o_ai13511vec_vxor(vector signed long long __a, vector bool long long __b) {13512return __a ^ (vector signed long long)__b;13513}1351413515static __inline__ vector unsigned long long __ATTRS_o_ai13516vec_vxor(vector unsigned long long __a, vector unsigned long long __b) {13517return __a ^ __b;13518}1351913520static __inline__ vector unsigned long long __ATTRS_o_ai13521vec_vxor(vector bool long long __a, vector unsigned long long __b) {13522return (vector unsigned long long)__a ^ __b;13523}1352413525static __inline__ vector unsigned long long __ATTRS_o_ai13526vec_vxor(vector unsigned long long __a, vector bool long long __b) {13527return __a ^ (vector unsigned long long)__b;13528}1352913530static __inline__ vector bool long long __ATTRS_o_ai13531vec_vxor(vector bool long long __a, vector bool long long __b) {13532return __a ^ __b;13533}13534#endif1353513536/* ------------------------ extensions for CBEA ----------------------------- */1353713538/* vec_extract */1353913540static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a,13541signed int __b) {13542return __a[__b & 0xf];13543}1354413545static __inline__ unsigned char __ATTRS_o_ai13546vec_extract(vector unsigned char __a, signed int __b) {13547return __a[__b & 0xf];13548}1354913550static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a,13551signed int __b) {13552return __a[__b & 0xf];13553}1355413555static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a,13556signed int __b) {13557return __a[__b & 0x7];13558}1355913560static __inline__ unsigned short __ATTRS_o_ai13561vec_extract(vector unsigned short __a, signed int __b) {13562return __a[__b & 0x7];13563}1356413565static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a,13566signed int __b) {13567return __a[__b & 0x7];13568}1356913570static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a,13571signed int __b) {13572return __a[__b & 0x3];13573}1357413575static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a,13576signed int __b) {13577return __a[__b & 0x3];13578}1357913580static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a,13581signed int __b) {13582return __a[__b & 0x3];13583}1358413585#ifdef __VSX__13586static __inline__ signed long long __ATTRS_o_ai13587vec_extract(vector signed long long __a, signed int __b) {13588return __a[__b & 0x1];13589}1359013591static __inline__ unsigned long long __ATTRS_o_ai13592vec_extract(vector unsigned long long __a, signed int __b) {13593return __a[__b & 0x1];13594}1359513596static __inline__ unsigned long long __ATTRS_o_ai13597vec_extract(vector bool long long __a, signed int __b) {13598return __a[__b & 0x1];13599}1360013601static __inline__ double __ATTRS_o_ai vec_extract(vector double __a,13602signed int __b) {13603return __a[__b & 0x1];13604}13605#endif1360613607static __inline__ float __ATTRS_o_ai vec_extract(vector float __a,13608signed int __b) {13609return __a[__b & 0x3];13610}1361113612#ifdef __POWER9_VECTOR__1361313614#define vec_insert4b __builtin_vsx_insertword13615#define vec_extract4b __builtin_vsx_extractuword1361613617/* vec_extract_exp */1361813619static __inline__ vector unsigned int __ATTRS_o_ai13620vec_extract_exp(vector float __a) {13621return __builtin_vsx_xvxexpsp(__a);13622}1362313624static __inline__ vector unsigned long long __ATTRS_o_ai13625vec_extract_exp(vector double __a) {13626return __builtin_vsx_xvxexpdp(__a);13627}1362813629/* vec_extract_sig */1363013631static __inline__ vector unsigned int __ATTRS_o_ai13632vec_extract_sig(vector float __a) {13633return __builtin_vsx_xvxsigsp(__a);13634}1363513636static __inline__ vector unsigned long long __ATTRS_o_ai13637vec_extract_sig (vector double __a) {13638return __builtin_vsx_xvxsigdp(__a);13639}1364013641static __inline__ vector float __ATTRS_o_ai13642vec_extract_fp32_from_shorth(vector unsigned short __a) {13643vector unsigned short __b =13644#ifdef __LITTLE_ENDIAN__13645__builtin_shufflevector(__a, __a, 0, -1, 1, -1, 2, -1, 3, -1);13646#else13647__builtin_shufflevector(__a, __a, -1, 0, -1, 1, -1, 2, -1, 3);13648#endif13649return __builtin_vsx_xvcvhpsp(__b);13650}1365113652static __inline__ vector float __ATTRS_o_ai13653vec_extract_fp32_from_shortl(vector unsigned short __a) {13654vector unsigned short __b =13655#ifdef __LITTLE_ENDIAN__13656__builtin_shufflevector(__a, __a, 4, -1, 5, -1, 6, -1, 7, -1);13657#else13658__builtin_shufflevector(__a, __a, -1, 4, -1, 5, -1, 6, -1, 7);13659#endif13660return __builtin_vsx_xvcvhpsp(__b);13661}13662#endif /* __POWER9_VECTOR__ */1366313664/* vec_insert */1366513666static __inline__ vector signed char __ATTRS_o_ai13667vec_insert(signed char __a, vector signed char __b, int __c) {13668__b[__c & 0xF] = __a;13669return __b;13670}1367113672static __inline__ vector unsigned char __ATTRS_o_ai13673vec_insert(unsigned char __a, vector unsigned char __b, int __c) {13674__b[__c & 0xF] = __a;13675return __b;13676}1367713678static __inline__ vector bool char __ATTRS_o_ai vec_insert(unsigned char __a,13679vector bool char __b,13680int __c) {13681__b[__c & 0xF] = __a;13682return __b;13683}1368413685static __inline__ vector signed short __ATTRS_o_ai13686vec_insert(signed short __a, vector signed short __b, int __c) {13687__b[__c & 0x7] = __a;13688return __b;13689}1369013691static __inline__ vector unsigned short __ATTRS_o_ai13692vec_insert(unsigned short __a, vector unsigned short __b, int __c) {13693__b[__c & 0x7] = __a;13694return __b;13695}1369613697static __inline__ vector bool short __ATTRS_o_ai13698vec_insert(unsigned short __a, vector bool short __b, int __c) {13699__b[__c & 0x7] = __a;13700return __b;13701}1370213703static __inline__ vector signed int __ATTRS_o_ai13704vec_insert(signed int __a, vector signed int __b, int __c) {13705__b[__c & 0x3] = __a;13706return __b;13707}1370813709static __inline__ vector unsigned int __ATTRS_o_ai13710vec_insert(unsigned int __a, vector unsigned int __b, int __c) {13711__b[__c & 0x3] = __a;13712return __b;13713}1371413715static __inline__ vector bool int __ATTRS_o_ai vec_insert(unsigned int __a,13716vector bool int __b,13717int __c) {13718__b[__c & 0x3] = __a;13719return __b;13720}1372113722#ifdef __VSX__13723static __inline__ vector signed long long __ATTRS_o_ai13724vec_insert(signed long long __a, vector signed long long __b, int __c) {13725__b[__c & 0x1] = __a;13726return __b;13727}1372813729static __inline__ vector unsigned long long __ATTRS_o_ai13730vec_insert(unsigned long long __a, vector unsigned long long __b, int __c) {13731__b[__c & 0x1] = __a;13732return __b;13733}1373413735static __inline__ vector bool long long __ATTRS_o_ai13736vec_insert(unsigned long long __a, vector bool long long __b, int __c) {13737__b[__c & 0x1] = __a;13738return __b;13739}13740static __inline__ vector double __ATTRS_o_ai vec_insert(double __a,13741vector double __b,13742int __c) {13743__b[__c & 0x1] = __a;13744return __b;13745}13746#endif1374713748static __inline__ vector float __ATTRS_o_ai vec_insert(float __a,13749vector float __b,13750int __c) {13751__b[__c & 0x3] = __a;13752return __b;13753}1375413755/* vec_lvlx */1375613757static __inline__ vector signed char __ATTRS_o_ai13758vec_lvlx(int __a, const signed char *__b) {13759return vec_perm(vec_ld(__a, __b), (vector signed char)(0),13760vec_lvsl(__a, __b));13761}1376213763static __inline__ vector signed char __ATTRS_o_ai13764vec_lvlx(int __a, const vector signed char *__b) {13765return vec_perm(vec_ld(__a, __b), (vector signed char)(0),13766vec_lvsl(__a, (unsigned char *)__b));13767}1376813769static __inline__ vector unsigned char __ATTRS_o_ai13770vec_lvlx(int __a, const unsigned char *__b) {13771return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),13772vec_lvsl(__a, __b));13773}1377413775static __inline__ vector unsigned char __ATTRS_o_ai13776vec_lvlx(int __a, const vector unsigned char *__b) {13777return vec_perm(vec_ld(__a, __b), (vector unsigned char)(0),13778vec_lvsl(__a, (unsigned char *)__b));13779}1378013781static __inline__ vector bool char __ATTRS_o_ai13782vec_lvlx(int __a, const vector bool char *__b) {13783return vec_perm(vec_ld(__a, __b), (vector bool char)(0),13784vec_lvsl(__a, (unsigned char *)__b));13785}1378613787static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,13788const short *__b) {13789return vec_perm(vec_ld(__a, __b), (vector short)(0), vec_lvsl(__a, __b));13790}1379113792static __inline__ vector short __ATTRS_o_ai vec_lvlx(int __a,13793const vector short *__b) {13794return vec_perm(vec_ld(__a, __b), (vector short)(0),13795vec_lvsl(__a, (unsigned char *)__b));13796}1379713798static __inline__ vector unsigned short __ATTRS_o_ai13799vec_lvlx(int __a, const unsigned short *__b) {13800return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),13801vec_lvsl(__a, __b));13802}1380313804static __inline__ vector unsigned short __ATTRS_o_ai13805vec_lvlx(int __a, const vector unsigned short *__b) {13806return vec_perm(vec_ld(__a, __b), (vector unsigned short)(0),13807vec_lvsl(__a, (unsigned char *)__b));13808}1380913810static __inline__ vector bool short __ATTRS_o_ai13811vec_lvlx(int __a, const vector bool short *__b) {13812return vec_perm(vec_ld(__a, __b), (vector bool short)(0),13813vec_lvsl(__a, (unsigned char *)__b));13814}1381513816static __inline__ vector pixel __ATTRS_o_ai vec_lvlx(int __a,13817const vector pixel *__b) {13818return vec_perm(vec_ld(__a, __b), (vector pixel)(0),13819vec_lvsl(__a, (unsigned char *)__b));13820}1382113822static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a, const int *__b) {13823return vec_perm(vec_ld(__a, __b), (vector int)(0), vec_lvsl(__a, __b));13824}1382513826static __inline__ vector int __ATTRS_o_ai vec_lvlx(int __a,13827const vector int *__b) {13828return vec_perm(vec_ld(__a, __b), (vector int)(0),13829vec_lvsl(__a, (unsigned char *)__b));13830}1383113832static __inline__ vector unsigned int __ATTRS_o_ai13833vec_lvlx(int __a, const unsigned int *__b) {13834return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),13835vec_lvsl(__a, __b));13836}1383713838static __inline__ vector unsigned int __ATTRS_o_ai13839vec_lvlx(int __a, const vector unsigned int *__b) {13840return vec_perm(vec_ld(__a, __b), (vector unsigned int)(0),13841vec_lvsl(__a, (unsigned char *)__b));13842}1384313844static __inline__ vector bool int __ATTRS_o_ai13845vec_lvlx(int __a, const vector bool int *__b) {13846return vec_perm(vec_ld(__a, __b), (vector bool int)(0),13847vec_lvsl(__a, (unsigned char *)__b));13848}1384913850static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,13851const float *__b) {13852return vec_perm(vec_ld(__a, __b), (vector float)(0), vec_lvsl(__a, __b));13853}1385413855static __inline__ vector float __ATTRS_o_ai vec_lvlx(int __a,13856const vector float *__b) {13857return vec_perm(vec_ld(__a, __b), (vector float)(0),13858vec_lvsl(__a, (unsigned char *)__b));13859}1386013861/* vec_lvlxl */1386213863static __inline__ vector signed char __ATTRS_o_ai13864vec_lvlxl(int __a, const signed char *__b) {13865return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),13866vec_lvsl(__a, __b));13867}1386813869static __inline__ vector signed char __ATTRS_o_ai13870vec_lvlxl(int __a, const vector signed char *__b) {13871return vec_perm(vec_ldl(__a, __b), (vector signed char)(0),13872vec_lvsl(__a, (unsigned char *)__b));13873}1387413875static __inline__ vector unsigned char __ATTRS_o_ai13876vec_lvlxl(int __a, const unsigned char *__b) {13877return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),13878vec_lvsl(__a, __b));13879}1388013881static __inline__ vector unsigned char __ATTRS_o_ai13882vec_lvlxl(int __a, const vector unsigned char *__b) {13883return vec_perm(vec_ldl(__a, __b), (vector unsigned char)(0),13884vec_lvsl(__a, (unsigned char *)__b));13885}1388613887static __inline__ vector bool char __ATTRS_o_ai13888vec_lvlxl(int __a, const vector bool char *__b) {13889return vec_perm(vec_ldl(__a, __b), (vector bool char)(0),13890vec_lvsl(__a, (unsigned char *)__b));13891}1389213893static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,13894const short *__b) {13895return vec_perm(vec_ldl(__a, __b), (vector short)(0), vec_lvsl(__a, __b));13896}1389713898static __inline__ vector short __ATTRS_o_ai vec_lvlxl(int __a,13899const vector short *__b) {13900return vec_perm(vec_ldl(__a, __b), (vector short)(0),13901vec_lvsl(__a, (unsigned char *)__b));13902}1390313904static __inline__ vector unsigned short __ATTRS_o_ai13905vec_lvlxl(int __a, const unsigned short *__b) {13906return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),13907vec_lvsl(__a, __b));13908}1390913910static __inline__ vector unsigned short __ATTRS_o_ai13911vec_lvlxl(int __a, const vector unsigned short *__b) {13912return vec_perm(vec_ldl(__a, __b), (vector unsigned short)(0),13913vec_lvsl(__a, (unsigned char *)__b));13914}1391513916static __inline__ vector bool short __ATTRS_o_ai13917vec_lvlxl(int __a, const vector bool short *__b) {13918return vec_perm(vec_ldl(__a, __b), (vector bool short)(0),13919vec_lvsl(__a, (unsigned char *)__b));13920}1392113922static __inline__ vector pixel __ATTRS_o_ai vec_lvlxl(int __a,13923const vector pixel *__b) {13924return vec_perm(vec_ldl(__a, __b), (vector pixel)(0),13925vec_lvsl(__a, (unsigned char *)__b));13926}1392713928static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a, const int *__b) {13929return vec_perm(vec_ldl(__a, __b), (vector int)(0), vec_lvsl(__a, __b));13930}1393113932static __inline__ vector int __ATTRS_o_ai vec_lvlxl(int __a,13933const vector int *__b) {13934return vec_perm(vec_ldl(__a, __b), (vector int)(0),13935vec_lvsl(__a, (unsigned char *)__b));13936}1393713938static __inline__ vector unsigned int __ATTRS_o_ai13939vec_lvlxl(int __a, const unsigned int *__b) {13940return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),13941vec_lvsl(__a, __b));13942}1394313944static __inline__ vector unsigned int __ATTRS_o_ai13945vec_lvlxl(int __a, const vector unsigned int *__b) {13946return vec_perm(vec_ldl(__a, __b), (vector unsigned int)(0),13947vec_lvsl(__a, (unsigned char *)__b));13948}1394913950static __inline__ vector bool int __ATTRS_o_ai13951vec_lvlxl(int __a, const vector bool int *__b) {13952return vec_perm(vec_ldl(__a, __b), (vector bool int)(0),13953vec_lvsl(__a, (unsigned char *)__b));13954}1395513956static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,13957const float *__b) {13958return vec_perm(vec_ldl(__a, __b), (vector float)(0), vec_lvsl(__a, __b));13959}1396013961static __inline__ vector float __ATTRS_o_ai vec_lvlxl(int __a,13962vector float *__b) {13963return vec_perm(vec_ldl(__a, __b), (vector float)(0),13964vec_lvsl(__a, (unsigned char *)__b));13965}1396613967/* vec_lvrx */1396813969static __inline__ vector signed char __ATTRS_o_ai13970vec_lvrx(int __a, const signed char *__b) {13971return vec_perm((vector signed char)(0), vec_ld(__a, __b),13972vec_lvsl(__a, __b));13973}1397413975static __inline__ vector signed char __ATTRS_o_ai13976vec_lvrx(int __a, const vector signed char *__b) {13977return vec_perm((vector signed char)(0), vec_ld(__a, __b),13978vec_lvsl(__a, (unsigned char *)__b));13979}1398013981static __inline__ vector unsigned char __ATTRS_o_ai13982vec_lvrx(int __a, const unsigned char *__b) {13983return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),13984vec_lvsl(__a, __b));13985}1398613987static __inline__ vector unsigned char __ATTRS_o_ai13988vec_lvrx(int __a, const vector unsigned char *__b) {13989return vec_perm((vector unsigned char)(0), vec_ld(__a, __b),13990vec_lvsl(__a, (unsigned char *)__b));13991}1399213993static __inline__ vector bool char __ATTRS_o_ai13994vec_lvrx(int __a, const vector bool char *__b) {13995return vec_perm((vector bool char)(0), vec_ld(__a, __b),13996vec_lvsl(__a, (unsigned char *)__b));13997}1399813999static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,14000const short *__b) {14001return vec_perm((vector short)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));14002}1400314004static __inline__ vector short __ATTRS_o_ai vec_lvrx(int __a,14005const vector short *__b) {14006return vec_perm((vector short)(0), vec_ld(__a, __b),14007vec_lvsl(__a, (unsigned char *)__b));14008}1400914010static __inline__ vector unsigned short __ATTRS_o_ai14011vec_lvrx(int __a, const unsigned short *__b) {14012return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),14013vec_lvsl(__a, __b));14014}1401514016static __inline__ vector unsigned short __ATTRS_o_ai14017vec_lvrx(int __a, const vector unsigned short *__b) {14018return vec_perm((vector unsigned short)(0), vec_ld(__a, __b),14019vec_lvsl(__a, (unsigned char *)__b));14020}1402114022static __inline__ vector bool short __ATTRS_o_ai14023vec_lvrx(int __a, const vector bool short *__b) {14024return vec_perm((vector bool short)(0), vec_ld(__a, __b),14025vec_lvsl(__a, (unsigned char *)__b));14026}1402714028static __inline__ vector pixel __ATTRS_o_ai vec_lvrx(int __a,14029const vector pixel *__b) {14030return vec_perm((vector pixel)(0), vec_ld(__a, __b),14031vec_lvsl(__a, (unsigned char *)__b));14032}1403314034static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a, const int *__b) {14035return vec_perm((vector int)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));14036}1403714038static __inline__ vector int __ATTRS_o_ai vec_lvrx(int __a,14039const vector int *__b) {14040return vec_perm((vector int)(0), vec_ld(__a, __b),14041vec_lvsl(__a, (unsigned char *)__b));14042}1404314044static __inline__ vector unsigned int __ATTRS_o_ai14045vec_lvrx(int __a, const unsigned int *__b) {14046return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),14047vec_lvsl(__a, __b));14048}1404914050static __inline__ vector unsigned int __ATTRS_o_ai14051vec_lvrx(int __a, const vector unsigned int *__b) {14052return vec_perm((vector unsigned int)(0), vec_ld(__a, __b),14053vec_lvsl(__a, (unsigned char *)__b));14054}1405514056static __inline__ vector bool int __ATTRS_o_ai14057vec_lvrx(int __a, const vector bool int *__b) {14058return vec_perm((vector bool int)(0), vec_ld(__a, __b),14059vec_lvsl(__a, (unsigned char *)__b));14060}1406114062static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,14063const float *__b) {14064return vec_perm((vector float)(0), vec_ld(__a, __b), vec_lvsl(__a, __b));14065}1406614067static __inline__ vector float __ATTRS_o_ai vec_lvrx(int __a,14068const vector float *__b) {14069return vec_perm((vector float)(0), vec_ld(__a, __b),14070vec_lvsl(__a, (unsigned char *)__b));14071}1407214073/* vec_lvrxl */1407414075static __inline__ vector signed char __ATTRS_o_ai14076vec_lvrxl(int __a, const signed char *__b) {14077return vec_perm((vector signed char)(0), vec_ldl(__a, __b),14078vec_lvsl(__a, __b));14079}1408014081static __inline__ vector signed char __ATTRS_o_ai14082vec_lvrxl(int __a, const vector signed char *__b) {14083return vec_perm((vector signed char)(0), vec_ldl(__a, __b),14084vec_lvsl(__a, (unsigned char *)__b));14085}1408614087static __inline__ vector unsigned char __ATTRS_o_ai14088vec_lvrxl(int __a, const unsigned char *__b) {14089return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),14090vec_lvsl(__a, __b));14091}1409214093static __inline__ vector unsigned char __ATTRS_o_ai14094vec_lvrxl(int __a, const vector unsigned char *__b) {14095return vec_perm((vector unsigned char)(0), vec_ldl(__a, __b),14096vec_lvsl(__a, (unsigned char *)__b));14097}1409814099static __inline__ vector bool char __ATTRS_o_ai14100vec_lvrxl(int __a, const vector bool char *__b) {14101return vec_perm((vector bool char)(0), vec_ldl(__a, __b),14102vec_lvsl(__a, (unsigned char *)__b));14103}1410414105static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,14106const short *__b) {14107return vec_perm((vector short)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));14108}1410914110static __inline__ vector short __ATTRS_o_ai vec_lvrxl(int __a,14111const vector short *__b) {14112return vec_perm((vector short)(0), vec_ldl(__a, __b),14113vec_lvsl(__a, (unsigned char *)__b));14114}1411514116static __inline__ vector unsigned short __ATTRS_o_ai14117vec_lvrxl(int __a, const unsigned short *__b) {14118return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),14119vec_lvsl(__a, __b));14120}1412114122static __inline__ vector unsigned short __ATTRS_o_ai14123vec_lvrxl(int __a, const vector unsigned short *__b) {14124return vec_perm((vector unsigned short)(0), vec_ldl(__a, __b),14125vec_lvsl(__a, (unsigned char *)__b));14126}1412714128static __inline__ vector bool short __ATTRS_o_ai14129vec_lvrxl(int __a, const vector bool short *__b) {14130return vec_perm((vector bool short)(0), vec_ldl(__a, __b),14131vec_lvsl(__a, (unsigned char *)__b));14132}1413314134static __inline__ vector pixel __ATTRS_o_ai vec_lvrxl(int __a,14135const vector pixel *__b) {14136return vec_perm((vector pixel)(0), vec_ldl(__a, __b),14137vec_lvsl(__a, (unsigned char *)__b));14138}1413914140static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a, const int *__b) {14141return vec_perm((vector int)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));14142}1414314144static __inline__ vector int __ATTRS_o_ai vec_lvrxl(int __a,14145const vector int *__b) {14146return vec_perm((vector int)(0), vec_ldl(__a, __b),14147vec_lvsl(__a, (unsigned char *)__b));14148}1414914150static __inline__ vector unsigned int __ATTRS_o_ai14151vec_lvrxl(int __a, const unsigned int *__b) {14152return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),14153vec_lvsl(__a, __b));14154}1415514156static __inline__ vector unsigned int __ATTRS_o_ai14157vec_lvrxl(int __a, const vector unsigned int *__b) {14158return vec_perm((vector unsigned int)(0), vec_ldl(__a, __b),14159vec_lvsl(__a, (unsigned char *)__b));14160}1416114162static __inline__ vector bool int __ATTRS_o_ai14163vec_lvrxl(int __a, const vector bool int *__b) {14164return vec_perm((vector bool int)(0), vec_ldl(__a, __b),14165vec_lvsl(__a, (unsigned char *)__b));14166}1416714168static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,14169const float *__b) {14170return vec_perm((vector float)(0), vec_ldl(__a, __b), vec_lvsl(__a, __b));14171}1417214173static __inline__ vector float __ATTRS_o_ai vec_lvrxl(int __a,14174const vector float *__b) {14175return vec_perm((vector float)(0), vec_ldl(__a, __b),14176vec_lvsl(__a, (unsigned char *)__b));14177}1417814179/* vec_stvlx */1418014181static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,14182signed char *__c) {14183return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14184__c);14185}1418614187static __inline__ void __ATTRS_o_ai vec_stvlx(vector signed char __a, int __b,14188vector signed char *__c) {14189return vec_st(14190vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14191__b, __c);14192}1419314194static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,14195unsigned char *__c) {14196return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14197__c);14198}1419914200static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned char __a, int __b,14201vector unsigned char *__c) {14202return vec_st(14203vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14204__b, __c);14205}1420614207static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool char __a, int __b,14208vector bool char *__c) {14209return vec_st(14210vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14211__b, __c);14212}1421314214static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,14215short *__c) {14216return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14217__c);14218}1421914220static __inline__ void __ATTRS_o_ai vec_stvlx(vector short __a, int __b,14221vector short *__c) {14222return vec_st(14223vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14224__b, __c);14225}1422614227static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,14228int __b, unsigned short *__c) {14229return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14230__c);14231}1423214233static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned short __a,14234int __b,14235vector unsigned short *__c) {14236return vec_st(14237vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14238__b, __c);14239}1424014241static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool short __a, int __b,14242vector bool short *__c) {14243return vec_st(14244vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14245__b, __c);14246}1424714248static __inline__ void __ATTRS_o_ai vec_stvlx(vector pixel __a, int __b,14249vector pixel *__c) {14250return vec_st(14251vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14252__b, __c);14253}1425414255static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,14256int *__c) {14257return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14258__c);14259}1426014261static __inline__ void __ATTRS_o_ai vec_stvlx(vector int __a, int __b,14262vector int *__c) {14263return vec_st(14264vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14265__b, __c);14266}1426714268static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,14269unsigned int *__c) {14270return vec_st(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14271__c);14272}1427314274static __inline__ void __ATTRS_o_ai vec_stvlx(vector unsigned int __a, int __b,14275vector unsigned int *__c) {14276return vec_st(14277vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14278__b, __c);14279}1428014281static __inline__ void __ATTRS_o_ai vec_stvlx(vector bool int __a, int __b,14282vector bool int *__c) {14283return vec_st(14284vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14285__b, __c);14286}1428714288static __inline__ void __ATTRS_o_ai vec_stvlx(vector float __a, int __b,14289vector float *__c) {14290return vec_st(14291vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14292__b, __c);14293}1429414295/* vec_stvlxl */1429614297static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,14298signed char *__c) {14299return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14300__c);14301}1430214303static __inline__ void __ATTRS_o_ai vec_stvlxl(vector signed char __a, int __b,14304vector signed char *__c) {14305return vec_stl(14306vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14307__b, __c);14308}1430914310static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,14311int __b, unsigned char *__c) {14312return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14313__c);14314}1431514316static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned char __a,14317int __b,14318vector unsigned char *__c) {14319return vec_stl(14320vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14321__b, __c);14322}1432314324static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool char __a, int __b,14325vector bool char *__c) {14326return vec_stl(14327vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14328__b, __c);14329}1433014331static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,14332short *__c) {14333return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14334__c);14335}1433614337static __inline__ void __ATTRS_o_ai vec_stvlxl(vector short __a, int __b,14338vector short *__c) {14339return vec_stl(14340vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14341__b, __c);14342}1434314344static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,14345int __b, unsigned short *__c) {14346return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14347__c);14348}1434914350static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned short __a,14351int __b,14352vector unsigned short *__c) {14353return vec_stl(14354vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14355__b, __c);14356}1435714358static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool short __a, int __b,14359vector bool short *__c) {14360return vec_stl(14361vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14362__b, __c);14363}1436414365static __inline__ void __ATTRS_o_ai vec_stvlxl(vector pixel __a, int __b,14366vector pixel *__c) {14367return vec_stl(14368vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14369__b, __c);14370}1437114372static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,14373int *__c) {14374return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14375__c);14376}1437714378static __inline__ void __ATTRS_o_ai vec_stvlxl(vector int __a, int __b,14379vector int *__c) {14380return vec_stl(14381vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14382__b, __c);14383}1438414385static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,14386unsigned int *__c) {14387return vec_stl(vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, __c)), __b,14388__c);14389}1439014391static __inline__ void __ATTRS_o_ai vec_stvlxl(vector unsigned int __a, int __b,14392vector unsigned int *__c) {14393return vec_stl(14394vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14395__b, __c);14396}1439714398static __inline__ void __ATTRS_o_ai vec_stvlxl(vector bool int __a, int __b,14399vector bool int *__c) {14400return vec_stl(14401vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14402__b, __c);14403}1440414405static __inline__ void __ATTRS_o_ai vec_stvlxl(vector float __a, int __b,14406vector float *__c) {14407return vec_stl(14408vec_perm(vec_lvrx(__b, __c), __a, vec_lvsr(__b, (unsigned char *)__c)),14409__b, __c);14410}1441114412/* vec_stvrx */1441314414static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,14415signed char *__c) {14416return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14417__c);14418}1441914420static __inline__ void __ATTRS_o_ai vec_stvrx(vector signed char __a, int __b,14421vector signed char *__c) {14422return vec_st(14423vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14424__b, __c);14425}1442614427static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,14428unsigned char *__c) {14429return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14430__c);14431}1443214433static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned char __a, int __b,14434vector unsigned char *__c) {14435return vec_st(14436vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14437__b, __c);14438}1443914440static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool char __a, int __b,14441vector bool char *__c) {14442return vec_st(14443vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14444__b, __c);14445}1444614447static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,14448short *__c) {14449return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14450__c);14451}1445214453static __inline__ void __ATTRS_o_ai vec_stvrx(vector short __a, int __b,14454vector short *__c) {14455return vec_st(14456vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14457__b, __c);14458}1445914460static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,14461int __b, unsigned short *__c) {14462return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14463__c);14464}1446514466static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned short __a,14467int __b,14468vector unsigned short *__c) {14469return vec_st(14470vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14471__b, __c);14472}1447314474static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool short __a, int __b,14475vector bool short *__c) {14476return vec_st(14477vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14478__b, __c);14479}1448014481static __inline__ void __ATTRS_o_ai vec_stvrx(vector pixel __a, int __b,14482vector pixel *__c) {14483return vec_st(14484vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14485__b, __c);14486}1448714488static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,14489int *__c) {14490return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14491__c);14492}1449314494static __inline__ void __ATTRS_o_ai vec_stvrx(vector int __a, int __b,14495vector int *__c) {14496return vec_st(14497vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14498__b, __c);14499}1450014501static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,14502unsigned int *__c) {14503return vec_st(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14504__c);14505}1450614507static __inline__ void __ATTRS_o_ai vec_stvrx(vector unsigned int __a, int __b,14508vector unsigned int *__c) {14509return vec_st(14510vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14511__b, __c);14512}1451314514static __inline__ void __ATTRS_o_ai vec_stvrx(vector bool int __a, int __b,14515vector bool int *__c) {14516return vec_st(14517vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14518__b, __c);14519}1452014521static __inline__ void __ATTRS_o_ai vec_stvrx(vector float __a, int __b,14522vector float *__c) {14523return vec_st(14524vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14525__b, __c);14526}1452714528/* vec_stvrxl */1452914530static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,14531signed char *__c) {14532return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14533__c);14534}1453514536static __inline__ void __ATTRS_o_ai vec_stvrxl(vector signed char __a, int __b,14537vector signed char *__c) {14538return vec_stl(14539vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14540__b, __c);14541}1454214543static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,14544int __b, unsigned char *__c) {14545return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14546__c);14547}1454814549static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned char __a,14550int __b,14551vector unsigned char *__c) {14552return vec_stl(14553vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14554__b, __c);14555}1455614557static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool char __a, int __b,14558vector bool char *__c) {14559return vec_stl(14560vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14561__b, __c);14562}1456314564static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,14565short *__c) {14566return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14567__c);14568}1456914570static __inline__ void __ATTRS_o_ai vec_stvrxl(vector short __a, int __b,14571vector short *__c) {14572return vec_stl(14573vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14574__b, __c);14575}1457614577static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,14578int __b, unsigned short *__c) {14579return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14580__c);14581}1458214583static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned short __a,14584int __b,14585vector unsigned short *__c) {14586return vec_stl(14587vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14588__b, __c);14589}1459014591static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool short __a, int __b,14592vector bool short *__c) {14593return vec_stl(14594vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14595__b, __c);14596}1459714598static __inline__ void __ATTRS_o_ai vec_stvrxl(vector pixel __a, int __b,14599vector pixel *__c) {14600return vec_stl(14601vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14602__b, __c);14603}1460414605static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,14606int *__c) {14607return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14608__c);14609}1461014611static __inline__ void __ATTRS_o_ai vec_stvrxl(vector int __a, int __b,14612vector int *__c) {14613return vec_stl(14614vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14615__b, __c);14616}1461714618static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,14619unsigned int *__c) {14620return vec_stl(vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, __c)), __b,14621__c);14622}1462314624static __inline__ void __ATTRS_o_ai vec_stvrxl(vector unsigned int __a, int __b,14625vector unsigned int *__c) {14626return vec_stl(14627vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14628__b, __c);14629}1463014631static __inline__ void __ATTRS_o_ai vec_stvrxl(vector bool int __a, int __b,14632vector bool int *__c) {14633return vec_stl(14634vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14635__b, __c);14636}1463714638static __inline__ void __ATTRS_o_ai vec_stvrxl(vector float __a, int __b,14639vector float *__c) {14640return vec_stl(14641vec_perm(__a, vec_lvlx(__b, __c), vec_lvsr(__b, (unsigned char *)__c)),14642__b, __c);14643}1464414645/* vec_promote */1464614647static __inline__ vector signed char __ATTRS_o_ai vec_promote(signed char __a,14648int __b) {14649const vector signed char __zero = (vector signed char)0;14650vector signed char __res =14651__builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1,14652-1, -1, -1, -1, -1, -1, -1, -1);14653__res[__b & 0xf] = __a;14654return __res;14655}1465614657static __inline__ vector unsigned char __ATTRS_o_ai14658vec_promote(unsigned char __a, int __b) {14659const vector unsigned char __zero = (vector unsigned char)(0);14660vector unsigned char __res =14661__builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1,14662-1, -1, -1, -1, -1, -1, -1, -1);14663__res[__b & 0xf] = __a;14664return __res;14665}1466614667static __inline__ vector short __ATTRS_o_ai vec_promote(short __a, int __b) {14668const vector short __zero = (vector short)(0);14669vector short __res =14670__builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1);14671__res[__b & 0x7] = __a;14672return __res;14673}1467414675static __inline__ vector unsigned short __ATTRS_o_ai14676vec_promote(unsigned short __a, int __b) {14677const vector unsigned short __zero = (vector unsigned short)(0);14678vector unsigned short __res =14679__builtin_shufflevector(__zero, __zero, -1, -1, -1, -1, -1, -1, -1, -1);14680__res[__b & 0x7] = __a;14681return __res;14682}1468314684static __inline__ vector int __ATTRS_o_ai vec_promote(int __a, int __b) {14685const vector int __zero = (vector int)(0);14686vector int __res = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);14687__res[__b & 0x3] = __a;14688return __res;14689}1469014691static __inline__ vector unsigned int __ATTRS_o_ai vec_promote(unsigned int __a,14692int __b) {14693const vector unsigned int __zero = (vector unsigned int)(0);14694vector unsigned int __res =14695__builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);14696__res[__b & 0x3] = __a;14697return __res;14698}1469914700static __inline__ vector float __ATTRS_o_ai vec_promote(float __a, int __b) {14701const vector float __zero = (vector float)(0);14702vector float __res = __builtin_shufflevector(__zero, __zero, -1, -1, -1, -1);14703__res[__b & 0x3] = __a;14704return __res;14705}1470614707#ifdef __VSX__14708static __inline__ vector double __ATTRS_o_ai vec_promote(double __a, int __b) {14709const vector double __zero = (vector double)(0);14710vector double __res = __builtin_shufflevector(__zero, __zero, -1, -1);14711__res[__b & 0x1] = __a;14712return __res;14713}1471414715static __inline__ vector signed long long __ATTRS_o_ai14716vec_promote(signed long long __a, int __b) {14717const vector signed long long __zero = (vector signed long long)(0);14718vector signed long long __res =14719__builtin_shufflevector(__zero, __zero, -1, -1);14720__res[__b & 0x1] = __a;14721return __res;14722}1472314724static __inline__ vector unsigned long long __ATTRS_o_ai14725vec_promote(unsigned long long __a, int __b) {14726const vector unsigned long long __zero = (vector unsigned long long)(0);14727vector unsigned long long __res =14728__builtin_shufflevector(__zero, __zero, -1, -1);14729__res[__b & 0x1] = __a;14730return __res;14731}14732#endif1473314734/* vec_splats */1473514736static __inline__ vector signed char __ATTRS_o_ai vec_splats(signed char __a) {14737return (vector signed char)(__a);14738}1473914740static __inline__ vector unsigned char __ATTRS_o_ai14741vec_splats(unsigned char __a) {14742return (vector unsigned char)(__a);14743}1474414745static __inline__ vector short __ATTRS_o_ai vec_splats(short __a) {14746return (vector short)(__a);14747}1474814749static __inline__ vector unsigned short __ATTRS_o_ai14750vec_splats(unsigned short __a) {14751return (vector unsigned short)(__a);14752}1475314754static __inline__ vector int __ATTRS_o_ai vec_splats(int __a) {14755return (vector int)(__a);14756}1475714758static __inline__ vector unsigned int __ATTRS_o_ai14759vec_splats(unsigned int __a) {14760return (vector unsigned int)(__a);14761}1476214763#ifdef __VSX__14764static __inline__ vector signed long long __ATTRS_o_ai14765vec_splats(signed long long __a) {14766return (vector signed long long)(__a);14767}1476814769static __inline__ vector unsigned long long __ATTRS_o_ai14770vec_splats(unsigned long long __a) {14771return (vector unsigned long long)(__a);14772}1477314774#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \14775defined(__SIZEOF_INT128__)14776static __inline__ vector signed __int128 __ATTRS_o_ai14777vec_splats(signed __int128 __a) {14778return (vector signed __int128)(__a);14779}1478014781static __inline__ vector unsigned __int128 __ATTRS_o_ai14782vec_splats(unsigned __int128 __a) {14783return (vector unsigned __int128)(__a);14784}1478514786#endif1478714788static __inline__ vector double __ATTRS_o_ai vec_splats(double __a) {14789return (vector double)(__a);14790}14791#endif1479214793static __inline__ vector float __ATTRS_o_ai vec_splats(float __a) {14794return (vector float)(__a);14795}1479614797/* ----------------------------- predicates --------------------------------- */1479814799/* vec_all_eq */1480014801static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,14802vector signed char __b) {14803return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14804(vector char)__b);14805}1480614807static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed char __a,14808vector bool char __b) {14809return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14810(vector char)__b);14811}1481214813static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,14814vector unsigned char __b) {14815return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14816(vector char)__b);14817}1481814819static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned char __a,14820vector bool char __b) {14821return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14822(vector char)__b);14823}1482414825static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,14826vector signed char __b) {14827return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14828(vector char)__b);14829}1483014831static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,14832vector unsigned char __b) {14833return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14834(vector char)__b);14835}1483614837static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool char __a,14838vector bool char __b) {14839return __builtin_altivec_vcmpequb_p(__CR6_LT, (vector char)__a,14840(vector char)__b);14841}1484214843static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,14844vector short __b) {14845return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, __b);14846}1484714848static __inline__ int __ATTRS_o_ai vec_all_eq(vector short __a,14849vector bool short __b) {14850return __builtin_altivec_vcmpequh_p(__CR6_LT, __a, (vector short)__b);14851}1485214853static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,14854vector unsigned short __b) {14855return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14856(vector short)__b);14857}1485814859static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned short __a,14860vector bool short __b) {14861return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14862(vector short)__b);14863}1486414865static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,14866vector short __b) {14867return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14868(vector short)__b);14869}1487014871static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,14872vector unsigned short __b) {14873return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14874(vector short)__b);14875}1487614877static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool short __a,14878vector bool short __b) {14879return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14880(vector short)__b);14881}1488214883static __inline__ int __ATTRS_o_ai vec_all_eq(vector pixel __a,14884vector pixel __b) {14885return __builtin_altivec_vcmpequh_p(__CR6_LT, (vector short)__a,14886(vector short)__b);14887}1488814889static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a, vector int __b) {14890return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, __b);14891}1489214893static __inline__ int __ATTRS_o_ai vec_all_eq(vector int __a,14894vector bool int __b) {14895return __builtin_altivec_vcmpequw_p(__CR6_LT, __a, (vector int)__b);14896}1489714898static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,14899vector unsigned int __b) {14900return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,14901(vector int)__b);14902}1490314904static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned int __a,14905vector bool int __b) {14906return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,14907(vector int)__b);14908}1490914910static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,14911vector int __b) {14912return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,14913(vector int)__b);14914}1491514916static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,14917vector unsigned int __b) {14918return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,14919(vector int)__b);14920}1492114922static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool int __a,14923vector bool int __b) {14924return __builtin_altivec_vcmpequw_p(__CR6_LT, (vector int)__a,14925(vector int)__b);14926}1492714928#ifdef __VSX__14929static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed long long __a,14930vector signed long long __b) {14931#ifdef __POWER8_VECTOR__14932return __builtin_altivec_vcmpequd_p(__CR6_LT, __a, __b);14933#else14934// No vcmpequd on Power7 so we xor the two vectors and compare against zero as14935// 32-bit elements.14936return vec_all_eq((vector signed int)vec_xor(__a, __b), (vector signed int)0);14937#endif14938}1493914940static __inline__ int __ATTRS_o_ai vec_all_eq(vector long long __a,14941vector bool long long __b) {14942return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14943}1494414945static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,14946vector unsigned long long __b) {14947return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14948}1494914950static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned long long __a,14951vector bool long long __b) {14952return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14953}1495414955static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,14956vector long long __b) {14957return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14958}1495914960static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,14961vector unsigned long long __b) {14962return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14963}1496414965static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool long long __a,14966vector bool long long __b) {14967return vec_all_eq((vector signed long long)__a, (vector signed long long)__b);14968}14969#endif1497014971static __inline__ int __ATTRS_o_ai vec_all_eq(vector float __a,14972vector float __b) {14973#ifdef __VSX__14974return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __b);14975#else14976return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __b);14977#endif14978}1497914980#ifdef __VSX__14981static __inline__ int __ATTRS_o_ai vec_all_eq(vector double __a,14982vector double __b) {14983return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __b);14984}14985#endif1498614987#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)14988static __inline__ int __ATTRS_o_ai vec_all_eq(vector signed __int128 __a,14989vector signed __int128 __b) {14990return __builtin_altivec_vcmpequq_p(__CR6_LT, (vector unsigned __int128)__a,14991(vector signed __int128)__b);14992}1499314994static __inline__ int __ATTRS_o_ai vec_all_eq(vector unsigned __int128 __a,14995vector unsigned __int128 __b) {14996return __builtin_altivec_vcmpequq_p(__CR6_LT, __a,14997(vector signed __int128)__b);14998}1499915000static __inline__ int __ATTRS_o_ai vec_all_eq(vector bool __int128 __a,15001vector bool __int128 __b) {15002return __builtin_altivec_vcmpequq_p(__CR6_LT, (vector unsigned __int128)__a,15003(vector signed __int128)__b);15004}15005#endif1500615007/* vec_all_ge */1500815009static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,15010vector signed char __b) {15011return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, __a);15012}1501315014static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed char __a,15015vector bool char __b) {15016return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__b, __a);15017}1501815019static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,15020vector unsigned char __b) {15021return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, __a);15022}1502315024static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned char __a,15025vector bool char __b) {15026return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b, __a);15027}1502815029static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,15030vector signed char __b) {15031return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __b, (vector signed char)__a);15032}1503315034static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,15035vector unsigned char __b) {15036return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __b, (vector unsigned char)__a);15037}1503815039static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool char __a,15040vector bool char __b) {15041return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__b,15042(vector unsigned char)__a);15043}1504415045static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,15046vector short __b) {15047return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, __a);15048}1504915050static __inline__ int __ATTRS_o_ai vec_all_ge(vector short __a,15051vector bool short __b) {15052return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector short)__b, __a);15053}1505415055static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,15056vector unsigned short __b) {15057return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b, __a);15058}1505915060static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned short __a,15061vector bool short __b) {15062return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,15063__a);15064}1506515066static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,15067vector short __b) {15068return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __b, (vector signed short)__a);15069}1507015071static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,15072vector unsigned short __b) {15073return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __b,15074(vector unsigned short)__a);15075}1507615077static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool short __a,15078vector bool short __b) {15079return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__b,15080(vector unsigned short)__a);15081}1508215083static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a, vector int __b) {15084return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, __a);15085}1508615087static __inline__ int __ATTRS_o_ai vec_all_ge(vector int __a,15088vector bool int __b) {15089return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector int)__b, __a);15090}1509115092static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,15093vector unsigned int __b) {15094return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, __a);15095}1509615097static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned int __a,15098vector bool int __b) {15099return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b, __a);15100}1510115102static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,15103vector int __b) {15104return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __b, (vector signed int)__a);15105}1510615107static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,15108vector unsigned int __b) {15109return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __b, (vector unsigned int)__a);15110}1511115112static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool int __a,15113vector bool int __b) {15114return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__b,15115(vector unsigned int)__a);15116}1511715118#ifdef __VSX__15119static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,15120vector signed long long __b) {15121return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b, __a);15122}15123static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed long long __a,15124vector bool long long __b) {15125return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__b,15126__a);15127}1512815129static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,15130vector unsigned long long __b) {15131return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b, __a);15132}1513315134static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned long long __a,15135vector bool long long __b) {15136return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,15137__a);15138}1513915140static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,15141vector signed long long __b) {15142return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __b,15143(vector signed long long)__a);15144}1514515146static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,15147vector unsigned long long __b) {15148return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __b,15149(vector unsigned long long)__a);15150}1515115152static __inline__ int __ATTRS_o_ai vec_all_ge(vector bool long long __a,15153vector bool long long __b) {15154return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__b,15155(vector unsigned long long)__a);15156}15157#endif1515815159static __inline__ int __ATTRS_o_ai vec_all_ge(vector float __a,15160vector float __b) {15161#ifdef __VSX__15162return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __a, __b);15163#else15164return __builtin_altivec_vcmpgefp_p(__CR6_LT, __a, __b);15165#endif15166}1516715168#ifdef __VSX__15169static __inline__ int __ATTRS_o_ai vec_all_ge(vector double __a,15170vector double __b) {15171return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __a, __b);15172}15173#endif1517415175#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)15176static __inline__ int __ATTRS_o_ai vec_all_ge(vector signed __int128 __a,15177vector signed __int128 __b) {15178return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __b, __a);15179}1518015181static __inline__ int __ATTRS_o_ai vec_all_ge(vector unsigned __int128 __a,15182vector unsigned __int128 __b) {15183return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __b, __a);15184}15185#endif1518615187/* vec_all_gt */1518815189static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,15190vector signed char __b) {15191return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, __b);15192}1519315194static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed char __a,15195vector bool char __b) {15196return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __a, (vector signed char)__b);15197}1519815199static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,15200vector unsigned char __b) {15201return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, __b);15202}1520315204static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned char __a,15205vector bool char __b) {15206return __builtin_altivec_vcmpgtub_p(__CR6_LT, __a, (vector unsigned char)__b);15207}1520815209static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,15210vector signed char __b) {15211return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__a, __b);15212}1521315214static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,15215vector unsigned char __b) {15216return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a, __b);15217}1521815219static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool char __a,15220vector bool char __b) {15221return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__a,15222(vector unsigned char)__b);15223}1522415225static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,15226vector short __b) {15227return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, __b);15228}1522915230static __inline__ int __ATTRS_o_ai vec_all_gt(vector short __a,15231vector bool short __b) {15232return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __a, (vector short)__b);15233}1523415235static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,15236vector unsigned short __b) {15237return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a, __b);15238}1523915240static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned short __a,15241vector bool short __b) {15242return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __a,15243(vector unsigned short)__b);15244}1524515246static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,15247vector short __b) {15248return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector signed short)__a, __b);15249}1525015251static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,15252vector unsigned short __b) {15253return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,15254__b);15255}1525615257static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool short __a,15258vector bool short __b) {15259return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__a,15260(vector unsigned short)__b);15261}1526215263static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a, vector int __b) {15264return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, __b);15265}1526615267static __inline__ int __ATTRS_o_ai vec_all_gt(vector int __a,15268vector bool int __b) {15269return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __a, (vector int)__b);15270}1527115272static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,15273vector unsigned int __b) {15274return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, __b);15275}1527615277static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned int __a,15278vector bool int __b) {15279return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __a, (vector unsigned int)__b);15280}1528115282static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,15283vector int __b) {15284return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector signed int)__a, __b);15285}1528615287static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,15288vector unsigned int __b) {15289return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a, __b);15290}1529115292static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool int __a,15293vector bool int __b) {15294return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__a,15295(vector unsigned int)__b);15296}1529715298#ifdef __VSX__15299static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,15300vector signed long long __b) {15301return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a, __b);15302}15303static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed long long __a,15304vector bool long long __b) {15305return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __a,15306(vector signed long long)__b);15307}1530815309static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,15310vector unsigned long long __b) {15311return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a, __b);15312}1531315314static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned long long __a,15315vector bool long long __b) {15316return __builtin_altivec_vcmpgtud_p(__CR6_LT, __a,15317(vector unsigned long long)__b);15318}1531915320static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,15321vector signed long long __b) {15322return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__a,15323__b);15324}1532515326static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,15327vector unsigned long long __b) {15328return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,15329__b);15330}1533115332static __inline__ int __ATTRS_o_ai vec_all_gt(vector bool long long __a,15333vector bool long long __b) {15334return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__a,15335(vector unsigned long long)__b);15336}15337#endif1533815339static __inline__ int __ATTRS_o_ai vec_all_gt(vector float __a,15340vector float __b) {15341#ifdef __VSX__15342return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __a, __b);15343#else15344return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __a, __b);15345#endif15346}1534715348#ifdef __VSX__15349static __inline__ int __ATTRS_o_ai vec_all_gt(vector double __a,15350vector double __b) {15351return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __a, __b);15352}15353#endif1535415355#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)15356static __inline__ int __ATTRS_o_ai vec_all_gt(vector signed __int128 __a,15357vector signed __int128 __b) {15358return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __a, __b);15359}1536015361static __inline__ int __ATTRS_o_ai vec_all_gt(vector unsigned __int128 __a,15362vector unsigned __int128 __b) {15363return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __a, __b);15364}15365#endif1536615367/* vec_all_in */1536815369static __inline__ int __attribute__((__always_inline__))15370vec_all_in(vector float __a, vector float __b) {15371return __builtin_altivec_vcmpbfp_p(__CR6_EQ, __a, __b);15372}1537315374/* vec_all_le */1537515376static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,15377vector signed char __b) {15378return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, __b);15379}1538015381static __inline__ int __ATTRS_o_ai vec_all_le(vector signed char __a,15382vector bool char __b) {15383return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, __a, (vector signed char)__b);15384}1538515386static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,15387vector unsigned char __b) {15388return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, __b);15389}1539015391static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned char __a,15392vector bool char __b) {15393return __builtin_altivec_vcmpgtub_p(__CR6_EQ, __a, (vector unsigned char)__b);15394}1539515396static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,15397vector signed char __b) {15398return __builtin_altivec_vcmpgtsb_p(__CR6_EQ, (vector signed char)__a, __b);15399}1540015401static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,15402vector unsigned char __b) {15403return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a, __b);15404}1540515406static __inline__ int __ATTRS_o_ai vec_all_le(vector bool char __a,15407vector bool char __b) {15408return __builtin_altivec_vcmpgtub_p(__CR6_EQ, (vector unsigned char)__a,15409(vector unsigned char)__b);15410}1541115412static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,15413vector short __b) {15414return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, __b);15415}1541615417static __inline__ int __ATTRS_o_ai vec_all_le(vector short __a,15418vector bool short __b) {15419return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, __a, (vector short)__b);15420}1542115422static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,15423vector unsigned short __b) {15424return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a, __b);15425}1542615427static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned short __a,15428vector bool short __b) {15429return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, __a,15430(vector unsigned short)__b);15431}1543215433static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,15434vector short __b) {15435return __builtin_altivec_vcmpgtsh_p(__CR6_EQ, (vector signed short)__a, __b);15436}1543715438static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,15439vector unsigned short __b) {15440return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,15441__b);15442}1544315444static __inline__ int __ATTRS_o_ai vec_all_le(vector bool short __a,15445vector bool short __b) {15446return __builtin_altivec_vcmpgtuh_p(__CR6_EQ, (vector unsigned short)__a,15447(vector unsigned short)__b);15448}1544915450static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a, vector int __b) {15451return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, __b);15452}1545315454static __inline__ int __ATTRS_o_ai vec_all_le(vector int __a,15455vector bool int __b) {15456return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, __a, (vector int)__b);15457}1545815459static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,15460vector unsigned int __b) {15461return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, __b);15462}1546315464static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned int __a,15465vector bool int __b) {15466return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, __a, (vector unsigned int)__b);15467}1546815469static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,15470vector int __b) {15471return __builtin_altivec_vcmpgtsw_p(__CR6_EQ, (vector signed int)__a, __b);15472}1547315474static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,15475vector unsigned int __b) {15476return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a, __b);15477}1547815479static __inline__ int __ATTRS_o_ai vec_all_le(vector bool int __a,15480vector bool int __b) {15481return __builtin_altivec_vcmpgtuw_p(__CR6_EQ, (vector unsigned int)__a,15482(vector unsigned int)__b);15483}1548415485#ifdef __VSX__15486static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,15487vector signed long long __b) {15488return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a, __b);15489}1549015491static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,15492vector unsigned long long __b) {15493return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a, __b);15494}1549515496static __inline__ int __ATTRS_o_ai vec_all_le(vector signed long long __a,15497vector bool long long __b) {15498return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, __a,15499(vector signed long long)__b);15500}1550115502static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned long long __a,15503vector bool long long __b) {15504return __builtin_altivec_vcmpgtud_p(__CR6_EQ, __a,15505(vector unsigned long long)__b);15506}1550715508static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,15509vector signed long long __b) {15510return __builtin_altivec_vcmpgtsd_p(__CR6_EQ, (vector signed long long)__a,15511__b);15512}1551315514static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,15515vector unsigned long long __b) {15516return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,15517__b);15518}1551915520static __inline__ int __ATTRS_o_ai vec_all_le(vector bool long long __a,15521vector bool long long __b) {15522return __builtin_altivec_vcmpgtud_p(__CR6_EQ, (vector unsigned long long)__a,15523(vector unsigned long long)__b);15524}15525#endif1552615527static __inline__ int __ATTRS_o_ai vec_all_le(vector float __a,15528vector float __b) {15529#ifdef __VSX__15530return __builtin_vsx_xvcmpgesp_p(__CR6_LT, __b, __a);15531#else15532return __builtin_altivec_vcmpgefp_p(__CR6_LT, __b, __a);15533#endif15534}1553515536#ifdef __VSX__15537static __inline__ int __ATTRS_o_ai vec_all_le(vector double __a,15538vector double __b) {15539return __builtin_vsx_xvcmpgedp_p(__CR6_LT, __b, __a);15540}15541#endif1554215543#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)15544static __inline__ int __ATTRS_o_ai vec_all_le(vector signed __int128 __a,15545vector signed __int128 __b) {15546return __builtin_altivec_vcmpgtsq_p(__CR6_EQ, __a, __b);15547}1554815549static __inline__ int __ATTRS_o_ai vec_all_le(vector unsigned __int128 __a,15550vector unsigned __int128 __b) {15551return __builtin_altivec_vcmpgtuq_p(__CR6_EQ, __a, __b);15552}15553#endif1555415555/* vec_all_lt */1555615557static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,15558vector signed char __b) {15559return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, __a);15560}1556115562static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed char __a,15563vector bool char __b) {15564return __builtin_altivec_vcmpgtsb_p(__CR6_LT, (vector signed char)__b, __a);15565}1556615567static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,15568vector unsigned char __b) {15569return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, __a);15570}1557115572static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned char __a,15573vector bool char __b) {15574return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b, __a);15575}1557615577static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,15578vector signed char __b) {15579return __builtin_altivec_vcmpgtsb_p(__CR6_LT, __b, (vector signed char)__a);15580}1558115582static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,15583vector unsigned char __b) {15584return __builtin_altivec_vcmpgtub_p(__CR6_LT, __b, (vector unsigned char)__a);15585}1558615587static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool char __a,15588vector bool char __b) {15589return __builtin_altivec_vcmpgtub_p(__CR6_LT, (vector unsigned char)__b,15590(vector unsigned char)__a);15591}1559215593static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,15594vector short __b) {15595return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, __a);15596}1559715598static __inline__ int __ATTRS_o_ai vec_all_lt(vector short __a,15599vector bool short __b) {15600return __builtin_altivec_vcmpgtsh_p(__CR6_LT, (vector short)__b, __a);15601}1560215603static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,15604vector unsigned short __b) {15605return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b, __a);15606}1560715608static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned short __a,15609vector bool short __b) {15610return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,15611__a);15612}1561315614static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,15615vector short __b) {15616return __builtin_altivec_vcmpgtsh_p(__CR6_LT, __b, (vector signed short)__a);15617}1561815619static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,15620vector unsigned short __b) {15621return __builtin_altivec_vcmpgtuh_p(__CR6_LT, __b,15622(vector unsigned short)__a);15623}1562415625static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool short __a,15626vector bool short __b) {15627return __builtin_altivec_vcmpgtuh_p(__CR6_LT, (vector unsigned short)__b,15628(vector unsigned short)__a);15629}1563015631static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a, vector int __b) {15632return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, __a);15633}1563415635static __inline__ int __ATTRS_o_ai vec_all_lt(vector int __a,15636vector bool int __b) {15637return __builtin_altivec_vcmpgtsw_p(__CR6_LT, (vector int)__b, __a);15638}1563915640static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,15641vector unsigned int __b) {15642return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, __a);15643}1564415645static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned int __a,15646vector bool int __b) {15647return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b, __a);15648}1564915650static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,15651vector int __b) {15652return __builtin_altivec_vcmpgtsw_p(__CR6_LT, __b, (vector signed int)__a);15653}1565415655static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,15656vector unsigned int __b) {15657return __builtin_altivec_vcmpgtuw_p(__CR6_LT, __b, (vector unsigned int)__a);15658}1565915660static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool int __a,15661vector bool int __b) {15662return __builtin_altivec_vcmpgtuw_p(__CR6_LT, (vector unsigned int)__b,15663(vector unsigned int)__a);15664}1566515666#ifdef __VSX__15667static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,15668vector signed long long __b) {15669return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b, __a);15670}1567115672static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,15673vector unsigned long long __b) {15674return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b, __a);15675}1567615677static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed long long __a,15678vector bool long long __b) {15679return __builtin_altivec_vcmpgtsd_p(__CR6_LT, (vector signed long long)__b,15680__a);15681}1568215683static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned long long __a,15684vector bool long long __b) {15685return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,15686__a);15687}1568815689static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,15690vector signed long long __b) {15691return __builtin_altivec_vcmpgtsd_p(__CR6_LT, __b,15692(vector signed long long)__a);15693}1569415695static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,15696vector unsigned long long __b) {15697return __builtin_altivec_vcmpgtud_p(__CR6_LT, __b,15698(vector unsigned long long)__a);15699}1570015701static __inline__ int __ATTRS_o_ai vec_all_lt(vector bool long long __a,15702vector bool long long __b) {15703return __builtin_altivec_vcmpgtud_p(__CR6_LT, (vector unsigned long long)__b,15704(vector unsigned long long)__a);15705}15706#endif1570715708static __inline__ int __ATTRS_o_ai vec_all_lt(vector float __a,15709vector float __b) {15710#ifdef __VSX__15711return __builtin_vsx_xvcmpgtsp_p(__CR6_LT, __b, __a);15712#else15713return __builtin_altivec_vcmpgtfp_p(__CR6_LT, __b, __a);15714#endif15715}1571615717#ifdef __VSX__15718static __inline__ int __ATTRS_o_ai vec_all_lt(vector double __a,15719vector double __b) {15720return __builtin_vsx_xvcmpgtdp_p(__CR6_LT, __b, __a);15721}15722#endif1572315724#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)15725static __inline__ int __ATTRS_o_ai vec_all_lt(vector signed __int128 __a,15726vector signed __int128 __b) {15727return __builtin_altivec_vcmpgtsq_p(__CR6_LT, __b, __a);15728}1572915730static __inline__ int __ATTRS_o_ai vec_all_lt(vector unsigned __int128 __a,15731vector unsigned __int128 __b) {15732return __builtin_altivec_vcmpgtuq_p(__CR6_LT, __b, __a);15733}15734#endif1573515736/* vec_all_nan */1573715738static __inline__ int __ATTRS_o_ai vec_all_nan(vector float __a) {15739#ifdef __VSX__15740return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __a);15741#else15742return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __a);15743#endif15744}1574515746#ifdef __VSX__15747static __inline__ int __ATTRS_o_ai vec_all_nan(vector double __a) {15748return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __a);15749}15750#endif1575115752/* vec_all_ne */1575315754static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,15755vector signed char __b) {15756return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15757(vector char)__b);15758}1575915760static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed char __a,15761vector bool char __b) {15762return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15763(vector char)__b);15764}1576515766static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,15767vector unsigned char __b) {15768return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15769(vector char)__b);15770}1577115772static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned char __a,15773vector bool char __b) {15774return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15775(vector char)__b);15776}1577715778static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,15779vector signed char __b) {15780return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15781(vector char)__b);15782}1578315784static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,15785vector unsigned char __b) {15786return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15787(vector char)__b);15788}1578915790static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool char __a,15791vector bool char __b) {15792return __builtin_altivec_vcmpequb_p(__CR6_EQ, (vector char)__a,15793(vector char)__b);15794}1579515796static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,15797vector short __b) {15798return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, __b);15799}1580015801static __inline__ int __ATTRS_o_ai vec_all_ne(vector short __a,15802vector bool short __b) {15803return __builtin_altivec_vcmpequh_p(__CR6_EQ, __a, (vector short)__b);15804}1580515806static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,15807vector unsigned short __b) {15808return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15809(vector short)__b);15810}1581115812static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned short __a,15813vector bool short __b) {15814return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15815(vector short)__b);15816}1581715818static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,15819vector short __b) {15820return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15821(vector short)__b);15822}1582315824static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,15825vector unsigned short __b) {15826return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15827(vector short)__b);15828}1582915830static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool short __a,15831vector bool short __b) {15832return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15833(vector short)__b);15834}1583515836static __inline__ int __ATTRS_o_ai vec_all_ne(vector pixel __a,15837vector pixel __b) {15838return __builtin_altivec_vcmpequh_p(__CR6_EQ, (vector short)__a,15839(vector short)__b);15840}1584115842static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a, vector int __b) {15843return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, __b);15844}1584515846static __inline__ int __ATTRS_o_ai vec_all_ne(vector int __a,15847vector bool int __b) {15848return __builtin_altivec_vcmpequw_p(__CR6_EQ, __a, (vector int)__b);15849}1585015851static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,15852vector unsigned int __b) {15853return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,15854(vector int)__b);15855}1585615857static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned int __a,15858vector bool int __b) {15859return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,15860(vector int)__b);15861}1586215863static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,15864vector int __b) {15865return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,15866(vector int)__b);15867}1586815869static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,15870vector unsigned int __b) {15871return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,15872(vector int)__b);15873}1587415875static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool int __a,15876vector bool int __b) {15877return __builtin_altivec_vcmpequw_p(__CR6_EQ, (vector int)__a,15878(vector int)__b);15879}1588015881#ifdef __VSX__15882static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,15883vector signed long long __b) {15884return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a, __b);15885}1588615887static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,15888vector unsigned long long __b) {15889return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector long long)__a,15890(vector long long)__b);15891}1589215893static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed long long __a,15894vector bool long long __b) {15895return __builtin_altivec_vcmpequd_p(__CR6_EQ, __a,15896(vector signed long long)__b);15897}1589815899static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned long long __a,15900vector bool long long __b) {15901return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,15902(vector signed long long)__b);15903}1590415905static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,15906vector signed long long __b) {15907return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,15908(vector signed long long)__b);15909}1591015911static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,15912vector unsigned long long __b) {15913return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,15914(vector signed long long)__b);15915}1591615917static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool long long __a,15918vector bool long long __b) {15919return __builtin_altivec_vcmpequd_p(__CR6_EQ, (vector signed long long)__a,15920(vector signed long long)__b);15921}15922#endif1592315924static __inline__ int __ATTRS_o_ai vec_all_ne(vector float __a,15925vector float __b) {15926#ifdef __VSX__15927return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ, __a, __b);15928#else15929return __builtin_altivec_vcmpeqfp_p(__CR6_EQ, __a, __b);15930#endif15931}1593215933#ifdef __VSX__15934static __inline__ int __ATTRS_o_ai vec_all_ne(vector double __a,15935vector double __b) {15936return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ, __a, __b);15937}15938#endif1593915940#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)15941static __inline__ int __ATTRS_o_ai vec_all_ne(vector signed __int128 __a,15942vector signed __int128 __b) {15943return __builtin_altivec_vcmpequq_p(__CR6_EQ, (vector unsigned __int128)__a,15944__b);15945}1594615947static __inline__ int __ATTRS_o_ai vec_all_ne(vector unsigned __int128 __a,15948vector unsigned __int128 __b) {15949return __builtin_altivec_vcmpequq_p(__CR6_EQ, __a,15950(vector signed __int128)__b);15951}1595215953static __inline__ int __ATTRS_o_ai vec_all_ne(vector bool __int128 __a,15954vector bool __int128 __b) {15955return __builtin_altivec_vcmpequq_p(__CR6_EQ, (vector unsigned __int128)__a,15956(vector signed __int128)__b);15957}15958#endif1595915960/* vec_all_nge */1596115962static __inline__ int __ATTRS_o_ai vec_all_nge(vector float __a,15963vector float __b) {15964#ifdef __VSX__15965return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __a, __b);15966#else15967return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __a, __b);15968#endif15969}1597015971#ifdef __VSX__15972static __inline__ int __ATTRS_o_ai vec_all_nge(vector double __a,15973vector double __b) {15974return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __a, __b);15975}15976#endif1597715978/* vec_all_ngt */1597915980static __inline__ int __ATTRS_o_ai vec_all_ngt(vector float __a,15981vector float __b) {15982#ifdef __VSX__15983return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __a, __b);15984#else15985return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __a, __b);15986#endif15987}1598815989#ifdef __VSX__15990static __inline__ int __ATTRS_o_ai vec_all_ngt(vector double __a,15991vector double __b) {15992return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __a, __b);15993}15994#endif1599515996/* vec_all_nle */1599715998static __inline__ int __ATTRS_o_ai15999vec_all_nle(vector float __a, vector float __b) {16000#ifdef __VSX__16001return __builtin_vsx_xvcmpgesp_p(__CR6_EQ, __b, __a);16002#else16003return __builtin_altivec_vcmpgefp_p(__CR6_EQ, __b, __a);16004#endif16005}1600616007#ifdef __VSX__16008static __inline__ int __ATTRS_o_ai vec_all_nle(vector double __a,16009vector double __b) {16010return __builtin_vsx_xvcmpgedp_p(__CR6_EQ, __b, __a);16011}16012#endif1601316014/* vec_all_nlt */1601516016static __inline__ int __ATTRS_o_ai16017vec_all_nlt(vector float __a, vector float __b) {16018#ifdef __VSX__16019return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ, __b, __a);16020#else16021return __builtin_altivec_vcmpgtfp_p(__CR6_EQ, __b, __a);16022#endif16023}1602416025#ifdef __VSX__16026static __inline__ int __ATTRS_o_ai vec_all_nlt(vector double __a,16027vector double __b) {16028return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ, __b, __a);16029}16030#endif1603116032/* vec_all_numeric */1603316034static __inline__ int __ATTRS_o_ai16035vec_all_numeric(vector float __a) {16036#ifdef __VSX__16037return __builtin_vsx_xvcmpeqsp_p(__CR6_LT, __a, __a);16038#else16039return __builtin_altivec_vcmpeqfp_p(__CR6_LT, __a, __a);16040#endif16041}1604216043#ifdef __VSX__16044static __inline__ int __ATTRS_o_ai vec_all_numeric(vector double __a) {16045return __builtin_vsx_xvcmpeqdp_p(__CR6_LT, __a, __a);16046}16047#endif1604816049/* vec_any_eq */1605016051static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,16052vector signed char __b) {16053return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16054(vector char)__b);16055}1605616057static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed char __a,16058vector bool char __b) {16059return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16060(vector char)__b);16061}1606216063static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,16064vector unsigned char __b) {16065return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16066(vector char)__b);16067}1606816069static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned char __a,16070vector bool char __b) {16071return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16072(vector char)__b);16073}1607416075static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,16076vector signed char __b) {16077return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16078(vector char)__b);16079}1608016081static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,16082vector unsigned char __b) {16083return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16084(vector char)__b);16085}1608616087static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool char __a,16088vector bool char __b) {16089return __builtin_altivec_vcmpequb_p(__CR6_EQ_REV, (vector char)__a,16090(vector char)__b);16091}1609216093static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,16094vector short __b) {16095return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, __b);16096}1609716098static __inline__ int __ATTRS_o_ai vec_any_eq(vector short __a,16099vector bool short __b) {16100return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, __a, (vector short)__b);16101}1610216103static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,16104vector unsigned short __b) {16105return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16106(vector short)__b);16107}1610816109static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned short __a,16110vector bool short __b) {16111return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16112(vector short)__b);16113}1611416115static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,16116vector short __b) {16117return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16118(vector short)__b);16119}1612016121static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,16122vector unsigned short __b) {16123return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16124(vector short)__b);16125}1612616127static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool short __a,16128vector bool short __b) {16129return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16130(vector short)__b);16131}1613216133static __inline__ int __ATTRS_o_ai vec_any_eq(vector pixel __a,16134vector pixel __b) {16135return __builtin_altivec_vcmpequh_p(__CR6_EQ_REV, (vector short)__a,16136(vector short)__b);16137}1613816139static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a, vector int __b) {16140return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, __b);16141}1614216143static __inline__ int __ATTRS_o_ai vec_any_eq(vector int __a,16144vector bool int __b) {16145return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, __a, (vector int)__b);16146}1614716148static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,16149vector unsigned int __b) {16150return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,16151(vector int)__b);16152}1615316154static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned int __a,16155vector bool int __b) {16156return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,16157(vector int)__b);16158}1615916160static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,16161vector int __b) {16162return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,16163(vector int)__b);16164}1616516166static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,16167vector unsigned int __b) {16168return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,16169(vector int)__b);16170}1617116172static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool int __a,16173vector bool int __b) {16174return __builtin_altivec_vcmpequw_p(__CR6_EQ_REV, (vector int)__a,16175(vector int)__b);16176}1617716178#ifdef __VSX__16179static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,16180vector signed long long __b) {16181return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a, __b);16182}1618316184static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,16185vector unsigned long long __b) {16186return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, (vector long long)__a,16187(vector long long)__b);16188}1618916190static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed long long __a,16191vector bool long long __b) {16192return __builtin_altivec_vcmpequd_p(__CR6_EQ_REV, __a,16193(vector signed long long)__b);16194}1619516196static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned long long __a,16197vector bool long long __b) {16198return __builtin_altivec_vcmpequd_p(16199__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);16200}1620116202static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,16203vector signed long long __b) {16204return __builtin_altivec_vcmpequd_p(16205__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);16206}1620716208static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,16209vector unsigned long long __b) {16210return __builtin_altivec_vcmpequd_p(16211__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);16212}1621316214static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool long long __a,16215vector bool long long __b) {16216return __builtin_altivec_vcmpequd_p(16217__CR6_EQ_REV, (vector signed long long)__a, (vector signed long long)__b);16218}16219#endif1622016221static __inline__ int __ATTRS_o_ai vec_any_eq(vector float __a,16222vector float __b) {16223#ifdef __VSX__16224return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __b);16225#else16226return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __b);16227#endif16228}1622916230#ifdef __VSX__16231static __inline__ int __ATTRS_o_ai vec_any_eq(vector double __a,16232vector double __b) {16233return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __b);16234}16235#endif1623616237#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)16238static __inline__ int __ATTRS_o_ai vec_any_eq(vector signed __int128 __a,16239vector signed __int128 __b) {16240return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV,16241(vector unsigned __int128)__a, __b);16242}1624316244static __inline__ int __ATTRS_o_ai vec_any_eq(vector unsigned __int128 __a,16245vector unsigned __int128 __b) {16246return __builtin_altivec_vcmpequq_p(__CR6_EQ_REV, __a,16247(vector signed __int128)__b);16248}1624916250static __inline__ int __ATTRS_o_ai vec_any_eq(vector bool __int128 __a,16251vector bool __int128 __b) {16252return __builtin_altivec_vcmpequq_p(16253__CR6_EQ_REV, (vector unsigned __int128)__a, (vector signed __int128)__b);16254}16255#endif1625616257/* vec_any_ge */1625816259static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,16260vector signed char __b) {16261return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b, __a);16262}1626316264static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed char __a,16265vector bool char __b) {16266return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__b,16267__a);16268}1626916270static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,16271vector unsigned char __b) {16272return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b, __a);16273}1627416275static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned char __a,16276vector bool char __b) {16277return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,16278__a);16279}1628016281static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,16282vector signed char __b) {16283return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __b,16284(vector signed char)__a);16285}1628616287static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,16288vector unsigned char __b) {16289return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __b,16290(vector unsigned char)__a);16291}1629216293static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool char __a,16294vector bool char __b) {16295return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__b,16296(vector unsigned char)__a);16297}1629816299static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,16300vector short __b) {16301return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b, __a);16302}1630316304static __inline__ int __ATTRS_o_ai vec_any_ge(vector short __a,16305vector bool short __b) {16306return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector short)__b, __a);16307}1630816309static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,16310vector unsigned short __b) {16311return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b, __a);16312}1631316314static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned short __a,16315vector bool short __b) {16316return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,16317__a);16318}1631916320static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,16321vector short __b) {16322return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __b,16323(vector signed short)__a);16324}1632516326static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,16327vector unsigned short __b) {16328return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __b,16329(vector unsigned short)__a);16330}1633116332static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool short __a,16333vector bool short __b) {16334return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__b,16335(vector unsigned short)__a);16336}1633716338static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a, vector int __b) {16339return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b, __a);16340}1634116342static __inline__ int __ATTRS_o_ai vec_any_ge(vector int __a,16343vector bool int __b) {16344return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector int)__b, __a);16345}1634616347static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,16348vector unsigned int __b) {16349return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b, __a);16350}1635116352static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned int __a,16353vector bool int __b) {16354return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,16355__a);16356}1635716358static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,16359vector int __b) {16360return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __b,16361(vector signed int)__a);16362}1636316364static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,16365vector unsigned int __b) {16366return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __b,16367(vector unsigned int)__a);16368}1636916370static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool int __a,16371vector bool int __b) {16372return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__b,16373(vector unsigned int)__a);16374}1637516376#ifdef __VSX__16377static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,16378vector signed long long __b) {16379return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b, __a);16380}1638116382static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,16383vector unsigned long long __b) {16384return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b, __a);16385}1638616387static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed long long __a,16388vector bool long long __b) {16389return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,16390(vector signed long long)__b, __a);16391}1639216393static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned long long __a,16394vector bool long long __b) {16395return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,16396(vector unsigned long long)__b, __a);16397}1639816399static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,16400vector signed long long __b) {16401return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __b,16402(vector signed long long)__a);16403}1640416405static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,16406vector unsigned long long __b) {16407return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __b,16408(vector unsigned long long)__a);16409}1641016411static __inline__ int __ATTRS_o_ai vec_any_ge(vector bool long long __a,16412vector bool long long __b) {16413return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,16414(vector unsigned long long)__b,16415(vector unsigned long long)__a);16416}16417#endif1641816419static __inline__ int __ATTRS_o_ai vec_any_ge(vector float __a,16420vector float __b) {16421#ifdef __VSX__16422return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __a, __b);16423#else16424return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __a, __b);16425#endif16426}1642716428#ifdef __VSX__16429static __inline__ int __ATTRS_o_ai vec_any_ge(vector double __a,16430vector double __b) {16431return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __a, __b);16432}16433#endif1643416435#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)16436static __inline__ int __ATTRS_o_ai vec_any_ge(vector signed __int128 __a,16437vector signed __int128 __b) {16438return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __b, __a);16439}1644016441static __inline__ int __ATTRS_o_ai vec_any_ge(vector unsigned __int128 __a,16442vector unsigned __int128 __b) {16443return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __b, __a);16444}16445#endif1644616447/* vec_any_gt */1644816449static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,16450vector signed char __b) {16451return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a, __b);16452}1645316454static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed char __a,16455vector bool char __b) {16456return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __a,16457(vector signed char)__b);16458}1645916460static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,16461vector unsigned char __b) {16462return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a, __b);16463}1646416465static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned char __a,16466vector bool char __b) {16467return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __a,16468(vector unsigned char)__b);16469}1647016471static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,16472vector signed char __b) {16473return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__a,16474__b);16475}1647616477static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,16478vector unsigned char __b) {16479return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,16480__b);16481}1648216483static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool char __a,16484vector bool char __b) {16485return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__a,16486(vector unsigned char)__b);16487}1648816489static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,16490vector short __b) {16491return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, __b);16492}1649316494static __inline__ int __ATTRS_o_ai vec_any_gt(vector short __a,16495vector bool short __b) {16496return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __a, (vector short)__b);16497}1649816499static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,16500vector unsigned short __b) {16501return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a, __b);16502}1650316504static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned short __a,16505vector bool short __b) {16506return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __a,16507(vector unsigned short)__b);16508}1650916510static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,16511vector short __b) {16512return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector signed short)__a,16513__b);16514}1651516516static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,16517vector unsigned short __b) {16518return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,16519__b);16520}1652116522static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool short __a,16523vector bool short __b) {16524return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__a,16525(vector unsigned short)__b);16526}1652716528static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a, vector int __b) {16529return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, __b);16530}1653116532static __inline__ int __ATTRS_o_ai vec_any_gt(vector int __a,16533vector bool int __b) {16534return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __a, (vector int)__b);16535}1653616537static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,16538vector unsigned int __b) {16539return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a, __b);16540}1654116542static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned int __a,16543vector bool int __b) {16544return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __a,16545(vector unsigned int)__b);16546}1654716548static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,16549vector int __b) {16550return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector signed int)__a,16551__b);16552}1655316554static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,16555vector unsigned int __b) {16556return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,16557__b);16558}1655916560static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool int __a,16561vector bool int __b) {16562return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__a,16563(vector unsigned int)__b);16564}1656516566#ifdef __VSX__16567static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,16568vector signed long long __b) {16569return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a, __b);16570}1657116572static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,16573vector unsigned long long __b) {16574return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a, __b);16575}1657616577static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed long long __a,16578vector bool long long __b) {16579return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __a,16580(vector signed long long)__b);16581}1658216583static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned long long __a,16584vector bool long long __b) {16585return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __a,16586(vector unsigned long long)__b);16587}1658816589static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,16590vector signed long long __b) {16591return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,16592(vector signed long long)__a, __b);16593}1659416595static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,16596vector unsigned long long __b) {16597return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,16598(vector unsigned long long)__a, __b);16599}1660016601static __inline__ int __ATTRS_o_ai vec_any_gt(vector bool long long __a,16602vector bool long long __b) {16603return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,16604(vector unsigned long long)__a,16605(vector unsigned long long)__b);16606}16607#endif1660816609static __inline__ int __ATTRS_o_ai vec_any_gt(vector float __a,16610vector float __b) {16611#ifdef __VSX__16612return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __a, __b);16613#else16614return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __a, __b);16615#endif16616}1661716618#ifdef __VSX__16619static __inline__ int __ATTRS_o_ai vec_any_gt(vector double __a,16620vector double __b) {16621return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __a, __b);16622}16623#endif1662416625#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)16626static __inline__ int __ATTRS_o_ai vec_any_gt(vector signed __int128 __a,16627vector signed __int128 __b) {16628return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __a, __b);16629}1663016631static __inline__ int __ATTRS_o_ai vec_any_gt(vector unsigned __int128 __a,16632vector unsigned __int128 __b) {16633return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __a, __b);16634}16635#endif1663616637/* vec_any_le */1663816639static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,16640vector signed char __b) {16641return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a, __b);16642}1664316644static __inline__ int __ATTRS_o_ai vec_any_le(vector signed char __a,16645vector bool char __b) {16646return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, __a,16647(vector signed char)__b);16648}1664916650static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,16651vector unsigned char __b) {16652return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a, __b);16653}1665416655static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned char __a,16656vector bool char __b) {16657return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, __a,16658(vector unsigned char)__b);16659}1666016661static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,16662vector signed char __b) {16663return __builtin_altivec_vcmpgtsb_p(__CR6_LT_REV, (vector signed char)__a,16664__b);16665}1666616667static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,16668vector unsigned char __b) {16669return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,16670__b);16671}1667216673static __inline__ int __ATTRS_o_ai vec_any_le(vector bool char __a,16674vector bool char __b) {16675return __builtin_altivec_vcmpgtub_p(__CR6_LT_REV, (vector unsigned char)__a,16676(vector unsigned char)__b);16677}1667816679static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,16680vector short __b) {16681return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, __b);16682}1668316684static __inline__ int __ATTRS_o_ai vec_any_le(vector short __a,16685vector bool short __b) {16686return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, __a, (vector short)__b);16687}1668816689static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,16690vector unsigned short __b) {16691return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a, __b);16692}1669316694static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned short __a,16695vector bool short __b) {16696return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, __a,16697(vector unsigned short)__b);16698}1669916700static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,16701vector short __b) {16702return __builtin_altivec_vcmpgtsh_p(__CR6_LT_REV, (vector signed short)__a,16703__b);16704}1670516706static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,16707vector unsigned short __b) {16708return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,16709__b);16710}1671116712static __inline__ int __ATTRS_o_ai vec_any_le(vector bool short __a,16713vector bool short __b) {16714return __builtin_altivec_vcmpgtuh_p(__CR6_LT_REV, (vector unsigned short)__a,16715(vector unsigned short)__b);16716}1671716718static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a, vector int __b) {16719return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, __b);16720}1672116722static __inline__ int __ATTRS_o_ai vec_any_le(vector int __a,16723vector bool int __b) {16724return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, __a, (vector int)__b);16725}1672616727static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,16728vector unsigned int __b) {16729return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a, __b);16730}1673116732static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned int __a,16733vector bool int __b) {16734return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, __a,16735(vector unsigned int)__b);16736}1673716738static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,16739vector int __b) {16740return __builtin_altivec_vcmpgtsw_p(__CR6_LT_REV, (vector signed int)__a,16741__b);16742}1674316744static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,16745vector unsigned int __b) {16746return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,16747__b);16748}1674916750static __inline__ int __ATTRS_o_ai vec_any_le(vector bool int __a,16751vector bool int __b) {16752return __builtin_altivec_vcmpgtuw_p(__CR6_LT_REV, (vector unsigned int)__a,16753(vector unsigned int)__b);16754}1675516756#ifdef __VSX__16757static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,16758vector signed long long __b) {16759return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a, __b);16760}1676116762static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,16763vector unsigned long long __b) {16764return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a, __b);16765}1676616767static __inline__ int __ATTRS_o_ai vec_any_le(vector signed long long __a,16768vector bool long long __b) {16769return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV, __a,16770(vector signed long long)__b);16771}1677216773static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned long long __a,16774vector bool long long __b) {16775return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV, __a,16776(vector unsigned long long)__b);16777}1677816779static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,16780vector signed long long __b) {16781return __builtin_altivec_vcmpgtsd_p(__CR6_LT_REV,16782(vector signed long long)__a, __b);16783}1678416785static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,16786vector unsigned long long __b) {16787return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,16788(vector unsigned long long)__a, __b);16789}1679016791static __inline__ int __ATTRS_o_ai vec_any_le(vector bool long long __a,16792vector bool long long __b) {16793return __builtin_altivec_vcmpgtud_p(__CR6_LT_REV,16794(vector unsigned long long)__a,16795(vector unsigned long long)__b);16796}16797#endif1679816799static __inline__ int __ATTRS_o_ai vec_any_le(vector float __a,16800vector float __b) {16801#ifdef __VSX__16802return __builtin_vsx_xvcmpgesp_p(__CR6_EQ_REV, __b, __a);16803#else16804return __builtin_altivec_vcmpgefp_p(__CR6_EQ_REV, __b, __a);16805#endif16806}1680716808#ifdef __VSX__16809static __inline__ int __ATTRS_o_ai vec_any_le(vector double __a,16810vector double __b) {16811return __builtin_vsx_xvcmpgedp_p(__CR6_EQ_REV, __b, __a);16812}16813#endif1681416815#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)16816static __inline__ int __ATTRS_o_ai vec_any_le(vector signed __int128 __a,16817vector signed __int128 __b) {16818return __builtin_altivec_vcmpgtsq_p(__CR6_LT_REV, __a, __b);16819}1682016821static __inline__ int __ATTRS_o_ai vec_any_le(vector unsigned __int128 __a,16822vector unsigned __int128 __b) {16823return __builtin_altivec_vcmpgtuq_p(__CR6_LT_REV, __a, __b);16824}16825#endif1682616827/* vec_any_lt */1682816829static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,16830vector signed char __b) {16831return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b, __a);16832}1683316834static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed char __a,16835vector bool char __b) {16836return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, (vector signed char)__b,16837__a);16838}1683916840static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,16841vector unsigned char __b) {16842return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b, __a);16843}1684416845static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned char __a,16846vector bool char __b) {16847return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,16848__a);16849}1685016851static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,16852vector signed char __b) {16853return __builtin_altivec_vcmpgtsb_p(__CR6_EQ_REV, __b,16854(vector signed char)__a);16855}1685616857static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,16858vector unsigned char __b) {16859return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, __b,16860(vector unsigned char)__a);16861}1686216863static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool char __a,16864vector bool char __b) {16865return __builtin_altivec_vcmpgtub_p(__CR6_EQ_REV, (vector unsigned char)__b,16866(vector unsigned char)__a);16867}1686816869static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,16870vector short __b) {16871return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b, __a);16872}1687316874static __inline__ int __ATTRS_o_ai vec_any_lt(vector short __a,16875vector bool short __b) {16876return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, (vector short)__b, __a);16877}1687816879static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,16880vector unsigned short __b) {16881return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b, __a);16882}1688316884static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned short __a,16885vector bool short __b) {16886return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,16887__a);16888}1688916890static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,16891vector short __b) {16892return __builtin_altivec_vcmpgtsh_p(__CR6_EQ_REV, __b,16893(vector signed short)__a);16894}1689516896static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,16897vector unsigned short __b) {16898return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, __b,16899(vector unsigned short)__a);16900}1690116902static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool short __a,16903vector bool short __b) {16904return __builtin_altivec_vcmpgtuh_p(__CR6_EQ_REV, (vector unsigned short)__b,16905(vector unsigned short)__a);16906}1690716908static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a, vector int __b) {16909return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b, __a);16910}1691116912static __inline__ int __ATTRS_o_ai vec_any_lt(vector int __a,16913vector bool int __b) {16914return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, (vector int)__b, __a);16915}1691616917static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,16918vector unsigned int __b) {16919return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b, __a);16920}1692116922static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned int __a,16923vector bool int __b) {16924return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,16925__a);16926}1692716928static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,16929vector int __b) {16930return __builtin_altivec_vcmpgtsw_p(__CR6_EQ_REV, __b,16931(vector signed int)__a);16932}1693316934static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,16935vector unsigned int __b) {16936return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, __b,16937(vector unsigned int)__a);16938}1693916940static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool int __a,16941vector bool int __b) {16942return __builtin_altivec_vcmpgtuw_p(__CR6_EQ_REV, (vector unsigned int)__b,16943(vector unsigned int)__a);16944}1694516946#ifdef __VSX__16947static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,16948vector signed long long __b) {16949return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b, __a);16950}1695116952static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,16953vector unsigned long long __b) {16954return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b, __a);16955}1695616957static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed long long __a,16958vector bool long long __b) {16959return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV,16960(vector signed long long)__b, __a);16961}1696216963static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned long long __a,16964vector bool long long __b) {16965return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,16966(vector unsigned long long)__b, __a);16967}1696816969static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,16970vector signed long long __b) {16971return __builtin_altivec_vcmpgtsd_p(__CR6_EQ_REV, __b,16972(vector signed long long)__a);16973}1697416975static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,16976vector unsigned long long __b) {16977return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV, __b,16978(vector unsigned long long)__a);16979}1698016981static __inline__ int __ATTRS_o_ai vec_any_lt(vector bool long long __a,16982vector bool long long __b) {16983return __builtin_altivec_vcmpgtud_p(__CR6_EQ_REV,16984(vector unsigned long long)__b,16985(vector unsigned long long)__a);16986}16987#endif1698816989static __inline__ int __ATTRS_o_ai vec_any_lt(vector float __a,16990vector float __b) {16991#ifdef __VSX__16992return __builtin_vsx_xvcmpgtsp_p(__CR6_EQ_REV, __b, __a);16993#else16994return __builtin_altivec_vcmpgtfp_p(__CR6_EQ_REV, __b, __a);16995#endif16996}1699716998#ifdef __VSX__16999static __inline__ int __ATTRS_o_ai vec_any_lt(vector double __a,17000vector double __b) {17001return __builtin_vsx_xvcmpgtdp_p(__CR6_EQ_REV, __b, __a);17002}17003#endif1700417005#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)17006static __inline__ int __ATTRS_o_ai vec_any_lt(vector signed __int128 __a,17007vector signed __int128 __b) {17008return __builtin_altivec_vcmpgtsq_p(__CR6_EQ_REV, __b, __a);17009}1701017011static __inline__ int __ATTRS_o_ai vec_any_lt(vector unsigned __int128 __a,17012vector unsigned __int128 __b) {17013return __builtin_altivec_vcmpgtuq_p(__CR6_EQ_REV, __b, __a);17014}17015#endif1701617017/* vec_any_nan */1701817019static __inline__ int __ATTRS_o_ai vec_any_nan(vector float __a) {17020#ifdef __VSX__17021return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __a);17022#else17023return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __a);17024#endif17025}17026#ifdef __VSX__17027static __inline__ int __ATTRS_o_ai vec_any_nan(vector double __a) {17028return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __a);17029}17030#endif1703117032/* vec_any_ne */1703317034static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,17035vector signed char __b) {17036return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17037(vector char)__b);17038}1703917040static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed char __a,17041vector bool char __b) {17042return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17043(vector char)__b);17044}1704517046static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,17047vector unsigned char __b) {17048return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17049(vector char)__b);17050}1705117052static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned char __a,17053vector bool char __b) {17054return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17055(vector char)__b);17056}1705717058static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,17059vector signed char __b) {17060return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17061(vector char)__b);17062}1706317064static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,17065vector unsigned char __b) {17066return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17067(vector char)__b);17068}1706917070static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool char __a,17071vector bool char __b) {17072return __builtin_altivec_vcmpequb_p(__CR6_LT_REV, (vector char)__a,17073(vector char)__b);17074}1707517076static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,17077vector short __b) {17078return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, __b);17079}1708017081static __inline__ int __ATTRS_o_ai vec_any_ne(vector short __a,17082vector bool short __b) {17083return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, __a, (vector short)__b);17084}1708517086static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,17087vector unsigned short __b) {17088return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17089(vector short)__b);17090}1709117092static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned short __a,17093vector bool short __b) {17094return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17095(vector short)__b);17096}1709717098static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,17099vector short __b) {17100return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17101(vector short)__b);17102}1710317104static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,17105vector unsigned short __b) {17106return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17107(vector short)__b);17108}1710917110static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool short __a,17111vector bool short __b) {17112return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17113(vector short)__b);17114}1711517116static __inline__ int __ATTRS_o_ai vec_any_ne(vector pixel __a,17117vector pixel __b) {17118return __builtin_altivec_vcmpequh_p(__CR6_LT_REV, (vector short)__a,17119(vector short)__b);17120}1712117122static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a, vector int __b) {17123return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, __b);17124}1712517126static __inline__ int __ATTRS_o_ai vec_any_ne(vector int __a,17127vector bool int __b) {17128return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, __a, (vector int)__b);17129}1713017131static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,17132vector unsigned int __b) {17133return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,17134(vector int)__b);17135}1713617137static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned int __a,17138vector bool int __b) {17139return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,17140(vector int)__b);17141}1714217143static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,17144vector int __b) {17145return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,17146(vector int)__b);17147}1714817149static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,17150vector unsigned int __b) {17151return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,17152(vector int)__b);17153}1715417155static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool int __a,17156vector bool int __b) {17157return __builtin_altivec_vcmpequw_p(__CR6_LT_REV, (vector int)__a,17158(vector int)__b);17159}1716017161#ifdef __VSX__17162static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,17163vector signed long long __b) {17164#ifdef __POWER8_VECTOR__17165return __builtin_altivec_vcmpequd_p(__CR6_LT_REV, __a, __b);17166#else17167// Take advantage of the optimized sequence for vec_all_eq when vcmpequd is17168// not available.17169return !vec_all_eq(__a, __b);17170#endif17171}1717217173static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,17174vector unsigned long long __b) {17175return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17176}1717717178static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed long long __a,17179vector bool long long __b) {17180return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17181}1718217183static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned long long __a,17184vector bool long long __b) {17185return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17186}1718717188static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,17189vector signed long long __b) {17190return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17191}1719217193static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,17194vector unsigned long long __b) {17195return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17196}1719717198static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool long long __a,17199vector bool long long __b) {17200return vec_any_ne((vector signed long long)__a, (vector signed long long)__b);17201}17202#endif1720317204static __inline__ int __ATTRS_o_ai vec_any_ne(vector float __a,17205vector float __b) {17206#ifdef __VSX__17207return __builtin_vsx_xvcmpeqsp_p(__CR6_LT_REV, __a, __b);17208#else17209return __builtin_altivec_vcmpeqfp_p(__CR6_LT_REV, __a, __b);17210#endif17211}1721217213#ifdef __VSX__17214static __inline__ int __ATTRS_o_ai vec_any_ne(vector double __a,17215vector double __b) {17216return __builtin_vsx_xvcmpeqdp_p(__CR6_LT_REV, __a, __b);17217}17218#endif1721917220#if defined(__POWER10_VECTOR__) && defined(__SIZEOF_INT128__)17221static __inline__ int __ATTRS_o_ai vec_any_ne(vector signed __int128 __a,17222vector signed __int128 __b) {17223return __builtin_altivec_vcmpequq_p(__CR6_LT_REV,17224(vector unsigned __int128)__a, __b);17225}1722617227static __inline__ int __ATTRS_o_ai vec_any_ne(vector unsigned __int128 __a,17228vector unsigned __int128 __b) {17229return __builtin_altivec_vcmpequq_p(__CR6_LT_REV, __a,17230(vector signed __int128)__b);17231}1723217233static __inline__ int __ATTRS_o_ai vec_any_ne(vector bool __int128 __a,17234vector bool __int128 __b) {17235return __builtin_altivec_vcmpequq_p(17236__CR6_LT_REV, (vector unsigned __int128)__a, (vector signed __int128)__b);17237}17238#endif1723917240/* vec_any_nge */1724117242static __inline__ int __ATTRS_o_ai vec_any_nge(vector float __a,17243vector float __b) {17244#ifdef __VSX__17245return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __a, __b);17246#else17247return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __a, __b);17248#endif17249}1725017251#ifdef __VSX__17252static __inline__ int __ATTRS_o_ai vec_any_nge(vector double __a,17253vector double __b) {17254return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __a, __b);17255}17256#endif1725717258/* vec_any_ngt */1725917260static __inline__ int __ATTRS_o_ai vec_any_ngt(vector float __a,17261vector float __b) {17262#ifdef __VSX__17263return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __a, __b);17264#else17265return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __a, __b);17266#endif17267}1726817269#ifdef __VSX__17270static __inline__ int __ATTRS_o_ai vec_any_ngt(vector double __a,17271vector double __b) {17272return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __a, __b);17273}17274#endif1727517276/* vec_any_nle */1727717278static __inline__ int __ATTRS_o_ai vec_any_nle(vector float __a,17279vector float __b) {17280#ifdef __VSX__17281return __builtin_vsx_xvcmpgesp_p(__CR6_LT_REV, __b, __a);17282#else17283return __builtin_altivec_vcmpgefp_p(__CR6_LT_REV, __b, __a);17284#endif17285}1728617287#ifdef __VSX__17288static __inline__ int __ATTRS_o_ai vec_any_nle(vector double __a,17289vector double __b) {17290return __builtin_vsx_xvcmpgedp_p(__CR6_LT_REV, __b, __a);17291}17292#endif1729317294/* vec_any_nlt */1729517296static __inline__ int __ATTRS_o_ai vec_any_nlt(vector float __a,17297vector float __b) {17298#ifdef __VSX__17299return __builtin_vsx_xvcmpgtsp_p(__CR6_LT_REV, __b, __a);17300#else17301return __builtin_altivec_vcmpgtfp_p(__CR6_LT_REV, __b, __a);17302#endif17303}1730417305#ifdef __VSX__17306static __inline__ int __ATTRS_o_ai vec_any_nlt(vector double __a,17307vector double __b) {17308return __builtin_vsx_xvcmpgtdp_p(__CR6_LT_REV, __b, __a);17309}17310#endif1731117312/* vec_any_numeric */1731317314static __inline__ int __ATTRS_o_ai vec_any_numeric(vector float __a) {17315#ifdef __VSX__17316return __builtin_vsx_xvcmpeqsp_p(__CR6_EQ_REV, __a, __a);17317#else17318return __builtin_altivec_vcmpeqfp_p(__CR6_EQ_REV, __a, __a);17319#endif17320}1732117322#ifdef __VSX__17323static __inline__ int __ATTRS_o_ai vec_any_numeric(vector double __a) {17324return __builtin_vsx_xvcmpeqdp_p(__CR6_EQ_REV, __a, __a);17325}17326#endif1732717328/* vec_any_out */1732917330static __inline__ int __attribute__((__always_inline__))17331vec_any_out(vector float __a, vector float __b) {17332return __builtin_altivec_vcmpbfp_p(__CR6_EQ_REV, __a, __b);17333}1733417335/* Power 8 Crypto functions17336Note: We diverge from the current GCC implementation with regard17337to cryptography and related functions as follows:17338- Only the SHA and AES instructions and builtins are disabled by -mno-crypto17339- The remaining ones are only available on Power8 and up so17340require -mpower8-vector17341The justification for this is that export requirements require that17342Category:Vector.Crypto is optional (i.e. compliant hardware may not provide17343support). As a result, we need to be able to turn off support for those.17344The remaining ones (currently controlled by -mcrypto for GCC) still17345need to be provided on compliant hardware even if Vector.Crypto is not17346provided.17347*/17348#ifdef __CRYPTO__17349#define vec_sbox_be __builtin_altivec_crypto_vsbox17350#define vec_cipher_be __builtin_altivec_crypto_vcipher17351#define vec_cipherlast_be __builtin_altivec_crypto_vcipherlast17352#define vec_ncipher_be __builtin_altivec_crypto_vncipher17353#define vec_ncipherlast_be __builtin_altivec_crypto_vncipherlast1735417355#ifdef __VSX__17356static __inline__ vector unsigned char __attribute__((__always_inline__))17357__builtin_crypto_vsbox(vector unsigned char __a) {17358return __builtin_altivec_crypto_vsbox(__a);17359}1736017361static __inline__ vector unsigned char __attribute__((__always_inline__))17362__builtin_crypto_vcipher(vector unsigned char __a,17363vector unsigned char __b) {17364return __builtin_altivec_crypto_vcipher(__a, __b);17365}1736617367static __inline__ vector unsigned char __attribute__((__always_inline__))17368__builtin_crypto_vcipherlast(vector unsigned char __a,17369vector unsigned char __b) {17370return __builtin_altivec_crypto_vcipherlast(__a, __b);17371}1737217373static __inline__ vector unsigned char __attribute__((__always_inline__))17374__builtin_crypto_vncipher(vector unsigned char __a,17375vector unsigned char __b) {17376return __builtin_altivec_crypto_vncipher(__a, __b);17377}1737817379static __inline__ vector unsigned char __attribute__((__always_inline__))17380__builtin_crypto_vncipherlast(vector unsigned char __a,17381vector unsigned char __b) {17382return __builtin_altivec_crypto_vncipherlast(__a, __b);17383}17384#endif /* __VSX__ */1738517386#define __builtin_crypto_vshasigmad __builtin_altivec_crypto_vshasigmad17387#define __builtin_crypto_vshasigmaw __builtin_altivec_crypto_vshasigmaw1738817389#define vec_shasigma_be(X, Y, Z) \17390_Generic((X), vector unsigned int \17391: __builtin_crypto_vshasigmaw, vector unsigned long long \17392: __builtin_crypto_vshasigmad)((X), (Y), (Z))17393#endif1739417395#ifdef __POWER8_VECTOR__17396static __inline__ vector bool char __ATTRS_o_ai17397vec_permxor(vector bool char __a, vector bool char __b,17398vector bool char __c) {17399return (vector bool char)__builtin_altivec_crypto_vpermxor(17400(vector unsigned char)__a, (vector unsigned char)__b,17401(vector unsigned char)__c);17402}1740317404static __inline__ vector signed char __ATTRS_o_ai17405vec_permxor(vector signed char __a, vector signed char __b,17406vector signed char __c) {17407return (vector signed char)__builtin_altivec_crypto_vpermxor(17408(vector unsigned char)__a, (vector unsigned char)__b,17409(vector unsigned char)__c);17410}1741117412static __inline__ vector unsigned char __ATTRS_o_ai17413vec_permxor(vector unsigned char __a, vector unsigned char __b,17414vector unsigned char __c) {17415return __builtin_altivec_crypto_vpermxor(__a, __b, __c);17416}1741717418static __inline__ vector unsigned char __ATTRS_o_ai17419__builtin_crypto_vpermxor(vector unsigned char __a, vector unsigned char __b,17420vector unsigned char __c) {17421return __builtin_altivec_crypto_vpermxor(__a, __b, __c);17422}1742317424static __inline__ vector unsigned short __ATTRS_o_ai17425__builtin_crypto_vpermxor(vector unsigned short __a, vector unsigned short __b,17426vector unsigned short __c) {17427return (vector unsigned short)__builtin_altivec_crypto_vpermxor(17428(vector unsigned char)__a, (vector unsigned char)__b,17429(vector unsigned char)__c);17430}1743117432static __inline__ vector unsigned int __ATTRS_o_ai __builtin_crypto_vpermxor(17433vector unsigned int __a, vector unsigned int __b, vector unsigned int __c) {17434return (vector unsigned int)__builtin_altivec_crypto_vpermxor(17435(vector unsigned char)__a, (vector unsigned char)__b,17436(vector unsigned char)__c);17437}1743817439static __inline__ vector unsigned long long __ATTRS_o_ai17440__builtin_crypto_vpermxor(vector unsigned long long __a,17441vector unsigned long long __b,17442vector unsigned long long __c) {17443return (vector unsigned long long)__builtin_altivec_crypto_vpermxor(17444(vector unsigned char)__a, (vector unsigned char)__b,17445(vector unsigned char)__c);17446}1744717448static __inline__ vector unsigned char __ATTRS_o_ai17449__builtin_crypto_vpmsumb(vector unsigned char __a, vector unsigned char __b) {17450return __builtin_altivec_crypto_vpmsumb(__a, __b);17451}1745217453static __inline__ vector unsigned short __ATTRS_o_ai17454__builtin_crypto_vpmsumb(vector unsigned short __a, vector unsigned short __b) {17455return __builtin_altivec_crypto_vpmsumh(__a, __b);17456}1745717458static __inline__ vector unsigned int __ATTRS_o_ai17459__builtin_crypto_vpmsumb(vector unsigned int __a, vector unsigned int __b) {17460return __builtin_altivec_crypto_vpmsumw(__a, __b);17461}1746217463static __inline__ vector unsigned long long __ATTRS_o_ai17464__builtin_crypto_vpmsumb(vector unsigned long long __a,17465vector unsigned long long __b) {17466return __builtin_altivec_crypto_vpmsumd(__a, __b);17467}1746817469static __inline__ vector signed char __ATTRS_o_ai17470vec_vgbbd(vector signed char __a) {17471return (vector signed char)__builtin_altivec_vgbbd((vector unsigned char)__a);17472}1747317474#define vec_pmsum_be __builtin_crypto_vpmsumb17475#define vec_gb __builtin_altivec_vgbbd1747617477static __inline__ vector unsigned char __ATTRS_o_ai17478vec_vgbbd(vector unsigned char __a) {17479return __builtin_altivec_vgbbd(__a);17480}1748117482static __inline__ vector signed long long __ATTRS_o_ai17483vec_gbb(vector signed long long __a) {17484return (vector signed long long)__builtin_altivec_vgbbd(17485(vector unsigned char)__a);17486}1748717488static __inline__ vector unsigned long long __ATTRS_o_ai17489vec_gbb(vector unsigned long long __a) {17490return (vector unsigned long long)__builtin_altivec_vgbbd(17491(vector unsigned char)__a);17492}1749317494static __inline__ vector long long __ATTRS_o_ai17495vec_vbpermq(vector signed char __a, vector signed char __b) {17496return (vector long long)__builtin_altivec_vbpermq((vector unsigned char)__a,17497(vector unsigned char)__b);17498}1749917500static __inline__ vector long long __ATTRS_o_ai17501vec_vbpermq(vector unsigned char __a, vector unsigned char __b) {17502return (vector long long)__builtin_altivec_vbpermq(__a, __b);17503}1750417505#if defined(__powerpc64__) && defined(__SIZEOF_INT128__)17506static __inline__ vector unsigned long long __ATTRS_o_ai17507vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {17508return __builtin_altivec_vbpermq((vector unsigned char)__a,17509(vector unsigned char)__b);17510}17511#endif17512static __inline__ vector unsigned char __ATTRS_o_ai17513vec_bperm(vector unsigned char __a, vector unsigned char __b) {17514return (vector unsigned char)__builtin_altivec_vbpermq(__a, __b);17515}17516#endif // __POWER8_VECTOR__17517#ifdef __POWER9_VECTOR__17518static __inline__ vector unsigned long long __ATTRS_o_ai17519vec_bperm(vector unsigned long long __a, vector unsigned char __b) {17520return __builtin_altivec_vbpermd(__a, __b);17521}17522#endif175231752417525/* vec_reve */1752617527static inline __ATTRS_o_ai vector bool char vec_reve(vector bool char __a) {17528return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,175295, 4, 3, 2, 1, 0);17530}1753117532static inline __ATTRS_o_ai vector signed char vec_reve(vector signed char __a) {17533return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,175345, 4, 3, 2, 1, 0);17535}1753617537static inline __ATTRS_o_ai vector unsigned char17538vec_reve(vector unsigned char __a) {17539return __builtin_shufflevector(__a, __a, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6,175405, 4, 3, 2, 1, 0);17541}1754217543static inline __ATTRS_o_ai vector bool int vec_reve(vector bool int __a) {17544return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);17545}1754617547static inline __ATTRS_o_ai vector signed int vec_reve(vector signed int __a) {17548return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);17549}1755017551static inline __ATTRS_o_ai vector unsigned int17552vec_reve(vector unsigned int __a) {17553return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);17554}1755517556static inline __ATTRS_o_ai vector bool short vec_reve(vector bool short __a) {17557return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);17558}1755917560static inline __ATTRS_o_ai vector signed short17561vec_reve(vector signed short __a) {17562return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);17563}1756417565static inline __ATTRS_o_ai vector unsigned short17566vec_reve(vector unsigned short __a) {17567return __builtin_shufflevector(__a, __a, 7, 6, 5, 4, 3, 2, 1, 0);17568}1756917570static inline __ATTRS_o_ai vector float vec_reve(vector float __a) {17571return __builtin_shufflevector(__a, __a, 3, 2, 1, 0);17572}1757317574#ifdef __VSX__17575static inline __ATTRS_o_ai vector bool long long17576vec_reve(vector bool long long __a) {17577return __builtin_shufflevector(__a, __a, 1, 0);17578}1757917580static inline __ATTRS_o_ai vector signed long long17581vec_reve(vector signed long long __a) {17582return __builtin_shufflevector(__a, __a, 1, 0);17583}1758417585static inline __ATTRS_o_ai vector unsigned long long17586vec_reve(vector unsigned long long __a) {17587return __builtin_shufflevector(__a, __a, 1, 0);17588}1758917590static inline __ATTRS_o_ai vector double vec_reve(vector double __a) {17591return __builtin_shufflevector(__a, __a, 1, 0);17592}17593#endif1759417595/* vec_revb */17596static __inline__ vector bool char __ATTRS_o_ai17597vec_revb(vector bool char __a) {17598return __a;17599}1760017601static __inline__ vector signed char __ATTRS_o_ai17602vec_revb(vector signed char __a) {17603return __a;17604}1760517606static __inline__ vector unsigned char __ATTRS_o_ai17607vec_revb(vector unsigned char __a) {17608return __a;17609}1761017611static __inline__ vector bool short __ATTRS_o_ai17612vec_revb(vector bool short __a) {17613vector unsigned char __indices =17614{ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };17615return vec_perm(__a, __a, __indices);17616}1761717618static __inline__ vector signed short __ATTRS_o_ai17619vec_revb(vector signed short __a) {17620vector unsigned char __indices =17621{ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };17622return vec_perm(__a, __a, __indices);17623}1762417625static __inline__ vector unsigned short __ATTRS_o_ai17626vec_revb(vector unsigned short __a) {17627vector unsigned char __indices =17628{ 1, 0, 3, 2, 5, 4, 7, 6, 9, 8, 11, 10, 13, 12, 15, 14 };17629return vec_perm(__a, __a, __indices);17630}1763117632static __inline__ vector bool int __ATTRS_o_ai17633vec_revb(vector bool int __a) {17634vector unsigned char __indices =17635{ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };17636return vec_perm(__a, __a, __indices);17637}1763817639static __inline__ vector signed int __ATTRS_o_ai17640vec_revb(vector signed int __a) {17641vector unsigned char __indices =17642{ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };17643return vec_perm(__a, __a, __indices);17644}1764517646static __inline__ vector unsigned int __ATTRS_o_ai17647vec_revb(vector unsigned int __a) {17648vector unsigned char __indices =17649{ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };17650return vec_perm(__a, __a, __indices);17651}1765217653static __inline__ vector float __ATTRS_o_ai17654vec_revb(vector float __a) {17655vector unsigned char __indices =17656{ 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12 };17657return vec_perm(__a, __a, __indices);17658}1765917660#ifdef __VSX__17661static __inline__ vector bool long long __ATTRS_o_ai17662vec_revb(vector bool long long __a) {17663vector unsigned char __indices =17664{ 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };17665return vec_perm(__a, __a, __indices);17666}1766717668static __inline__ vector signed long long __ATTRS_o_ai17669vec_revb(vector signed long long __a) {17670vector unsigned char __indices =17671{ 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };17672return vec_perm(__a, __a, __indices);17673}1767417675static __inline__ vector unsigned long long __ATTRS_o_ai17676vec_revb(vector unsigned long long __a) {17677vector unsigned char __indices =17678{ 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };17679return vec_perm(__a, __a, __indices);17680}1768117682static __inline__ vector double __ATTRS_o_ai17683vec_revb(vector double __a) {17684vector unsigned char __indices =17685{ 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8 };17686return vec_perm(__a, __a, __indices);17687}17688#endif /* End __VSX__ */1768917690#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \17691defined(__SIZEOF_INT128__)17692static __inline__ vector signed __int128 __ATTRS_o_ai17693vec_revb(vector signed __int128 __a) {17694vector unsigned char __indices =17695{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };17696return (vector signed __int128)vec_perm((vector signed int)__a,17697(vector signed int)__a,17698__indices);17699}1770017701static __inline__ vector unsigned __int128 __ATTRS_o_ai17702vec_revb(vector unsigned __int128 __a) {17703vector unsigned char __indices =17704{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };17705return (vector unsigned __int128)vec_perm((vector signed int)__a,17706(vector signed int)__a,17707__indices);17708}17709#endif /* END __POWER8_VECTOR__ && __powerpc64__ */1771017711/* vec_xl */1771217713#define vec_xld2 vec_xl17714#define vec_xlw4 vec_xl17715typedef vector signed char unaligned_vec_schar __attribute__((aligned(1)));17716typedef vector unsigned char unaligned_vec_uchar __attribute__((aligned(1)));17717typedef vector signed short unaligned_vec_sshort __attribute__((aligned(1)));17718typedef vector unsigned short unaligned_vec_ushort __attribute__((aligned(1)));17719typedef vector signed int unaligned_vec_sint __attribute__((aligned(1)));17720typedef vector unsigned int unaligned_vec_uint __attribute__((aligned(1)));17721typedef vector float unaligned_vec_float __attribute__((aligned(1)));1772217723static inline __ATTRS_o_ai vector signed char vec_xl(ptrdiff_t __offset,17724const signed char *__ptr) {17725return *(unaligned_vec_schar *)(__ptr + __offset);17726}1772717728static inline __ATTRS_o_ai vector unsigned char17729vec_xl(ptrdiff_t __offset, const unsigned char *__ptr) {17730return *(unaligned_vec_uchar*)(__ptr + __offset);17731}1773217733static inline __ATTRS_o_ai vector signed short17734vec_xl(ptrdiff_t __offset, const signed short *__ptr) {17735signed char *__addr = (signed char *)__ptr + __offset;17736return *(unaligned_vec_sshort *)__addr;17737}1773817739static inline __ATTRS_o_ai vector unsigned short17740vec_xl(ptrdiff_t __offset, const unsigned short *__ptr) {17741signed char *__addr = (signed char *)__ptr + __offset;17742return *(unaligned_vec_ushort *)__addr;17743}1774417745static inline __ATTRS_o_ai vector signed int vec_xl(ptrdiff_t __offset,17746const signed int *__ptr) {17747signed char *__addr = (signed char *)__ptr + __offset;17748return *(unaligned_vec_sint *)__addr;17749}1775017751static inline __ATTRS_o_ai vector unsigned int17752vec_xl(ptrdiff_t __offset, const unsigned int *__ptr) {17753signed char *__addr = (signed char *)__ptr + __offset;17754return *(unaligned_vec_uint *)__addr;17755}1775617757static inline __ATTRS_o_ai vector float vec_xl(ptrdiff_t __offset,17758const float *__ptr) {17759signed char *__addr = (signed char *)__ptr + __offset;17760return *(unaligned_vec_float *)__addr;17761}1776217763#ifdef __VSX__17764typedef vector signed long long unaligned_vec_sll __attribute__((aligned(1)));17765typedef vector unsigned long long unaligned_vec_ull __attribute__((aligned(1)));17766typedef vector double unaligned_vec_double __attribute__((aligned(1)));1776717768static inline __ATTRS_o_ai vector signed long long17769vec_xl(ptrdiff_t __offset, const signed long long *__ptr) {17770signed char *__addr = (signed char *)__ptr + __offset;17771return *(unaligned_vec_sll *)__addr;17772}1777317774static inline __ATTRS_o_ai vector unsigned long long17775vec_xl(ptrdiff_t __offset, const unsigned long long *__ptr) {17776signed char *__addr = (signed char *)__ptr + __offset;17777return *(unaligned_vec_ull *)__addr;17778}1777917780static inline __ATTRS_o_ai vector double vec_xl(ptrdiff_t __offset,17781const double *__ptr) {17782signed char *__addr = (signed char *)__ptr + __offset;17783return *(unaligned_vec_double *)__addr;17784}17785#endif1778617787#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \17788defined(__SIZEOF_INT128__)17789typedef vector signed __int128 unaligned_vec_si128 __attribute__((aligned(1)));17790typedef vector unsigned __int128 unaligned_vec_ui12817791__attribute__((aligned(1)));17792static inline __ATTRS_o_ai vector signed __int12817793vec_xl(ptrdiff_t __offset, const signed __int128 *__ptr) {17794signed char *__addr = (signed char *)__ptr + __offset;17795return *(unaligned_vec_si128 *)__addr;17796}1779717798static inline __ATTRS_o_ai vector unsigned __int12817799vec_xl(ptrdiff_t __offset, const unsigned __int128 *__ptr) {17800signed char *__addr = (signed char *)__ptr + __offset;17801return *(unaligned_vec_ui128 *)__addr;17802}17803#endif1780417805/* vec_xl_be */1780617807#ifdef __LITTLE_ENDIAN__17808static __inline__ vector signed char __ATTRS_o_ai17809vec_xl_be(ptrdiff_t __offset, const signed char *__ptr) {17810vector signed char __vec = (vector signed char)__builtin_vsx_lxvd2x_be(__offset, __ptr);17811return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,1781213, 12, 11, 10, 9, 8);17813}1781417815static __inline__ vector unsigned char __ATTRS_o_ai17816vec_xl_be(ptrdiff_t __offset, const unsigned char *__ptr) {17817vector unsigned char __vec = (vector unsigned char)__builtin_vsx_lxvd2x_be(__offset, __ptr);17818return __builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,1781913, 12, 11, 10, 9, 8);17820}1782117822static __inline__ vector signed short __ATTRS_o_ai17823vec_xl_be(ptrdiff_t __offset, const signed short *__ptr) {17824vector signed short __vec = (vector signed short)__builtin_vsx_lxvd2x_be(__offset, __ptr);17825return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);17826}1782717828static __inline__ vector unsigned short __ATTRS_o_ai17829vec_xl_be(ptrdiff_t __offset, const unsigned short *__ptr) {17830vector unsigned short __vec = (vector unsigned short)__builtin_vsx_lxvd2x_be(__offset, __ptr);17831return __builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);17832}1783317834static __inline__ vector signed int __ATTRS_o_ai17835vec_xl_be(signed long long __offset, const signed int *__ptr) {17836return (vector signed int)__builtin_vsx_lxvw4x_be(__offset, __ptr);17837}1783817839static __inline__ vector unsigned int __ATTRS_o_ai17840vec_xl_be(signed long long __offset, const unsigned int *__ptr) {17841return (vector unsigned int)__builtin_vsx_lxvw4x_be(__offset, __ptr);17842}1784317844static __inline__ vector float __ATTRS_o_ai17845vec_xl_be(signed long long __offset, const float *__ptr) {17846return (vector float)__builtin_vsx_lxvw4x_be(__offset, __ptr);17847}1784817849#ifdef __VSX__17850static __inline__ vector signed long long __ATTRS_o_ai17851vec_xl_be(signed long long __offset, const signed long long *__ptr) {17852return (vector signed long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);17853}1785417855static __inline__ vector unsigned long long __ATTRS_o_ai17856vec_xl_be(signed long long __offset, const unsigned long long *__ptr) {17857return (vector unsigned long long)__builtin_vsx_lxvd2x_be(__offset, __ptr);17858}1785917860static __inline__ vector double __ATTRS_o_ai17861vec_xl_be(signed long long __offset, const double *__ptr) {17862return (vector double)__builtin_vsx_lxvd2x_be(__offset, __ptr);17863}17864#endif1786517866#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \17867defined(__SIZEOF_INT128__)17868static __inline__ vector signed __int128 __ATTRS_o_ai17869vec_xl_be(signed long long __offset, const signed __int128 *__ptr) {17870return vec_xl(__offset, __ptr);17871}1787217873static __inline__ vector unsigned __int128 __ATTRS_o_ai17874vec_xl_be(signed long long __offset, const unsigned __int128 *__ptr) {17875return vec_xl(__offset, __ptr);17876}17877#endif17878#else17879#define vec_xl_be vec_xl17880#endif1788117882#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \17883defined(__SIZEOF_INT128__)1788417885/* vec_xl_sext */1788617887static __inline__ vector signed __int128 __ATTRS_o_ai17888vec_xl_sext(ptrdiff_t __offset, const signed char *__pointer) {17889return (vector signed __int128)*(__pointer + __offset);17890}1789117892static __inline__ vector signed __int128 __ATTRS_o_ai17893vec_xl_sext(ptrdiff_t __offset, const signed short *__pointer) {17894return (vector signed __int128)*(__pointer + __offset);17895}1789617897static __inline__ vector signed __int128 __ATTRS_o_ai17898vec_xl_sext(ptrdiff_t __offset, const signed int *__pointer) {17899return (vector signed __int128)*(__pointer + __offset);17900}1790117902static __inline__ vector signed __int128 __ATTRS_o_ai17903vec_xl_sext(ptrdiff_t __offset, const signed long long *__pointer) {17904return (vector signed __int128)*(__pointer + __offset);17905}1790617907/* vec_xl_zext */1790817909static __inline__ vector unsigned __int128 __ATTRS_o_ai17910vec_xl_zext(ptrdiff_t __offset, const unsigned char *__pointer) {17911return (vector unsigned __int128)*(__pointer + __offset);17912}1791317914static __inline__ vector unsigned __int128 __ATTRS_o_ai17915vec_xl_zext(ptrdiff_t __offset, const unsigned short *__pointer) {17916return (vector unsigned __int128)*(__pointer + __offset);17917}1791817919static __inline__ vector unsigned __int128 __ATTRS_o_ai17920vec_xl_zext(ptrdiff_t __offset, const unsigned int *__pointer) {17921return (vector unsigned __int128)*(__pointer + __offset);17922}1792317924static __inline__ vector unsigned __int128 __ATTRS_o_ai17925vec_xl_zext(ptrdiff_t __offset, const unsigned long long *__pointer) {17926return (vector unsigned __int128)*(__pointer + __offset);17927}1792817929#endif1793017931/* vec_xlds */17932#ifdef __VSX__17933static __inline__ vector signed long long __ATTRS_o_ai17934vec_xlds(ptrdiff_t __offset, const signed long long *__ptr) {17935signed long long *__addr = (signed long long*)((signed char *)__ptr + __offset);17936return (vector signed long long) *__addr;17937}1793817939static __inline__ vector unsigned long long __ATTRS_o_ai17940vec_xlds(ptrdiff_t __offset, const unsigned long long *__ptr) {17941unsigned long long *__addr = (unsigned long long *)((signed char *)__ptr + __offset);17942return (unaligned_vec_ull) *__addr;17943}1794417945static __inline__ vector double __ATTRS_o_ai vec_xlds(ptrdiff_t __offset,17946const double *__ptr) {17947double *__addr = (double*)((signed char *)__ptr + __offset);17948return (unaligned_vec_double) *__addr;17949}1795017951/* vec_load_splats */17952static __inline__ vector signed int __ATTRS_o_ai17953vec_load_splats(signed long long __offset, const signed int *__ptr) {17954signed int *__addr = (signed int*)((signed char *)__ptr + __offset);17955return (vector signed int)*__addr;17956}1795717958static __inline__ vector signed int __ATTRS_o_ai17959vec_load_splats(unsigned long long __offset, const signed int *__ptr) {17960signed int *__addr = (signed int*)((signed char *)__ptr + __offset);17961return (vector signed int)*__addr;17962}1796317964static __inline__ vector unsigned int __ATTRS_o_ai17965vec_load_splats(signed long long __offset, const unsigned int *__ptr) {17966unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);17967return (vector unsigned int)*__addr;17968}1796917970static __inline__ vector unsigned int __ATTRS_o_ai17971vec_load_splats(unsigned long long __offset, const unsigned int *__ptr) {17972unsigned int *__addr = (unsigned int*)((signed char *)__ptr + __offset);17973return (vector unsigned int)*__addr;17974}1797517976static __inline__ vector float __ATTRS_o_ai17977vec_load_splats(signed long long __offset, const float *__ptr) {17978float *__addr = (float*)((signed char *)__ptr + __offset);17979return (vector float)*__addr;17980}1798117982static __inline__ vector float __ATTRS_o_ai17983vec_load_splats(unsigned long long __offset, const float *__ptr) {17984float *__addr = (float*)((signed char *)__ptr + __offset);17985return (vector float)*__addr;17986}17987#endif1798817989/* vec_xst */1799017991#define vec_xstd2 vec_xst17992#define vec_xstw4 vec_xst17993static inline __ATTRS_o_ai void17994vec_xst(vector signed char __vec, ptrdiff_t __offset, signed char *__ptr) {17995*(unaligned_vec_schar *)(__ptr + __offset) = __vec;17996}1799717998static inline __ATTRS_o_ai void17999vec_xst(vector unsigned char __vec, ptrdiff_t __offset, unsigned char *__ptr) {18000*(unaligned_vec_uchar *)(__ptr + __offset) = __vec;18001}1800218003static inline __ATTRS_o_ai void18004vec_xst(vector signed short __vec, ptrdiff_t __offset, signed short *__ptr) {18005signed char *__addr = (signed char *)__ptr + __offset;18006*(unaligned_vec_sshort *)__addr = __vec;18007}1800818009static inline __ATTRS_o_ai void vec_xst(vector unsigned short __vec,18010ptrdiff_t __offset,18011unsigned short *__ptr) {18012signed char *__addr = (signed char *)__ptr + __offset;18013*(unaligned_vec_ushort *)__addr = __vec;18014}1801518016static inline __ATTRS_o_ai void vec_xst(vector signed int __vec,18017ptrdiff_t __offset, signed int *__ptr) {18018signed char *__addr = (signed char *)__ptr + __offset;18019*(unaligned_vec_sint *)__addr = __vec;18020}1802118022static inline __ATTRS_o_ai void18023vec_xst(vector unsigned int __vec, ptrdiff_t __offset, unsigned int *__ptr) {18024signed char *__addr = (signed char *)__ptr + __offset;18025*(unaligned_vec_uint *)__addr = __vec;18026}1802718028static inline __ATTRS_o_ai void vec_xst(vector float __vec, ptrdiff_t __offset,18029float *__ptr) {18030signed char *__addr = (signed char *)__ptr + __offset;18031*(unaligned_vec_float *)__addr = __vec;18032}1803318034#ifdef __VSX__18035static inline __ATTRS_o_ai void vec_xst(vector signed long long __vec,18036ptrdiff_t __offset,18037signed long long *__ptr) {18038signed char *__addr = (signed char *)__ptr + __offset;18039*(unaligned_vec_sll *)__addr = __vec;18040}1804118042static inline __ATTRS_o_ai void vec_xst(vector unsigned long long __vec,18043ptrdiff_t __offset,18044unsigned long long *__ptr) {18045signed char *__addr = (signed char *)__ptr + __offset;18046*(unaligned_vec_ull *)__addr = __vec;18047}1804818049static inline __ATTRS_o_ai void vec_xst(vector double __vec, ptrdiff_t __offset,18050double *__ptr) {18051signed char *__addr = (signed char *)__ptr + __offset;18052*(unaligned_vec_double *)__addr = __vec;18053}18054#endif1805518056#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \18057defined(__SIZEOF_INT128__)18058static inline __ATTRS_o_ai void vec_xst(vector signed __int128 __vec,18059ptrdiff_t __offset,18060signed __int128 *__ptr) {18061signed char *__addr = (signed char *)__ptr + __offset;18062*(unaligned_vec_si128 *)__addr = __vec;18063}1806418065static inline __ATTRS_o_ai void vec_xst(vector unsigned __int128 __vec,18066ptrdiff_t __offset,18067unsigned __int128 *__ptr) {18068signed char *__addr = (signed char *)__ptr + __offset;18069*(unaligned_vec_ui128 *)__addr = __vec;18070}18071#endif1807218073/* vec_xst_trunc */1807418075#if defined(__POWER10_VECTOR__) && defined(__VSX__) && \18076defined(__SIZEOF_INT128__)18077static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,18078ptrdiff_t __offset,18079signed char *__ptr) {18080*(__ptr + __offset) = (signed char)__vec[0];18081}1808218083static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,18084ptrdiff_t __offset,18085unsigned char *__ptr) {18086*(__ptr + __offset) = (unsigned char)__vec[0];18087}1808818089static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,18090ptrdiff_t __offset,18091signed short *__ptr) {18092*(__ptr + __offset) = (signed short)__vec[0];18093}1809418095static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,18096ptrdiff_t __offset,18097unsigned short *__ptr) {18098*(__ptr + __offset) = (unsigned short)__vec[0];18099}1810018101static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,18102ptrdiff_t __offset,18103signed int *__ptr) {18104*(__ptr + __offset) = (signed int)__vec[0];18105}1810618107static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,18108ptrdiff_t __offset,18109unsigned int *__ptr) {18110*(__ptr + __offset) = (unsigned int)__vec[0];18111}1811218113static inline __ATTRS_o_ai void vec_xst_trunc(vector signed __int128 __vec,18114ptrdiff_t __offset,18115signed long long *__ptr) {18116*(__ptr + __offset) = (signed long long)__vec[0];18117}1811818119static inline __ATTRS_o_ai void vec_xst_trunc(vector unsigned __int128 __vec,18120ptrdiff_t __offset,18121unsigned long long *__ptr) {18122*(__ptr + __offset) = (unsigned long long)__vec[0];18123}18124#endif1812518126/* vec_xst_be */1812718128#ifdef __LITTLE_ENDIAN__18129static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed char __vec,18130signed long long __offset,18131signed char *__ptr) {18132vector signed char __tmp =18133__builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,1813413, 12, 11, 10, 9, 8);18135typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;18136__builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);18137}1813818139static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned char __vec,18140signed long long __offset,18141unsigned char *__ptr) {18142vector unsigned char __tmp =18143__builtin_shufflevector(__vec, __vec, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14,1814413, 12, 11, 10, 9, 8);18145typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;18146__builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);18147}1814818149static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed short __vec,18150signed long long __offset,18151signed short *__ptr) {18152vector signed short __tmp =18153__builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);18154typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;18155__builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);18156}1815718158static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned short __vec,18159signed long long __offset,18160unsigned short *__ptr) {18161vector unsigned short __tmp =18162__builtin_shufflevector(__vec, __vec, 3, 2, 1, 0, 7, 6, 5, 4);18163typedef __attribute__((vector_size(sizeof(__tmp)))) double __vector_double;18164__builtin_vsx_stxvd2x_be((__vector_double)__tmp, __offset, __ptr);18165}1816618167static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed int __vec,18168signed long long __offset,18169signed int *__ptr) {18170__builtin_vsx_stxvw4x_be(__vec, __offset, __ptr);18171}1817218173static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned int __vec,18174signed long long __offset,18175unsigned int *__ptr) {18176__builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);18177}1817818179static __inline__ void __ATTRS_o_ai vec_xst_be(vector float __vec,18180signed long long __offset,18181float *__ptr) {18182__builtin_vsx_stxvw4x_be((vector int)__vec, __offset, __ptr);18183}1818418185#ifdef __VSX__18186static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed long long __vec,18187signed long long __offset,18188signed long long *__ptr) {18189__builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);18190}1819118192static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned long long __vec,18193signed long long __offset,18194unsigned long long *__ptr) {18195__builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);18196}1819718198static __inline__ void __ATTRS_o_ai vec_xst_be(vector double __vec,18199signed long long __offset,18200double *__ptr) {18201__builtin_vsx_stxvd2x_be((vector double)__vec, __offset, __ptr);18202}18203#endif1820418205#if defined(__POWER8_VECTOR__) && defined(__powerpc64__) && \18206defined(__SIZEOF_INT128__)18207static __inline__ void __ATTRS_o_ai vec_xst_be(vector signed __int128 __vec,18208signed long long __offset,18209signed __int128 *__ptr) {18210vec_xst(__vec, __offset, __ptr);18211}1821218213static __inline__ void __ATTRS_o_ai vec_xst_be(vector unsigned __int128 __vec,18214signed long long __offset,18215unsigned __int128 *__ptr) {18216vec_xst(__vec, __offset, __ptr);18217}18218#endif18219#else18220#define vec_xst_be vec_xst18221#endif1822218223#ifdef __POWER9_VECTOR__18224#define vec_test_data_class(__a, __b) \18225_Generic( \18226(__a), vector float \18227: (vector bool int)__builtin_vsx_xvtstdcsp((vector float)(__a), (__b)), \18228vector double \18229: (vector bool long long)__builtin_vsx_xvtstdcdp((vector double)(__a), \18230(__b)))1823118232#endif /* #ifdef __POWER9_VECTOR__ */1823318234static vector float __ATTRS_o_ai vec_neg(vector float __a) {18235return -__a;18236}1823718238#ifdef __VSX__18239static vector double __ATTRS_o_ai vec_neg(vector double __a) {18240return -__a;18241}1824218243#endif1824418245#ifdef __VSX__18246static vector long long __ATTRS_o_ai vec_neg(vector long long __a) {18247return -__a;18248}18249#endif1825018251static vector signed int __ATTRS_o_ai vec_neg(vector signed int __a) {18252return -__a;18253}1825418255static vector signed short __ATTRS_o_ai vec_neg(vector signed short __a) {18256return -__a;18257}1825818259static vector signed char __ATTRS_o_ai vec_neg(vector signed char __a) {18260return -__a;18261}1826218263static vector float __ATTRS_o_ai vec_nabs(vector float __a) {18264return - vec_abs(__a);18265}1826618267#ifdef __VSX__18268static vector double __ATTRS_o_ai vec_nabs(vector double __a) {18269return - vec_abs(__a);18270}1827118272#endif1827318274#ifdef __POWER8_VECTOR__18275static vector long long __ATTRS_o_ai vec_nabs(vector long long __a) {18276return __builtin_altivec_vminsd(__a, -__a);18277}18278#endif1827918280static vector signed int __ATTRS_o_ai vec_nabs(vector signed int __a) {18281return __builtin_altivec_vminsw(__a, -__a);18282}1828318284static vector signed short __ATTRS_o_ai vec_nabs(vector signed short __a) {18285return __builtin_altivec_vminsh(__a, -__a);18286}1828718288static vector signed char __ATTRS_o_ai vec_nabs(vector signed char __a) {18289return __builtin_altivec_vminsb(__a, -__a);18290}1829118292static vector float __ATTRS_o_ai vec_recipdiv(vector float __a,18293vector float __b) {18294return __builtin_ppc_recipdivf(__a, __b);18295}1829618297#ifdef __VSX__18298static vector double __ATTRS_o_ai vec_recipdiv(vector double __a,18299vector double __b) {18300return __builtin_ppc_recipdivd(__a, __b);18301}18302#endif1830318304#ifdef __POWER10_VECTOR__1830518306/* vec_extractm */1830718308static __inline__ unsigned int __ATTRS_o_ai18309vec_extractm(vector unsigned char __a) {18310return __builtin_altivec_vextractbm(__a);18311}1831218313static __inline__ unsigned int __ATTRS_o_ai18314vec_extractm(vector unsigned short __a) {18315return __builtin_altivec_vextracthm(__a);18316}1831718318static __inline__ unsigned int __ATTRS_o_ai18319vec_extractm(vector unsigned int __a) {18320return __builtin_altivec_vextractwm(__a);18321}1832218323static __inline__ unsigned int __ATTRS_o_ai18324vec_extractm(vector unsigned long long __a) {18325return __builtin_altivec_vextractdm(__a);18326}1832718328#ifdef __SIZEOF_INT128__18329static __inline__ unsigned int __ATTRS_o_ai18330vec_extractm(vector unsigned __int128 __a) {18331return __builtin_altivec_vextractqm(__a);18332}18333#endif1833418335/* vec_expandm */1833618337static __inline__ vector unsigned char __ATTRS_o_ai18338vec_expandm(vector unsigned char __a) {18339return __builtin_altivec_vexpandbm(__a);18340}1834118342static __inline__ vector unsigned short __ATTRS_o_ai18343vec_expandm(vector unsigned short __a) {18344return __builtin_altivec_vexpandhm(__a);18345}1834618347static __inline__ vector unsigned int __ATTRS_o_ai18348vec_expandm(vector unsigned int __a) {18349return __builtin_altivec_vexpandwm(__a);18350}1835118352static __inline__ vector unsigned long long __ATTRS_o_ai18353vec_expandm(vector unsigned long long __a) {18354return __builtin_altivec_vexpanddm(__a);18355}1835618357#ifdef __SIZEOF_INT128__18358static __inline__ vector unsigned __int128 __ATTRS_o_ai18359vec_expandm(vector unsigned __int128 __a) {18360return __builtin_altivec_vexpandqm(__a);18361}18362#endif1836318364/* vec_cntm */1836518366#define vec_cntm(__a, __mp) \18367_Generic((__a), vector unsigned char \18368: __builtin_altivec_vcntmbb((vector unsigned char)(__a), \18369(unsigned char)(__mp)), \18370vector unsigned short \18371: __builtin_altivec_vcntmbh((vector unsigned short)(__a), \18372(unsigned char)(__mp)), \18373vector unsigned int \18374: __builtin_altivec_vcntmbw((vector unsigned int)(__a), \18375(unsigned char)(__mp)), \18376vector unsigned long long \18377: __builtin_altivec_vcntmbd((vector unsigned long long)(__a), \18378(unsigned char)(__mp)))1837918380/* vec_gen[b|h|w|d|q]m */1838118382static __inline__ vector unsigned char __ATTRS_o_ai18383vec_genbm(unsigned long long __bm) {18384return __builtin_altivec_mtvsrbm(__bm);18385}1838618387static __inline__ vector unsigned short __ATTRS_o_ai18388vec_genhm(unsigned long long __bm) {18389return __builtin_altivec_mtvsrhm(__bm);18390}1839118392static __inline__ vector unsigned int __ATTRS_o_ai18393vec_genwm(unsigned long long __bm) {18394return __builtin_altivec_mtvsrwm(__bm);18395}1839618397static __inline__ vector unsigned long long __ATTRS_o_ai18398vec_gendm(unsigned long long __bm) {18399return __builtin_altivec_mtvsrdm(__bm);18400}1840118402#ifdef __SIZEOF_INT128__18403static __inline__ vector unsigned __int128 __ATTRS_o_ai18404vec_genqm(unsigned long long __bm) {18405return __builtin_altivec_mtvsrqm(__bm);18406}18407#endif1840818409/* vec_pdep */1841018411static __inline__ vector unsigned long long __ATTRS_o_ai18412vec_pdep(vector unsigned long long __a, vector unsigned long long __b) {18413return __builtin_altivec_vpdepd(__a, __b);18414}1841518416/* vec_pext */1841718418static __inline__ vector unsigned long long __ATTRS_o_ai18419vec_pext(vector unsigned long long __a, vector unsigned long long __b) {18420return __builtin_altivec_vpextd(__a, __b);18421}1842218423/* vec_cfuge */1842418425static __inline__ vector unsigned long long __ATTRS_o_ai18426vec_cfuge(vector unsigned long long __a, vector unsigned long long __b) {18427return __builtin_altivec_vcfuged(__a, __b);18428}1842918430/* vec_gnb */1843118432#define vec_gnb(__a, __b) __builtin_altivec_vgnb(__a, __b)1843318434/* vec_ternarylogic */18435#ifdef __VSX__18436#ifdef __SIZEOF_INT128__18437#define vec_ternarylogic(__a, __b, __c, __imm) \18438_Generic((__a), vector unsigned char \18439: (vector unsigned char)__builtin_vsx_xxeval( \18440(vector unsigned long long)(__a), \18441(vector unsigned long long)(__b), \18442(vector unsigned long long)(__c), (__imm)), \18443vector unsigned short \18444: (vector unsigned short)__builtin_vsx_xxeval( \18445(vector unsigned long long)(__a), \18446(vector unsigned long long)(__b), \18447(vector unsigned long long)(__c), (__imm)), \18448vector unsigned int \18449: (vector unsigned int)__builtin_vsx_xxeval( \18450(vector unsigned long long)(__a), \18451(vector unsigned long long)(__b), \18452(vector unsigned long long)(__c), (__imm)), \18453vector unsigned long long \18454: (vector unsigned long long)__builtin_vsx_xxeval( \18455(vector unsigned long long)(__a), \18456(vector unsigned long long)(__b), \18457(vector unsigned long long)(__c), (__imm)), \18458vector unsigned __int128 \18459: (vector unsigned __int128)__builtin_vsx_xxeval( \18460(vector unsigned long long)(__a), \18461(vector unsigned long long)(__b), \18462(vector unsigned long long)(__c), (__imm)))18463#else18464#define vec_ternarylogic(__a, __b, __c, __imm) \18465_Generic((__a), vector unsigned char \18466: (vector unsigned char)__builtin_vsx_xxeval( \18467(vector unsigned long long)(__a), \18468(vector unsigned long long)(__b), \18469(vector unsigned long long)(__c), (__imm)), \18470vector unsigned short \18471: (vector unsigned short)__builtin_vsx_xxeval( \18472(vector unsigned long long)(__a), \18473(vector unsigned long long)(__b), \18474(vector unsigned long long)(__c), (__imm)), \18475vector unsigned int \18476: (vector unsigned int)__builtin_vsx_xxeval( \18477(vector unsigned long long)(__a), \18478(vector unsigned long long)(__b), \18479(vector unsigned long long)(__c), (__imm)), \18480vector unsigned long long \18481: (vector unsigned long long)__builtin_vsx_xxeval( \18482(vector unsigned long long)(__a), \18483(vector unsigned long long)(__b), \18484(vector unsigned long long)(__c), (__imm)))18485#endif /* __SIZEOF_INT128__ */18486#endif /* __VSX__ */1848718488/* vec_genpcvm */1848918490#ifdef __VSX__18491#define vec_genpcvm(__a, __imm) \18492_Generic( \18493(__a), vector unsigned char \18494: __builtin_vsx_xxgenpcvbm((vector unsigned char)(__a), (int)(__imm)), \18495vector unsigned short \18496: __builtin_vsx_xxgenpcvhm((vector unsigned short)(__a), (int)(__imm)), \18497vector unsigned int \18498: __builtin_vsx_xxgenpcvwm((vector unsigned int)(__a), (int)(__imm)), \18499vector unsigned long long \18500: __builtin_vsx_xxgenpcvdm((vector unsigned long long)(__a), \18501(int)(__imm)))18502#endif /* __VSX__ */1850318504/* vec_clr_first */1850518506static __inline__ vector signed char __ATTRS_o_ai18507vec_clr_first(vector signed char __a, unsigned int __n) {18508#ifdef __LITTLE_ENDIAN__18509return (vector signed char)__builtin_altivec_vclrrb((vector unsigned char)__a,18510__n);18511#else18512return (vector signed char)__builtin_altivec_vclrlb((vector unsigned char)__a,18513__n);18514#endif18515}1851618517static __inline__ vector unsigned char __ATTRS_o_ai18518vec_clr_first(vector unsigned char __a, unsigned int __n) {18519#ifdef __LITTLE_ENDIAN__18520return (vector unsigned char)__builtin_altivec_vclrrb(18521(vector unsigned char)__a, __n);18522#else18523return (vector unsigned char)__builtin_altivec_vclrlb(18524(vector unsigned char)__a, __n);18525#endif18526}1852718528/* vec_clr_last */1852918530static __inline__ vector signed char __ATTRS_o_ai18531vec_clr_last(vector signed char __a, unsigned int __n) {18532#ifdef __LITTLE_ENDIAN__18533return (vector signed char)__builtin_altivec_vclrlb((vector unsigned char)__a,18534__n);18535#else18536return (vector signed char)__builtin_altivec_vclrrb((vector unsigned char)__a,18537__n);18538#endif18539}1854018541static __inline__ vector unsigned char __ATTRS_o_ai18542vec_clr_last(vector unsigned char __a, unsigned int __n) {18543#ifdef __LITTLE_ENDIAN__18544return (vector unsigned char)__builtin_altivec_vclrlb(18545(vector unsigned char)__a, __n);18546#else18547return (vector unsigned char)__builtin_altivec_vclrrb(18548(vector unsigned char)__a, __n);18549#endif18550}1855118552/* vec_cntlzm */1855318554static __inline__ vector unsigned long long __ATTRS_o_ai18555vec_cntlzm(vector unsigned long long __a, vector unsigned long long __b) {18556return __builtin_altivec_vclzdm(__a, __b);18557}1855818559/* vec_cnttzm */1856018561static __inline__ vector unsigned long long __ATTRS_o_ai18562vec_cnttzm(vector unsigned long long __a, vector unsigned long long __b) {18563return __builtin_altivec_vctzdm(__a, __b);18564}1856518566/* vec_mod */1856718568static __inline__ vector signed int __ATTRS_o_ai18569vec_mod(vector signed int __a, vector signed int __b) {18570return __a % __b;18571}1857218573static __inline__ vector unsigned int __ATTRS_o_ai18574vec_mod(vector unsigned int __a, vector unsigned int __b) {18575return __a % __b;18576}1857718578static __inline__ vector signed long long __ATTRS_o_ai18579vec_mod(vector signed long long __a, vector signed long long __b) {18580return __a % __b;18581}1858218583static __inline__ vector unsigned long long __ATTRS_o_ai18584vec_mod(vector unsigned long long __a, vector unsigned long long __b) {18585return __a % __b;18586}1858718588#ifdef __SIZEOF_INT128__18589static __inline__ vector signed __int128 __ATTRS_o_ai18590vec_mod(vector signed __int128 __a, vector signed __int128 __b) {18591return __a % __b;18592}1859318594static __inline__ vector unsigned __int128 __ATTRS_o_ai18595vec_mod(vector unsigned __int128 __a, vector unsigned __int128 __b) {18596return __a % __b;18597}18598#endif1859918600/* vec_sldb */18601#define vec_sldb(__a, __b, __c) \18602_Generic( \18603(__a), vector unsigned char \18604: (vector unsigned char)__builtin_altivec_vsldbi( \18605(vector unsigned char)__a, (vector unsigned char)__b, \18606(__c & 0x7)), \18607vector signed char \18608: (vector signed char)__builtin_altivec_vsldbi( \18609(vector unsigned char)__a, (vector unsigned char)__b, \18610(__c & 0x7)), \18611vector unsigned short \18612: (vector unsigned short)__builtin_altivec_vsldbi( \18613(vector unsigned char)__a, (vector unsigned char)__b, \18614(__c & 0x7)), \18615vector signed short \18616: (vector signed short)__builtin_altivec_vsldbi( \18617(vector unsigned char)__a, (vector unsigned char)__b, \18618(__c & 0x7)), \18619vector unsigned int \18620: (vector unsigned int)__builtin_altivec_vsldbi( \18621(vector unsigned char)__a, (vector unsigned char)__b, \18622(__c & 0x7)), \18623vector signed int \18624: (vector signed int)__builtin_altivec_vsldbi((vector unsigned char)__a, \18625(vector unsigned char)__b, \18626(__c & 0x7)), \18627vector unsigned long long \18628: (vector unsigned long long)__builtin_altivec_vsldbi( \18629(vector unsigned char)__a, (vector unsigned char)__b, \18630(__c & 0x7)), \18631vector signed long long \18632: (vector signed long long)__builtin_altivec_vsldbi( \18633(vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))1863418635/* vec_srdb */18636#define vec_srdb(__a, __b, __c) \18637_Generic( \18638(__a), vector unsigned char \18639: (vector unsigned char)__builtin_altivec_vsrdbi( \18640(vector unsigned char)__a, (vector unsigned char)__b, \18641(__c & 0x7)), \18642vector signed char \18643: (vector signed char)__builtin_altivec_vsrdbi( \18644(vector unsigned char)__a, (vector unsigned char)__b, \18645(__c & 0x7)), \18646vector unsigned short \18647: (vector unsigned short)__builtin_altivec_vsrdbi( \18648(vector unsigned char)__a, (vector unsigned char)__b, \18649(__c & 0x7)), \18650vector signed short \18651: (vector signed short)__builtin_altivec_vsrdbi( \18652(vector unsigned char)__a, (vector unsigned char)__b, \18653(__c & 0x7)), \18654vector unsigned int \18655: (vector unsigned int)__builtin_altivec_vsrdbi( \18656(vector unsigned char)__a, (vector unsigned char)__b, \18657(__c & 0x7)), \18658vector signed int \18659: (vector signed int)__builtin_altivec_vsrdbi((vector unsigned char)__a, \18660(vector unsigned char)__b, \18661(__c & 0x7)), \18662vector unsigned long long \18663: (vector unsigned long long)__builtin_altivec_vsrdbi( \18664(vector unsigned char)__a, (vector unsigned char)__b, \18665(__c & 0x7)), \18666vector signed long long \18667: (vector signed long long)__builtin_altivec_vsrdbi( \18668(vector unsigned char)__a, (vector unsigned char)__b, (__c & 0x7)))1866918670/* vec_insertl */1867118672static __inline__ vector unsigned char __ATTRS_o_ai18673vec_insertl(unsigned char __a, vector unsigned char __b, unsigned int __c) {18674#ifdef __LITTLE_ENDIAN__18675return __builtin_altivec_vinsbrx(__b, __c, __a);18676#else18677return __builtin_altivec_vinsblx(__b, __c, __a);18678#endif18679}1868018681static __inline__ vector unsigned short __ATTRS_o_ai18682vec_insertl(unsigned short __a, vector unsigned short __b, unsigned int __c) {18683#ifdef __LITTLE_ENDIAN__18684return __builtin_altivec_vinshrx(__b, __c, __a);18685#else18686return __builtin_altivec_vinshlx(__b, __c, __a);18687#endif18688}1868918690static __inline__ vector unsigned int __ATTRS_o_ai18691vec_insertl(unsigned int __a, vector unsigned int __b, unsigned int __c) {18692#ifdef __LITTLE_ENDIAN__18693return __builtin_altivec_vinswrx(__b, __c, __a);18694#else18695return __builtin_altivec_vinswlx(__b, __c, __a);18696#endif18697}1869818699static __inline__ vector unsigned long long __ATTRS_o_ai18700vec_insertl(unsigned long long __a, vector unsigned long long __b,18701unsigned int __c) {18702#ifdef __LITTLE_ENDIAN__18703return __builtin_altivec_vinsdrx(__b, __c, __a);18704#else18705return __builtin_altivec_vinsdlx(__b, __c, __a);18706#endif18707}1870818709static __inline__ vector unsigned char __ATTRS_o_ai18710vec_insertl(vector unsigned char __a, vector unsigned char __b,18711unsigned int __c) {18712#ifdef __LITTLE_ENDIAN__18713return __builtin_altivec_vinsbvrx(__b, __c, __a);18714#else18715return __builtin_altivec_vinsbvlx(__b, __c, __a);18716#endif18717}1871818719static __inline__ vector unsigned short __ATTRS_o_ai18720vec_insertl(vector unsigned short __a, vector unsigned short __b,18721unsigned int __c) {18722#ifdef __LITTLE_ENDIAN__18723return __builtin_altivec_vinshvrx(__b, __c, __a);18724#else18725return __builtin_altivec_vinshvlx(__b, __c, __a);18726#endif18727}1872818729static __inline__ vector unsigned int __ATTRS_o_ai18730vec_insertl(vector unsigned int __a, vector unsigned int __b,18731unsigned int __c) {18732#ifdef __LITTLE_ENDIAN__18733return __builtin_altivec_vinswvrx(__b, __c, __a);18734#else18735return __builtin_altivec_vinswvlx(__b, __c, __a);18736#endif18737}1873818739/* vec_inserth */1874018741static __inline__ vector unsigned char __ATTRS_o_ai18742vec_inserth(unsigned char __a, vector unsigned char __b, unsigned int __c) {18743#ifdef __LITTLE_ENDIAN__18744return __builtin_altivec_vinsblx(__b, __c, __a);18745#else18746return __builtin_altivec_vinsbrx(__b, __c, __a);18747#endif18748}1874918750static __inline__ vector unsigned short __ATTRS_o_ai18751vec_inserth(unsigned short __a, vector unsigned short __b, unsigned int __c) {18752#ifdef __LITTLE_ENDIAN__18753return __builtin_altivec_vinshlx(__b, __c, __a);18754#else18755return __builtin_altivec_vinshrx(__b, __c, __a);18756#endif18757}1875818759static __inline__ vector unsigned int __ATTRS_o_ai18760vec_inserth(unsigned int __a, vector unsigned int __b, unsigned int __c) {18761#ifdef __LITTLE_ENDIAN__18762return __builtin_altivec_vinswlx(__b, __c, __a);18763#else18764return __builtin_altivec_vinswrx(__b, __c, __a);18765#endif18766}1876718768static __inline__ vector unsigned long long __ATTRS_o_ai18769vec_inserth(unsigned long long __a, vector unsigned long long __b,18770unsigned int __c) {18771#ifdef __LITTLE_ENDIAN__18772return __builtin_altivec_vinsdlx(__b, __c, __a);18773#else18774return __builtin_altivec_vinsdrx(__b, __c, __a);18775#endif18776}1877718778static __inline__ vector unsigned char __ATTRS_o_ai18779vec_inserth(vector unsigned char __a, vector unsigned char __b,18780unsigned int __c) {18781#ifdef __LITTLE_ENDIAN__18782return __builtin_altivec_vinsbvlx(__b, __c, __a);18783#else18784return __builtin_altivec_vinsbvrx(__b, __c, __a);18785#endif18786}1878718788static __inline__ vector unsigned short __ATTRS_o_ai18789vec_inserth(vector unsigned short __a, vector unsigned short __b,18790unsigned int __c) {18791#ifdef __LITTLE_ENDIAN__18792return __builtin_altivec_vinshvlx(__b, __c, __a);18793#else18794return __builtin_altivec_vinshvrx(__b, __c, __a);18795#endif18796}1879718798static __inline__ vector unsigned int __ATTRS_o_ai18799vec_inserth(vector unsigned int __a, vector unsigned int __b,18800unsigned int __c) {18801#ifdef __LITTLE_ENDIAN__18802return __builtin_altivec_vinswvlx(__b, __c, __a);18803#else18804return __builtin_altivec_vinswvrx(__b, __c, __a);18805#endif18806}1880718808/* vec_extractl */1880918810static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(18811vector unsigned char __a, vector unsigned char __b, unsigned int __c) {18812#ifdef __LITTLE_ENDIAN__18813return __builtin_altivec_vextdubvrx(__a, __b, __c);18814#else18815vector unsigned long long __ret = __builtin_altivec_vextdubvlx(__a, __b, __c);18816return vec_sld(__ret, __ret, 8);18817#endif18818}1881918820static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(18821vector unsigned short __a, vector unsigned short __b, unsigned int __c) {18822#ifdef __LITTLE_ENDIAN__18823return __builtin_altivec_vextduhvrx(__a, __b, __c);18824#else18825vector unsigned long long __ret = __builtin_altivec_vextduhvlx(__a, __b, __c);18826return vec_sld(__ret, __ret, 8);18827#endif18828}1882918830static __inline__ vector unsigned long long __ATTRS_o_ai vec_extractl(18831vector unsigned int __a, vector unsigned int __b, unsigned int __c) {18832#ifdef __LITTLE_ENDIAN__18833return __builtin_altivec_vextduwvrx(__a, __b, __c);18834#else18835vector unsigned long long __ret = __builtin_altivec_vextduwvlx(__a, __b, __c);18836return vec_sld(__ret, __ret, 8);18837#endif18838}1883918840static __inline__ vector unsigned long long __ATTRS_o_ai18841vec_extractl(vector unsigned long long __a, vector unsigned long long __b,18842unsigned int __c) {18843#ifdef __LITTLE_ENDIAN__18844return __builtin_altivec_vextddvrx(__a, __b, __c);18845#else18846vector unsigned long long __ret = __builtin_altivec_vextddvlx(__a, __b, __c);18847return vec_sld(__ret, __ret, 8);18848#endif18849}1885018851/* vec_extracth */1885218853static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(18854vector unsigned char __a, vector unsigned char __b, unsigned int __c) {18855#ifdef __LITTLE_ENDIAN__18856return __builtin_altivec_vextdubvlx(__a, __b, __c);18857#else18858vector unsigned long long __ret = __builtin_altivec_vextdubvrx(__a, __b, __c);18859return vec_sld(__ret, __ret, 8);18860#endif18861}1886218863static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(18864vector unsigned short __a, vector unsigned short __b, unsigned int __c) {18865#ifdef __LITTLE_ENDIAN__18866return __builtin_altivec_vextduhvlx(__a, __b, __c);18867#else18868vector unsigned long long __ret = __builtin_altivec_vextduhvrx(__a, __b, __c);18869return vec_sld(__ret, __ret, 8);18870#endif18871}1887218873static __inline__ vector unsigned long long __ATTRS_o_ai vec_extracth(18874vector unsigned int __a, vector unsigned int __b, unsigned int __c) {18875#ifdef __LITTLE_ENDIAN__18876return __builtin_altivec_vextduwvlx(__a, __b, __c);18877#else18878vector unsigned long long __ret = __builtin_altivec_vextduwvrx(__a, __b, __c);18879return vec_sld(__ret, __ret, 8);18880#endif18881}1888218883static __inline__ vector unsigned long long __ATTRS_o_ai18884vec_extracth(vector unsigned long long __a, vector unsigned long long __b,18885unsigned int __c) {18886#ifdef __LITTLE_ENDIAN__18887return __builtin_altivec_vextddvlx(__a, __b, __c);18888#else18889vector unsigned long long __ret = __builtin_altivec_vextddvrx(__a, __b, __c);18890return vec_sld(__ret, __ret, 8);18891#endif18892}1889318894#ifdef __VSX__1889518896/* vec_permx */18897#define vec_permx(__a, __b, __c, __d) \18898_Generic( \18899(__a), vector unsigned char \18900: (vector unsigned char)__builtin_vsx_xxpermx( \18901(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18902vector signed char \18903: (vector signed char)__builtin_vsx_xxpermx( \18904(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18905vector unsigned short \18906: (vector unsigned short)__builtin_vsx_xxpermx( \18907(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18908vector signed short \18909: (vector signed short)__builtin_vsx_xxpermx( \18910(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18911vector unsigned int \18912: (vector unsigned int)__builtin_vsx_xxpermx( \18913(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18914vector signed int \18915: (vector signed int)__builtin_vsx_xxpermx( \18916(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18917vector unsigned long long \18918: (vector unsigned long long)__builtin_vsx_xxpermx( \18919(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18920vector signed long long \18921: (vector signed long long)__builtin_vsx_xxpermx( \18922(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18923vector float \18924: (vector float)__builtin_vsx_xxpermx( \18925(vector unsigned char)__a, (vector unsigned char)__b, __c, __d), \18926vector double \18927: (vector double)__builtin_vsx_xxpermx( \18928(vector unsigned char)__a, (vector unsigned char)__b, __c, __d))1892918930/* vec_blendv */1893118932static __inline__ vector signed char __ATTRS_o_ai18933vec_blendv(vector signed char __a, vector signed char __b,18934vector unsigned char __c) {18935return (vector signed char)__builtin_vsx_xxblendvb(18936(vector unsigned char)__a, (vector unsigned char)__b, __c);18937}1893818939static __inline__ vector unsigned char __ATTRS_o_ai18940vec_blendv(vector unsigned char __a, vector unsigned char __b,18941vector unsigned char __c) {18942return __builtin_vsx_xxblendvb(__a, __b, __c);18943}1894418945static __inline__ vector signed short __ATTRS_o_ai18946vec_blendv(vector signed short __a, vector signed short __b,18947vector unsigned short __c) {18948return (vector signed short)__builtin_vsx_xxblendvh(18949(vector unsigned short)__a, (vector unsigned short)__b, __c);18950}1895118952static __inline__ vector unsigned short __ATTRS_o_ai18953vec_blendv(vector unsigned short __a, vector unsigned short __b,18954vector unsigned short __c) {18955return __builtin_vsx_xxblendvh(__a, __b, __c);18956}1895718958static __inline__ vector signed int __ATTRS_o_ai18959vec_blendv(vector signed int __a, vector signed int __b,18960vector unsigned int __c) {18961return (vector signed int)__builtin_vsx_xxblendvw(18962(vector unsigned int)__a, (vector unsigned int)__b, __c);18963}1896418965static __inline__ vector unsigned int __ATTRS_o_ai18966vec_blendv(vector unsigned int __a, vector unsigned int __b,18967vector unsigned int __c) {18968return __builtin_vsx_xxblendvw(__a, __b, __c);18969}1897018971static __inline__ vector signed long long __ATTRS_o_ai18972vec_blendv(vector signed long long __a, vector signed long long __b,18973vector unsigned long long __c) {18974return (vector signed long long)__builtin_vsx_xxblendvd(18975(vector unsigned long long)__a, (vector unsigned long long)__b, __c);18976}1897718978static __inline__ vector unsigned long long __ATTRS_o_ai18979vec_blendv(vector unsigned long long __a, vector unsigned long long __b,18980vector unsigned long long __c) {18981return (vector unsigned long long)__builtin_vsx_xxblendvd(__a, __b, __c);18982}1898318984static __inline__ vector float __ATTRS_o_ai18985vec_blendv(vector float __a, vector float __b, vector unsigned int __c) {18986return (vector float)__builtin_vsx_xxblendvw((vector unsigned int)__a,18987(vector unsigned int)__b, __c);18988}1898918990static __inline__ vector double __ATTRS_o_ai18991vec_blendv(vector double __a, vector double __b,18992vector unsigned long long __c) {18993return (vector double)__builtin_vsx_xxblendvd(18994(vector unsigned long long)__a, (vector unsigned long long)__b, __c);18995}1899618997#define vec_replace_unaligned(__a, __b, __c) \18998_Generic((__a), vector signed int \18999: __builtin_altivec_vinsw((vector unsigned char)__a, \19000(unsigned int)__b, __c), \19001vector unsigned int \19002: __builtin_altivec_vinsw((vector unsigned char)__a, \19003(unsigned int)__b, __c), \19004vector unsigned long long \19005: __builtin_altivec_vinsd((vector unsigned char)__a, \19006(unsigned long long)__b, __c), \19007vector signed long long \19008: __builtin_altivec_vinsd((vector unsigned char)__a, \19009(unsigned long long)__b, __c), \19010vector float \19011: __builtin_altivec_vinsw((vector unsigned char)__a, \19012(unsigned int)__b, __c), \19013vector double \19014: __builtin_altivec_vinsd((vector unsigned char)__a, \19015(unsigned long long)__b, __c))1901619017#define vec_replace_elt(__a, __b, __c) \19018_Generic((__a), vector signed int \19019: (vector signed int)__builtin_altivec_vinsw_elt( \19020(vector unsigned char)__a, (unsigned int)__b, __c), \19021vector unsigned int \19022: (vector unsigned int)__builtin_altivec_vinsw_elt( \19023(vector unsigned char)__a, (unsigned int)__b, __c), \19024vector unsigned long long \19025: (vector unsigned long long)__builtin_altivec_vinsd_elt( \19026(vector unsigned char)__a, (unsigned long long)__b, __c), \19027vector signed long long \19028: (vector signed long long)__builtin_altivec_vinsd_elt( \19029(vector unsigned char)__a, (unsigned long long)__b, __c), \19030vector float \19031: (vector float)__builtin_altivec_vinsw_elt( \19032(vector unsigned char)__a, (unsigned int)__b, __c), \19033vector double \19034: (vector double)__builtin_altivec_vinsd_elt( \19035(vector unsigned char)__a, (unsigned long long)__b, __c))1903619037/* vec_splati */1903819039#define vec_splati(__a) \19040_Generic((__a), signed int \19041: ((vector signed int)__a), unsigned int \19042: ((vector unsigned int)__a), float \19043: ((vector float)__a))1904419045/* vec_spatid */1904619047static __inline__ vector double __ATTRS_o_ai vec_splatid(const float __a) {19048return ((vector double)((double)__a));19049}1905019051/* vec_splati_ins */1905219053static __inline__ vector signed int __ATTRS_o_ai vec_splati_ins(19054vector signed int __a, const unsigned int __b, const signed int __c) {19055const unsigned int __d = __b & 0x01;19056#ifdef __LITTLE_ENDIAN__19057__a[1 - __d] = __c;19058__a[3 - __d] = __c;19059#else19060__a[__d] = __c;19061__a[2 + __d] = __c;19062#endif19063return __a;19064}1906519066static __inline__ vector unsigned int __ATTRS_o_ai vec_splati_ins(19067vector unsigned int __a, const unsigned int __b, const unsigned int __c) {19068const unsigned int __d = __b & 0x01;19069#ifdef __LITTLE_ENDIAN__19070__a[1 - __d] = __c;19071__a[3 - __d] = __c;19072#else19073__a[__d] = __c;19074__a[2 + __d] = __c;19075#endif19076return __a;19077}1907819079static __inline__ vector float __ATTRS_o_ai19080vec_splati_ins(vector float __a, const unsigned int __b, const float __c) {19081const unsigned int __d = __b & 0x01;19082#ifdef __LITTLE_ENDIAN__19083__a[1 - __d] = __c;19084__a[3 - __d] = __c;19085#else19086__a[__d] = __c;19087__a[2 + __d] = __c;19088#endif19089return __a;19090}1909119092/* vec_test_lsbb_all_ones */1909319094static __inline__ int __ATTRS_o_ai19095vec_test_lsbb_all_ones(vector unsigned char __a) {19096return __builtin_vsx_xvtlsbb(__a, 1);19097}1909819099/* vec_test_lsbb_all_zeros */1910019101static __inline__ int __ATTRS_o_ai19102vec_test_lsbb_all_zeros(vector unsigned char __a) {19103return __builtin_vsx_xvtlsbb(__a, 0);19104}19105#endif /* __VSX__ */1910619107/* vec_stril */1910819109static __inline__ vector unsigned char __ATTRS_o_ai19110vec_stril(vector unsigned char __a) {19111#ifdef __LITTLE_ENDIAN__19112return (vector unsigned char)__builtin_altivec_vstribr(19113(vector unsigned char)__a);19114#else19115return (vector unsigned char)__builtin_altivec_vstribl(19116(vector unsigned char)__a);19117#endif19118}1911919120static __inline__ vector signed char __ATTRS_o_ai19121vec_stril(vector signed char __a) {19122#ifdef __LITTLE_ENDIAN__19123return (vector signed char)__builtin_altivec_vstribr(19124(vector unsigned char)__a);19125#else19126return (vector signed char)__builtin_altivec_vstribl(19127(vector unsigned char)__a);19128#endif19129}1913019131static __inline__ vector unsigned short __ATTRS_o_ai19132vec_stril(vector unsigned short __a) {19133#ifdef __LITTLE_ENDIAN__19134return (vector unsigned short)__builtin_altivec_vstrihr(19135(vector signed short)__a);19136#else19137return (vector unsigned short)__builtin_altivec_vstrihl(19138(vector signed short)__a);19139#endif19140}1914119142static __inline__ vector signed short __ATTRS_o_ai19143vec_stril(vector signed short __a) {19144#ifdef __LITTLE_ENDIAN__19145return __builtin_altivec_vstrihr(__a);19146#else19147return __builtin_altivec_vstrihl(__a);19148#endif19149}1915019151/* vec_stril_p */1915219153static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned char __a) {19154#ifdef __LITTLE_ENDIAN__19155return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);19156#else19157return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);19158#endif19159}1916019161static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed char __a) {19162#ifdef __LITTLE_ENDIAN__19163return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);19164#else19165return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);19166#endif19167}1916819169static __inline__ int __ATTRS_o_ai vec_stril_p(vector unsigned short __a) {19170#ifdef __LITTLE_ENDIAN__19171return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);19172#else19173return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);19174#endif19175}1917619177static __inline__ int __ATTRS_o_ai vec_stril_p(vector signed short __a) {19178#ifdef __LITTLE_ENDIAN__19179return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);19180#else19181return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);19182#endif19183}1918419185/* vec_strir */1918619187static __inline__ vector unsigned char __ATTRS_o_ai19188vec_strir(vector unsigned char __a) {19189#ifdef __LITTLE_ENDIAN__19190return (vector unsigned char)__builtin_altivec_vstribl(19191(vector unsigned char)__a);19192#else19193return (vector unsigned char)__builtin_altivec_vstribr(19194(vector unsigned char)__a);19195#endif19196}1919719198static __inline__ vector signed char __ATTRS_o_ai19199vec_strir(vector signed char __a) {19200#ifdef __LITTLE_ENDIAN__19201return (vector signed char)__builtin_altivec_vstribl(19202(vector unsigned char)__a);19203#else19204return (vector signed char)__builtin_altivec_vstribr(19205(vector unsigned char)__a);19206#endif19207}1920819209static __inline__ vector unsigned short __ATTRS_o_ai19210vec_strir(vector unsigned short __a) {19211#ifdef __LITTLE_ENDIAN__19212return (vector unsigned short)__builtin_altivec_vstrihl(19213(vector signed short)__a);19214#else19215return (vector unsigned short)__builtin_altivec_vstrihr(19216(vector signed short)__a);19217#endif19218}1921919220static __inline__ vector signed short __ATTRS_o_ai19221vec_strir(vector signed short __a) {19222#ifdef __LITTLE_ENDIAN__19223return __builtin_altivec_vstrihl(__a);19224#else19225return __builtin_altivec_vstrihr(__a);19226#endif19227}1922819229/* vec_strir_p */1923019231static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned char __a) {19232#ifdef __LITTLE_ENDIAN__19233return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);19234#else19235return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);19236#endif19237}1923819239static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed char __a) {19240#ifdef __LITTLE_ENDIAN__19241return __builtin_altivec_vstribl_p(__CR6_EQ, (vector unsigned char)__a);19242#else19243return __builtin_altivec_vstribr_p(__CR6_EQ, (vector unsigned char)__a);19244#endif19245}1924619247static __inline__ int __ATTRS_o_ai vec_strir_p(vector unsigned short __a) {19248#ifdef __LITTLE_ENDIAN__19249return __builtin_altivec_vstrihl_p(__CR6_EQ, (vector signed short)__a);19250#else19251return __builtin_altivec_vstrihr_p(__CR6_EQ, (vector signed short)__a);19252#endif19253}1925419255static __inline__ int __ATTRS_o_ai vec_strir_p(vector signed short __a) {19256#ifdef __LITTLE_ENDIAN__19257return __builtin_altivec_vstrihl_p(__CR6_EQ, __a);19258#else19259return __builtin_altivec_vstrihr_p(__CR6_EQ, __a);19260#endif19261}1926219263/* vs[l | r | ra] */1926419265#ifdef __SIZEOF_INT128__19266static __inline__ vector unsigned __int128 __ATTRS_o_ai19267vec_sl(vector unsigned __int128 __a, vector unsigned __int128 __b) {19268return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *19269__CHAR_BIT__));19270}1927119272static __inline__ vector signed __int128 __ATTRS_o_ai19273vec_sl(vector signed __int128 __a, vector unsigned __int128 __b) {19274return __a << (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *19275__CHAR_BIT__));19276}1927719278static __inline__ vector unsigned __int128 __ATTRS_o_ai19279vec_sr(vector unsigned __int128 __a, vector unsigned __int128 __b) {19280return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *19281__CHAR_BIT__));19282}1928319284static __inline__ vector signed __int128 __ATTRS_o_ai19285vec_sr(vector signed __int128 __a, vector unsigned __int128 __b) {19286return (19287vector signed __int128)(((vector unsigned __int128)__a) >>19288(__b %19289(vector unsigned __int128)(sizeof(19290unsigned __int128) *19291__CHAR_BIT__)));19292}1929319294static __inline__ vector unsigned __int128 __ATTRS_o_ai19295vec_sra(vector unsigned __int128 __a, vector unsigned __int128 __b) {19296return (19297vector unsigned __int128)(((vector signed __int128)__a) >>19298(__b %19299(vector unsigned __int128)(sizeof(19300unsigned __int128) *19301__CHAR_BIT__)));19302}1930319304static __inline__ vector signed __int128 __ATTRS_o_ai19305vec_sra(vector signed __int128 __a, vector unsigned __int128 __b) {19306return __a >> (__b % (vector unsigned __int128)(sizeof(unsigned __int128) *19307__CHAR_BIT__));19308}1930919310#endif /* __SIZEOF_INT128__ */19311#endif /* __POWER10_VECTOR__ */1931219313#ifdef __POWER8_VECTOR__19314#define __bcdadd(__a, __b, __ps) __builtin_ppc_bcdadd((__a), (__b), (__ps))19315#define __bcdsub(__a, __b, __ps) __builtin_ppc_bcdsub((__a), (__b), (__ps))1931619317static __inline__ long __bcdadd_ofl(vector unsigned char __a,19318vector unsigned char __b) {19319return __builtin_ppc_bcdadd_p(__CR6_SO, __a, __b);19320}1932119322static __inline__ long __bcdsub_ofl(vector unsigned char __a,19323vector unsigned char __b) {19324return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __b);19325}1932619327static __inline__ long __bcd_invalid(vector unsigned char __a) {19328return __builtin_ppc_bcdsub_p(__CR6_SO, __a, __a);19329}1933019331static __inline__ long __bcdcmpeq(vector unsigned char __a,19332vector unsigned char __b) {19333return __builtin_ppc_bcdsub_p(__CR6_EQ, __a, __b);19334}1933519336static __inline__ long __bcdcmplt(vector unsigned char __a,19337vector unsigned char __b) {19338return __builtin_ppc_bcdsub_p(__CR6_LT, __a, __b);19339}1934019341static __inline__ long __bcdcmpgt(vector unsigned char __a,19342vector unsigned char __b) {19343return __builtin_ppc_bcdsub_p(__CR6_GT, __a, __b);19344}1934519346static __inline__ long __bcdcmple(vector unsigned char __a,19347vector unsigned char __b) {19348return __builtin_ppc_bcdsub_p(__CR6_GT_REV, __a, __b);19349}1935019351static __inline__ long __bcdcmpge(vector unsigned char __a,19352vector unsigned char __b) {19353return __builtin_ppc_bcdsub_p(__CR6_LT_REV, __a, __b);19354}1935519356#endif // __POWER8_VECTOR__1935719358#undef __ATTRS_o_ai1935919360#endif /* __ALTIVEC_H */193611936219363