blob: 1fd7436b2c60a10059c7ceebeb707051116f197d [file] [log] [blame]
/*===---- vecintrin.h - Vector intrinsics ----------------------------------===
*
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
* See https://llvm.org/LICENSE.txt for license information.
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
*
*===-----------------------------------------------------------------------===
*/
#if defined(__s390x__) && defined(__VEC__)
#define __ATTRS_ai __attribute__((__always_inline__))
#define __ATTRS_o __attribute__((__overloadable__))
#define __ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
#define __constant(PARM) \
__attribute__((__enable_if__ ((PARM) == (PARM), \
"argument must be a constant integer")))
#define __constant_range(PARM, LOW, HIGH) \
__attribute__((__enable_if__ ((PARM) >= (LOW) && (PARM) <= (HIGH), \
"argument must be a constant integer from " #LOW " to " #HIGH)))
#define __constant_pow2_range(PARM, LOW, HIGH) \
__attribute__((__enable_if__ ((PARM) >= (LOW) && (PARM) <= (HIGH) && \
((PARM) & ((PARM) - 1)) == 0, \
"argument must be a constant power of 2 from " #LOW " to " #HIGH)))
/*-- __lcbb -----------------------------------------------------------------*/
extern __ATTRS_o unsigned int
__lcbb(const void *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
#define __lcbb(X, Y) ((__typeof__((__lcbb)((X), (Y)))) \
__builtin_s390_lcbb((X), __builtin_constant_p((Y))? \
((Y) == 64 ? 0 : \
(Y) == 128 ? 1 : \
(Y) == 256 ? 2 : \
(Y) == 512 ? 3 : \
(Y) == 1024 ? 4 : \
(Y) == 2048 ? 5 : \
(Y) == 4096 ? 6 : 0) : 0))
/*-- vec_extract ------------------------------------------------------------*/
static inline __ATTRS_o_ai signed char
vec_extract(__vector signed char __vec, int __index) {
return __vec[__index & 15];
}
static inline __ATTRS_o_ai unsigned char
vec_extract(__vector __bool char __vec, int __index) {
return __vec[__index & 15];
}
static inline __ATTRS_o_ai unsigned char
vec_extract(__vector unsigned char __vec, int __index) {
return __vec[__index & 15];
}
static inline __ATTRS_o_ai signed short
vec_extract(__vector signed short __vec, int __index) {
return __vec[__index & 7];
}
static inline __ATTRS_o_ai unsigned short
vec_extract(__vector __bool short __vec, int __index) {
return __vec[__index & 7];
}
static inline __ATTRS_o_ai unsigned short
vec_extract(__vector unsigned short __vec, int __index) {
return __vec[__index & 7];
}
static inline __ATTRS_o_ai signed int
vec_extract(__vector signed int __vec, int __index) {
return __vec[__index & 3];
}
static inline __ATTRS_o_ai unsigned int
vec_extract(__vector __bool int __vec, int __index) {
return __vec[__index & 3];
}
static inline __ATTRS_o_ai unsigned int
vec_extract(__vector unsigned int __vec, int __index) {
return __vec[__index & 3];
}
static inline __ATTRS_o_ai signed long long
vec_extract(__vector signed long long __vec, int __index) {
return __vec[__index & 1];
}
static inline __ATTRS_o_ai unsigned long long
vec_extract(__vector __bool long long __vec, int __index) {
return __vec[__index & 1];
}
static inline __ATTRS_o_ai unsigned long long
vec_extract(__vector unsigned long long __vec, int __index) {
return __vec[__index & 1];
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai float
vec_extract(__vector float __vec, int __index) {
return __vec[__index & 3];
}
#endif
static inline __ATTRS_o_ai double
vec_extract(__vector double __vec, int __index) {
return __vec[__index & 1];
}
/*-- vec_insert -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_insert(signed char __scalar, __vector signed char __vec, int __index) {
__vec[__index & 15] = __scalar;
return __vec;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_insert(unsigned char __scalar, __vector __bool char __vec, int __index) {
__vector unsigned char __newvec = (__vector unsigned char)__vec;
__newvec[__index & 15] = (unsigned char)__scalar;
return __newvec;
}
static inline __ATTRS_o_ai __vector unsigned char
vec_insert(unsigned char __scalar, __vector unsigned char __vec, int __index) {
__vec[__index & 15] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed short
vec_insert(signed short __scalar, __vector signed short __vec, int __index) {
__vec[__index & 7] = __scalar;
return __vec;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_insert(unsigned short __scalar, __vector __bool short __vec,
int __index) {
__vector unsigned short __newvec = (__vector unsigned short)__vec;
__newvec[__index & 7] = (unsigned short)__scalar;
return __newvec;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_insert(unsigned short __scalar, __vector unsigned short __vec,
int __index) {
__vec[__index & 7] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed int
vec_insert(signed int __scalar, __vector signed int __vec, int __index) {
__vec[__index & 3] = __scalar;
return __vec;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_insert(unsigned int __scalar, __vector __bool int __vec, int __index) {
__vector unsigned int __newvec = (__vector unsigned int)__vec;
__newvec[__index & 3] = __scalar;
return __newvec;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_insert(unsigned int __scalar, __vector unsigned int __vec, int __index) {
__vec[__index & 3] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed long long
vec_insert(signed long long __scalar, __vector signed long long __vec,
int __index) {
__vec[__index & 1] = __scalar;
return __vec;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_insert(unsigned long long __scalar, __vector __bool long long __vec,
int __index) {
__vector unsigned long long __newvec = (__vector unsigned long long)__vec;
__newvec[__index & 1] = __scalar;
return __newvec;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_insert(unsigned long long __scalar, __vector unsigned long long __vec,
int __index) {
__vec[__index & 1] = __scalar;
return __vec;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_insert(float __scalar, __vector float __vec, int __index) {
__vec[__index & 1] = __scalar;
return __vec;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_insert(double __scalar, __vector double __vec, int __index) {
__vec[__index & 1] = __scalar;
return __vec;
}
/*-- vec_promote ------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_promote(signed char __scalar, int __index) {
const __vector signed char __zero = (__vector signed char)0;
__vector signed char __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
__vec[__index & 15] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned char
vec_promote(unsigned char __scalar, int __index) {
const __vector unsigned char __zero = (__vector unsigned char)0;
__vector unsigned char __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
__vec[__index & 15] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed short
vec_promote(signed short __scalar, int __index) {
const __vector signed short __zero = (__vector signed short)0;
__vector signed short __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1, -1, -1, -1, -1);
__vec[__index & 7] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_promote(unsigned short __scalar, int __index) {
const __vector unsigned short __zero = (__vector unsigned short)0;
__vector unsigned short __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1, -1, -1, -1, -1);
__vec[__index & 7] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed int
vec_promote(signed int __scalar, int __index) {
const __vector signed int __zero = (__vector signed int)0;
__vector signed int __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1);
__vec[__index & 3] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_promote(unsigned int __scalar, int __index) {
const __vector unsigned int __zero = (__vector unsigned int)0;
__vector unsigned int __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1);
__vec[__index & 3] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector signed long long
vec_promote(signed long long __scalar, int __index) {
const __vector signed long long __zero = (__vector signed long long)0;
__vector signed long long __vec = __builtin_shufflevector(__zero, __zero,
-1, -1);
__vec[__index & 1] = __scalar;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_promote(unsigned long long __scalar, int __index) {
const __vector unsigned long long __zero = (__vector unsigned long long)0;
__vector unsigned long long __vec = __builtin_shufflevector(__zero, __zero,
-1, -1);
__vec[__index & 1] = __scalar;
return __vec;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_promote(float __scalar, int __index) {
const __vector float __zero = (__vector float)0.0f;
__vector float __vec = __builtin_shufflevector(__zero, __zero,
-1, -1, -1, -1);
__vec[__index & 3] = __scalar;
return __vec;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_promote(double __scalar, int __index) {
const __vector double __zero = (__vector double)0.0;
__vector double __vec = __builtin_shufflevector(__zero, __zero, -1, -1);
__vec[__index & 1] = __scalar;
return __vec;
}
/*-- vec_insert_and_zero ----------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_insert_and_zero(const signed char *__ptr) {
__vector signed char __vec = (__vector signed char)0;
__vec[7] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned char
vec_insert_and_zero(const unsigned char *__ptr) {
__vector unsigned char __vec = (__vector unsigned char)0;
__vec[7] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector signed short
vec_insert_and_zero(const signed short *__ptr) {
__vector signed short __vec = (__vector signed short)0;
__vec[3] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_insert_and_zero(const unsigned short *__ptr) {
__vector unsigned short __vec = (__vector unsigned short)0;
__vec[3] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector signed int
vec_insert_and_zero(const signed int *__ptr) {
__vector signed int __vec = (__vector signed int)0;
__vec[1] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_insert_and_zero(const unsigned int *__ptr) {
__vector unsigned int __vec = (__vector unsigned int)0;
__vec[1] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector signed long long
vec_insert_and_zero(const signed long long *__ptr) {
__vector signed long long __vec = (__vector signed long long)0;
__vec[0] = *__ptr;
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_insert_and_zero(const unsigned long long *__ptr) {
__vector unsigned long long __vec = (__vector unsigned long long)0;
__vec[0] = *__ptr;
return __vec;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_insert_and_zero(const float *__ptr) {
__vector float __vec = (__vector float)0.0f;
__vec[1] = *__ptr;
return __vec;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_insert_and_zero(const double *__ptr) {
__vector double __vec = (__vector double)0.0;
__vec[0] = *__ptr;
return __vec;
}
/*-- vec_perm ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_perm(__vector signed char __a, __vector signed char __b,
__vector unsigned char __c) {
return (__vector signed char)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_perm(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
return (__vector unsigned char)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector __bool char
vec_perm(__vector __bool char __a, __vector __bool char __b,
__vector unsigned char __c) {
return (__vector __bool char)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector signed short
vec_perm(__vector signed short __a, __vector signed short __b,
__vector unsigned char __c) {
return (__vector signed short)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_perm(__vector unsigned short __a, __vector unsigned short __b,
__vector unsigned char __c) {
return (__vector unsigned short)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector __bool short
vec_perm(__vector __bool short __a, __vector __bool short __b,
__vector unsigned char __c) {
return (__vector __bool short)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector signed int
vec_perm(__vector signed int __a, __vector signed int __b,
__vector unsigned char __c) {
return (__vector signed int)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_perm(__vector unsigned int __a, __vector unsigned int __b,
__vector unsigned char __c) {
return (__vector unsigned int)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector __bool int
vec_perm(__vector __bool int __a, __vector __bool int __b,
__vector unsigned char __c) {
return (__vector __bool int)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector signed long long
vec_perm(__vector signed long long __a, __vector signed long long __b,
__vector unsigned char __c) {
return (__vector signed long long)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_perm(__vector unsigned long long __a, __vector unsigned long long __b,
__vector unsigned char __c) {
return (__vector unsigned long long)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
static inline __ATTRS_o_ai __vector __bool long long
vec_perm(__vector __bool long long __a, __vector __bool long long __b,
__vector unsigned char __c) {
return (__vector __bool long long)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_perm(__vector float __a, __vector float __b,
__vector unsigned char __c) {
return (__vector float)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
#endif
static inline __ATTRS_o_ai __vector double
vec_perm(__vector double __a, __vector double __b,
__vector unsigned char __c) {
return (__vector double)__builtin_s390_vperm(
(__vector unsigned char)__a, (__vector unsigned char)__b, __c);
}
/*-- vec_permi --------------------------------------------------------------*/
// This prototype is deprecated.
extern __ATTRS_o __vector signed long long
vec_permi(__vector signed long long __a, __vector signed long long __b,
int __c)
__constant_range(__c, 0, 3);
// This prototype is deprecated.
extern __ATTRS_o __vector unsigned long long
vec_permi(__vector unsigned long long __a, __vector unsigned long long __b,
int __c)
__constant_range(__c, 0, 3);
// This prototype is deprecated.
extern __ATTRS_o __vector __bool long long
vec_permi(__vector __bool long long __a, __vector __bool long long __b,
int __c)
__constant_range(__c, 0, 3);
// This prototype is deprecated.
extern __ATTRS_o __vector double
vec_permi(__vector double __a, __vector double __b, int __c)
__constant_range(__c, 0, 3);
#define vec_permi(X, Y, Z) ((__typeof__((vec_permi)((X), (Y), (Z)))) \
__builtin_s390_vpdi((__vector unsigned long long)(X), \
(__vector unsigned long long)(Y), \
(((Z) & 2) << 1) | ((Z) & 1)))
/*-- vec_bperm_u128 ---------------------------------------------------------*/
#if __ARCH__ >= 12
static inline __ATTRS_ai __vector unsigned long long
vec_bperm_u128(__vector unsigned char __a, __vector unsigned char __b) {
return __builtin_s390_vbperm(__a, __b);
}
#endif
/*-- vec_revb ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
vec_revb(__vector signed short __vec) {
return (__vector signed short)
__builtin_s390_vlbrh((__vector unsigned short)__vec);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_revb(__vector unsigned short __vec) {
return __builtin_s390_vlbrh(__vec);
}
static inline __ATTRS_o_ai __vector signed int
vec_revb(__vector signed int __vec) {
return (__vector signed int)
__builtin_s390_vlbrf((__vector unsigned int)__vec);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_revb(__vector unsigned int __vec) {
return __builtin_s390_vlbrf(__vec);
}
static inline __ATTRS_o_ai __vector signed long long
vec_revb(__vector signed long long __vec) {
return (__vector signed long long)
__builtin_s390_vlbrg((__vector unsigned long long)__vec);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_revb(__vector unsigned long long __vec) {
return __builtin_s390_vlbrg(__vec);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_revb(__vector float __vec) {
return (__vector float)
__builtin_s390_vlbrf((__vector unsigned int)__vec);
}
#endif
static inline __ATTRS_o_ai __vector double
vec_revb(__vector double __vec) {
return (__vector double)
__builtin_s390_vlbrg((__vector unsigned long long)__vec);
}
/*-- vec_reve ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_reve(__vector signed char __vec) {
return (__vector signed char) { __vec[15], __vec[14], __vec[13], __vec[12],
__vec[11], __vec[10], __vec[9], __vec[8],
__vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector unsigned char
vec_reve(__vector unsigned char __vec) {
return (__vector unsigned char) { __vec[15], __vec[14], __vec[13], __vec[12],
__vec[11], __vec[10], __vec[9], __vec[8],
__vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector __bool char
vec_reve(__vector __bool char __vec) {
return (__vector __bool char) { __vec[15], __vec[14], __vec[13], __vec[12],
__vec[11], __vec[10], __vec[9], __vec[8],
__vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector signed short
vec_reve(__vector signed short __vec) {
return (__vector signed short) { __vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector unsigned short
vec_reve(__vector unsigned short __vec) {
return (__vector unsigned short) { __vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector __bool short
vec_reve(__vector __bool short __vec) {
return (__vector __bool short) { __vec[7], __vec[6], __vec[5], __vec[4],
__vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector signed int
vec_reve(__vector signed int __vec) {
return (__vector signed int) { __vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector unsigned int
vec_reve(__vector unsigned int __vec) {
return (__vector unsigned int) { __vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector __bool int
vec_reve(__vector __bool int __vec) {
return (__vector __bool int) { __vec[3], __vec[2], __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector signed long long
vec_reve(__vector signed long long __vec) {
return (__vector signed long long) { __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_reve(__vector unsigned long long __vec) {
return (__vector unsigned long long) { __vec[1], __vec[0] };
}
static inline __ATTRS_o_ai __vector __bool long long
vec_reve(__vector __bool long long __vec) {
return (__vector __bool long long) { __vec[1], __vec[0] };
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_reve(__vector float __vec) {
return (__vector float) { __vec[3], __vec[2], __vec[1], __vec[0] };
}
#endif
static inline __ATTRS_o_ai __vector double
vec_reve(__vector double __vec) {
return (__vector double) { __vec[1], __vec[0] };
}
/*-- vec_sel ----------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_sel(__vector signed char __a, __vector signed char __b,
__vector unsigned char __c) {
return (((__vector signed char)__c & __b) |
(~(__vector signed char)__c & __a));
}
static inline __ATTRS_o_ai __vector signed char
vec_sel(__vector signed char __a, __vector signed char __b,
__vector __bool char __c) {
return (((__vector signed char)__c & __b) |
(~(__vector signed char)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool char
vec_sel(__vector __bool char __a, __vector __bool char __b,
__vector unsigned char __c) {
return (((__vector __bool char)__c & __b) |
(~(__vector __bool char)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool char
vec_sel(__vector __bool char __a, __vector __bool char __b,
__vector __bool char __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_sel(__vector unsigned char __a, __vector unsigned char __b,
__vector unsigned char __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_sel(__vector unsigned char __a, __vector unsigned char __b,
__vector __bool char __c) {
return (((__vector unsigned char)__c & __b) |
(~(__vector unsigned char)__c & __a));
}
static inline __ATTRS_o_ai __vector signed short
vec_sel(__vector signed short __a, __vector signed short __b,
__vector unsigned short __c) {
return (((__vector signed short)__c & __b) |
(~(__vector signed short)__c & __a));
}
static inline __ATTRS_o_ai __vector signed short
vec_sel(__vector signed short __a, __vector signed short __b,
__vector __bool short __c) {
return (((__vector signed short)__c & __b) |
(~(__vector signed short)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool short
vec_sel(__vector __bool short __a, __vector __bool short __b,
__vector unsigned short __c) {
return (((__vector __bool short)__c & __b) |
(~(__vector __bool short)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool short
vec_sel(__vector __bool short __a, __vector __bool short __b,
__vector __bool short __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_sel(__vector unsigned short __a, __vector unsigned short __b,
__vector unsigned short __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_sel(__vector unsigned short __a, __vector unsigned short __b,
__vector __bool short __c) {
return (((__vector unsigned short)__c & __b) |
(~(__vector unsigned short)__c & __a));
}
static inline __ATTRS_o_ai __vector signed int
vec_sel(__vector signed int __a, __vector signed int __b,
__vector unsigned int __c) {
return (((__vector signed int)__c & __b) |
(~(__vector signed int)__c & __a));
}
static inline __ATTRS_o_ai __vector signed int
vec_sel(__vector signed int __a, __vector signed int __b,
__vector __bool int __c) {
return (((__vector signed int)__c & __b) |
(~(__vector signed int)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool int
vec_sel(__vector __bool int __a, __vector __bool int __b,
__vector unsigned int __c) {
return (((__vector __bool int)__c & __b) |
(~(__vector __bool int)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool int
vec_sel(__vector __bool int __a, __vector __bool int __b,
__vector __bool int __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_sel(__vector unsigned int __a, __vector unsigned int __b,
__vector unsigned int __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_sel(__vector unsigned int __a, __vector unsigned int __b,
__vector __bool int __c) {
return (((__vector unsigned int)__c & __b) |
(~(__vector unsigned int)__c & __a));
}
static inline __ATTRS_o_ai __vector signed long long
vec_sel(__vector signed long long __a, __vector signed long long __b,
__vector unsigned long long __c) {
return (((__vector signed long long)__c & __b) |
(~(__vector signed long long)__c & __a));
}
static inline __ATTRS_o_ai __vector signed long long
vec_sel(__vector signed long long __a, __vector signed long long __b,
__vector __bool long long __c) {
return (((__vector signed long long)__c & __b) |
(~(__vector signed long long)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool long long
vec_sel(__vector __bool long long __a, __vector __bool long long __b,
__vector unsigned long long __c) {
return (((__vector __bool long long)__c & __b) |
(~(__vector __bool long long)__c & __a));
}
static inline __ATTRS_o_ai __vector __bool long long
vec_sel(__vector __bool long long __a, __vector __bool long long __b,
__vector __bool long long __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_sel(__vector unsigned long long __a, __vector unsigned long long __b,
__vector unsigned long long __c) {
return (__c & __b) | (~__c & __a);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_sel(__vector unsigned long long __a, __vector unsigned long long __b,
__vector __bool long long __c) {
return (((__vector unsigned long long)__c & __b) |
(~(__vector unsigned long long)__c & __a));
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_sel(__vector float __a, __vector float __b, __vector unsigned int __c) {
return (__vector float)((__c & (__vector unsigned int)__b) |
(~__c & (__vector unsigned int)__a));
}
static inline __ATTRS_o_ai __vector float
vec_sel(__vector float __a, __vector float __b, __vector __bool int __c) {
__vector unsigned int __ac = (__vector unsigned int)__a;
__vector unsigned int __bc = (__vector unsigned int)__b;
__vector unsigned int __cc = (__vector unsigned int)__c;
return (__vector float)((__cc & __bc) | (~__cc & __ac));
}
#endif
static inline __ATTRS_o_ai __vector double
vec_sel(__vector double __a, __vector double __b,
__vector unsigned long long __c) {
return (__vector double)((__c & (__vector unsigned long long)__b) |
(~__c & (__vector unsigned long long)__a));
}
static inline __ATTRS_o_ai __vector double
vec_sel(__vector double __a, __vector double __b,
__vector __bool long long __c) {
__vector unsigned long long __ac = (__vector unsigned long long)__a;
__vector unsigned long long __bc = (__vector unsigned long long)__b;
__vector unsigned long long __cc = (__vector unsigned long long)__c;
return (__vector double)((__cc & __bc) | (~__cc & __ac));
}
/*-- vec_gather_element -----------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed int
vec_gather_element(__vector signed int __vec,
__vector unsigned int __offset,
const signed int *__ptr, int __index)
__constant_range(__index, 0, 3) {
__vec[__index] = *(const signed int *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
static inline __ATTRS_o_ai __vector __bool int
vec_gather_element(__vector __bool int __vec,
__vector unsigned int __offset,
const unsigned int *__ptr, int __index)
__constant_range(__index, 0, 3) {
__vec[__index] = *(const unsigned int *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_gather_element(__vector unsigned int __vec,
__vector unsigned int __offset,
const unsigned int *__ptr, int __index)
__constant_range(__index, 0, 3) {
__vec[__index] = *(const unsigned int *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
static inline __ATTRS_o_ai __vector signed long long
vec_gather_element(__vector signed long long __vec,
__vector unsigned long long __offset,
const signed long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
__vec[__index] = *(const signed long long *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
static inline __ATTRS_o_ai __vector __bool long long
vec_gather_element(__vector __bool long long __vec,
__vector unsigned long long __offset,
const unsigned long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
__vec[__index] = *(const unsigned long long *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_gather_element(__vector unsigned long long __vec,
__vector unsigned long long __offset,
const unsigned long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
__vec[__index] = *(const unsigned long long *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_gather_element(__vector float __vec,
__vector unsigned int __offset,
const float *__ptr, int __index)
__constant_range(__index, 0, 3) {
__vec[__index] = *(const float *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_gather_element(__vector double __vec,
__vector unsigned long long __offset,
const double *__ptr, int __index)
__constant_range(__index, 0, 1) {
__vec[__index] = *(const double *)(
(const char *)__ptr + __offset[__index]);
return __vec;
}
/*-- vec_scatter_element ----------------------------------------------------*/
static inline __ATTRS_o_ai void
vec_scatter_element(__vector signed int __vec,
__vector unsigned int __offset,
signed int *__ptr, int __index)
__constant_range(__index, 0, 3) {
*(signed int *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
static inline __ATTRS_o_ai void
vec_scatter_element(__vector __bool int __vec,
__vector unsigned int __offset,
unsigned int *__ptr, int __index)
__constant_range(__index, 0, 3) {
*(unsigned int *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
static inline __ATTRS_o_ai void
vec_scatter_element(__vector unsigned int __vec,
__vector unsigned int __offset,
unsigned int *__ptr, int __index)
__constant_range(__index, 0, 3) {
*(unsigned int *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
static inline __ATTRS_o_ai void
vec_scatter_element(__vector signed long long __vec,
__vector unsigned long long __offset,
signed long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
*(signed long long *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
static inline __ATTRS_o_ai void
vec_scatter_element(__vector __bool long long __vec,
__vector unsigned long long __offset,
unsigned long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
*(unsigned long long *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
static inline __ATTRS_o_ai void
vec_scatter_element(__vector unsigned long long __vec,
__vector unsigned long long __offset,
unsigned long long *__ptr, int __index)
__constant_range(__index, 0, 1) {
*(unsigned long long *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai void
vec_scatter_element(__vector float __vec,
__vector unsigned int __offset,
float *__ptr, int __index)
__constant_range(__index, 0, 3) {
*(float *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
#endif
static inline __ATTRS_o_ai void
vec_scatter_element(__vector double __vec,
__vector unsigned long long __offset,
double *__ptr, int __index)
__constant_range(__index, 0, 1) {
*(double *)((char *)__ptr + __offset[__index]) =
__vec[__index];
}
/*-- vec_xl -----------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_xl(long __offset, const signed char *__ptr) {
__vector signed char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed char));
return V;
}
static inline __ATTRS_o_ai __vector unsigned char
vec_xl(long __offset, const unsigned char *__ptr) {
__vector unsigned char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned char));
return V;
}
static inline __ATTRS_o_ai __vector signed short
vec_xl(long __offset, const signed short *__ptr) {
__vector signed short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed short));
return V;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_xl(long __offset, const unsigned short *__ptr) {
__vector unsigned short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned short));
return V;
}
static inline __ATTRS_o_ai __vector signed int
vec_xl(long __offset, const signed int *__ptr) {
__vector signed int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed int));
return V;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_xl(long __offset, const unsigned int *__ptr) {
__vector unsigned int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned int));
return V;
}
static inline __ATTRS_o_ai __vector signed long long
vec_xl(long __offset, const signed long long *__ptr) {
__vector signed long long V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed long long));
return V;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_xl(long __offset, const unsigned long long *__ptr) {
__vector unsigned long long V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned long long));
return V;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_xl(long __offset, const float *__ptr) {
__vector float V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector float));
return V;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_xl(long __offset, const double *__ptr) {
__vector double V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector double));
return V;
}
/*-- vec_xld2 ---------------------------------------------------------------*/
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed char
vec_xld2(long __offset, const signed char *__ptr) {
__vector signed char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed char));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_xld2(long __offset, const unsigned char *__ptr) {
__vector unsigned char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned char));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_xld2(long __offset, const signed short *__ptr) {
__vector signed short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed short));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_xld2(long __offset, const unsigned short *__ptr) {
__vector unsigned short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned short));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_xld2(long __offset, const signed int *__ptr) {
__vector signed int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed int));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_xld2(long __offset, const unsigned int *__ptr) {
__vector unsigned int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned int));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed long long
vec_xld2(long __offset, const signed long long *__ptr) {
__vector signed long long V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed long long));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned long long
vec_xld2(long __offset, const unsigned long long *__ptr) {
__vector unsigned long long V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned long long));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector double
vec_xld2(long __offset, const double *__ptr) {
__vector double V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector double));
return V;
}
/*-- vec_xlw4 ---------------------------------------------------------------*/
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed char
vec_xlw4(long __offset, const signed char *__ptr) {
__vector signed char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed char));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned char
vec_xlw4(long __offset, const unsigned char *__ptr) {
__vector unsigned char V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned char));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed short
vec_xlw4(long __offset, const signed short *__ptr) {
__vector signed short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed short));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned short
vec_xlw4(long __offset, const unsigned short *__ptr) {
__vector unsigned short V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned short));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector signed int
vec_xlw4(long __offset, const signed int *__ptr) {
__vector signed int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector signed int));
return V;
}
// This prototype is deprecated.
static inline __ATTRS_o_ai __vector unsigned int
vec_xlw4(long __offset, const unsigned int *__ptr) {
__vector unsigned int V;
__builtin_memcpy(&V, ((const char *)__ptr + __offset),
sizeof(__vector unsigned int));
return V;
}
/*-- vec_xst ----------------------------------------------------------------*/
static inline __ATTRS_o_ai void
vec_xst(__vector signed char __vec, long __offset, signed char *__ptr) {
__vector signed char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed char));
}
static inline __ATTRS_o_ai void
vec_xst(__vector unsigned char __vec, long __offset, unsigned char *__ptr) {
__vector unsigned char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned char));
}
static inline __ATTRS_o_ai void
vec_xst(__vector signed short __vec, long __offset, signed short *__ptr) {
__vector signed short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed short));
}
static inline __ATTRS_o_ai void
vec_xst(__vector unsigned short __vec, long __offset, unsigned short *__ptr) {
__vector unsigned short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned short));
}
static inline __ATTRS_o_ai void
vec_xst(__vector signed int __vec, long __offset, signed int *__ptr) {
__vector signed int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector signed int));
}
static inline __ATTRS_o_ai void
vec_xst(__vector unsigned int __vec, long __offset, unsigned int *__ptr) {
__vector unsigned int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned int));
}
static inline __ATTRS_o_ai void
vec_xst(__vector signed long long __vec, long __offset,
signed long long *__ptr) {
__vector signed long long V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed long long));
}
static inline __ATTRS_o_ai void
vec_xst(__vector unsigned long long __vec, long __offset,
unsigned long long *__ptr) {
__vector unsigned long long V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned long long));
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai void
vec_xst(__vector float __vec, long __offset, float *__ptr) {
__vector float V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector float));
}
#endif
static inline __ATTRS_o_ai void
vec_xst(__vector double __vec, long __offset, double *__ptr) {
__vector double V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector double));
}
/*-- vec_xstd2 --------------------------------------------------------------*/
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector signed char __vec, long __offset, signed char *__ptr) {
__vector signed char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed char));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector unsigned char __vec, long __offset, unsigned char *__ptr) {
__vector unsigned char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned char));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector signed short __vec, long __offset, signed short *__ptr) {
__vector signed short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed short));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector unsigned short __vec, long __offset, unsigned short *__ptr) {
__vector unsigned short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned short));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector signed int __vec, long __offset, signed int *__ptr) {
__vector signed int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector signed int));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector unsigned int __vec, long __offset, unsigned int *__ptr) {
__vector unsigned int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned int));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector signed long long __vec, long __offset,
signed long long *__ptr) {
__vector signed long long V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed long long));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector unsigned long long __vec, long __offset,
unsigned long long *__ptr) {
__vector unsigned long long V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned long long));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstd2(__vector double __vec, long __offset, double *__ptr) {
__vector double V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector double));
}
/*-- vec_xstw4 --------------------------------------------------------------*/
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector signed char __vec, long __offset, signed char *__ptr) {
__vector signed char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed char));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector unsigned char __vec, long __offset, unsigned char *__ptr) {
__vector unsigned char V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned char));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector signed short __vec, long __offset, signed short *__ptr) {
__vector signed short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector signed short));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector unsigned short __vec, long __offset, unsigned short *__ptr) {
__vector unsigned short V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned short));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector signed int __vec, long __offset, signed int *__ptr) {
__vector signed int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V, sizeof(__vector signed int));
}
// This prototype is deprecated.
static inline __ATTRS_o_ai void
vec_xstw4(__vector unsigned int __vec, long __offset, unsigned int *__ptr) {
__vector unsigned int V = __vec;
__builtin_memcpy(((char *)__ptr + __offset), &V,
sizeof(__vector unsigned int));
}
/*-- vec_load_bndry ---------------------------------------------------------*/
extern __ATTRS_o __vector signed char
vec_load_bndry(const signed char *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector unsigned char
vec_load_bndry(const unsigned char *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector signed short
vec_load_bndry(const signed short *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector unsigned short
vec_load_bndry(const unsigned short *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector signed int
vec_load_bndry(const signed int *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector unsigned int
vec_load_bndry(const unsigned int *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector signed long long
vec_load_bndry(const signed long long *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
extern __ATTRS_o __vector unsigned long long
vec_load_bndry(const unsigned long long *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
#if __ARCH__ >= 12
extern __ATTRS_o __vector float
vec_load_bndry(const float *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
#endif
extern __ATTRS_o __vector double
vec_load_bndry(const double *__ptr, unsigned short __len)
__constant_pow2_range(__len, 64, 4096);
#define vec_load_bndry(X, Y) ((__typeof__((vec_load_bndry)((X), (Y)))) \
__builtin_s390_vlbb((X), ((Y) == 64 ? 0 : \
(Y) == 128 ? 1 : \
(Y) == 256 ? 2 : \
(Y) == 512 ? 3 : \
(Y) == 1024 ? 4 : \
(Y) == 2048 ? 5 : \
(Y) == 4096 ? 6 : -1)))
/*-- vec_load_len -----------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_load_len(const signed char *__ptr, unsigned int __len) {
return (__vector signed char)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_load_len(const unsigned char *__ptr, unsigned int __len) {
return (__vector unsigned char)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector signed short
vec_load_len(const signed short *__ptr, unsigned int __len) {
return (__vector signed short)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_load_len(const unsigned short *__ptr, unsigned int __len) {
return (__vector unsigned short)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector signed int
vec_load_len(const signed int *__ptr, unsigned int __len) {
return (__vector signed int)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_load_len(const unsigned int *__ptr, unsigned int __len) {
return (__vector unsigned int)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector signed long long
vec_load_len(const signed long long *__ptr, unsigned int __len) {
return (__vector signed long long)__builtin_s390_vll(__len, __ptr);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_load_len(const unsigned long long *__ptr, unsigned int __len) {
return (__vector unsigned long long)__builtin_s390_vll(__len, __ptr);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_load_len(const float *__ptr, unsigned int __len) {
return (__vector float)__builtin_s390_vll(__len, __ptr);
}
#endif
static inline __ATTRS_o_ai __vector double
vec_load_len(const double *__ptr, unsigned int __len) {
return (__vector double)__builtin_s390_vll(__len, __ptr);
}
/*-- vec_load_len_r ---------------------------------------------------------*/
#if __ARCH__ >= 12
static inline __ATTRS_ai __vector unsigned char
vec_load_len_r(const unsigned char *__ptr, unsigned int __len) {
return (__vector unsigned char)__builtin_s390_vlrl(__len, __ptr);
}
#endif
/*-- vec_store_len ----------------------------------------------------------*/
static inline __ATTRS_o_ai void
vec_store_len(__vector signed char __vec, signed char *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned char __vec, unsigned char *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector signed short __vec, signed short *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned short __vec, unsigned short *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector signed int __vec, signed int *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned int __vec, unsigned int *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector signed long long __vec, signed long long *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
static inline __ATTRS_o_ai void
vec_store_len(__vector unsigned long long __vec, unsigned long long *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai void
vec_store_len(__vector float __vec, float *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
#endif
static inline __ATTRS_o_ai void
vec_store_len(__vector double __vec, double *__ptr,
unsigned int __len) {
__builtin_s390_vstl((__vector signed char)__vec, __len, __ptr);
}
/*-- vec_store_len_r --------------------------------------------------------*/
#if __ARCH__ >= 12
static inline __ATTRS_ai void
vec_store_len_r(__vector unsigned char __vec, unsigned char *__ptr,
unsigned int __len) {
__builtin_s390_vstrl((__vector signed char)__vec, __len, __ptr);
}
#endif
/*-- vec_load_pair ----------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed long long
vec_load_pair(signed long long __a, signed long long __b) {
return (__vector signed long long)(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_load_pair(unsigned long long __a, unsigned long long __b) {
return (__vector unsigned long long)(__a, __b);
}
/*-- vec_genmask ------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
vec_genmask(unsigned short __mask)
__constant(__mask) {
return (__vector unsigned char)(
__mask & 0x8000 ? 0xff : 0,
__mask & 0x4000 ? 0xff : 0,
__mask & 0x2000 ? 0xff : 0,
__mask & 0x1000 ? 0xff : 0,
__mask & 0x0800 ? 0xff : 0,
__mask & 0x0400 ? 0xff : 0,
__mask & 0x0200 ? 0xff : 0,
__mask & 0x0100 ? 0xff : 0,
__mask & 0x0080 ? 0xff : 0,
__mask & 0x0040 ? 0xff : 0,
__mask & 0x0020 ? 0xff : 0,
__mask & 0x0010 ? 0xff : 0,
__mask & 0x0008 ? 0xff : 0,
__mask & 0x0004 ? 0xff : 0,
__mask & 0x0002 ? 0xff : 0,
__mask & 0x0001 ? 0xff : 0);
}
/*-- vec_genmasks_* ---------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
vec_genmasks_8(unsigned char __first, unsigned char __last)
__constant(__first) __constant(__last) {
unsigned char __bit1 = __first & 7;
unsigned char __bit2 = __last & 7;
unsigned char __mask1 = (unsigned char)(1U << (7 - __bit1) << 1) - 1;
unsigned char __mask2 = (unsigned char)(1U << (7 - __bit2)) - 1;
unsigned char __value = (__bit1 <= __bit2 ?
__mask1 & ~__mask2 :
__mask1 | ~__mask2);
return (__vector unsigned char)__value;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_genmasks_16(unsigned char __first, unsigned char __last)
__constant(__first) __constant(__last) {
unsigned char __bit1 = __first & 15;
unsigned char __bit2 = __last & 15;
unsigned short __mask1 = (unsigned short)(1U << (15 - __bit1) << 1) - 1;
unsigned short __mask2 = (unsigned short)(1U << (15 - __bit2)) - 1;
unsigned short __value = (__bit1 <= __bit2 ?
__mask1 & ~__mask2 :
__mask1 | ~__mask2);
return (__vector unsigned short)__value;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_genmasks_32(unsigned char __first, unsigned char __last)
__constant(__first) __constant(__last) {
unsigned char __bit1 = __first & 31;
unsigned char __bit2 = __last & 31;
unsigned int __mask1 = (1U << (31 - __bit1) << 1) - 1;
unsigned int __mask2 = (1U << (31 - __bit2)) - 1;
unsigned int __value = (__bit1 <= __bit2 ?
__mask1 & ~__mask2 :
__mask1 | ~__mask2);
return (__vector unsigned int)__value;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_genmasks_64(unsigned char __first, unsigned char __last)
__constant(__first) __constant(__last) {
unsigned char __bit1 = __first & 63;
unsigned char __bit2 = __last & 63;
unsigned long long __mask1 = (1ULL << (63 - __bit1) << 1) - 1;
unsigned long long __mask2 = (1ULL << (63 - __bit2)) - 1;
unsigned long long __value = (__bit1 <= __bit2 ?
__mask1 & ~__mask2 :
__mask1 | ~__mask2);
return (__vector unsigned long long)__value;
}
/*-- vec_splat --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_splat(__vector signed char __vec, int __index)
__constant_range(__index, 0, 15) {
return (__vector signed char)__vec[__index];
}
static inline __ATTRS_o_ai __vector __bool char
vec_splat(__vector __bool char __vec, int __index)
__constant_range(__index, 0, 15) {
return (__vector __bool char)(__vector unsigned char)__vec[__index];
}
static inline __ATTRS_o_ai __vector unsigned char
vec_splat(__vector unsigned char __vec, int __index)
__constant_range(__index, 0, 15) {
return (__vector unsigned char)__vec[__index];
}
static inline __ATTRS_o_ai __vector signed short
vec_splat(__vector signed short __vec, int __index)
__constant_range(__index, 0, 7) {
return (__vector signed short)__vec[__index];
}
static inline __ATTRS_o_ai __vector __bool short
vec_splat(__vector __bool short __vec, int __index)
__constant_range(__index, 0, 7) {
return (__vector __bool short)(__vector unsigned short)__vec[__index];
}
static inline __ATTRS_o_ai __vector unsigned short
vec_splat(__vector unsigned short __vec, int __index)
__constant_range(__index, 0, 7) {
return (__vector unsigned short)__vec[__index];
}
static inline __ATTRS_o_ai __vector signed int
vec_splat(__vector signed int __vec, int __index)
__constant_range(__index, 0, 3) {
return (__vector signed int)__vec[__index];
}
static inline __ATTRS_o_ai __vector __bool int
vec_splat(__vector __bool int __vec, int __index)
__constant_range(__index, 0, 3) {
return (__vector __bool int)(__vector unsigned int)__vec[__index];
}
static inline __ATTRS_o_ai __vector unsigned int
vec_splat(__vector unsigned int __vec, int __index)
__constant_range(__index, 0, 3) {
return (__vector unsigned int)__vec[__index];
}
static inline __ATTRS_o_ai __vector signed long long
vec_splat(__vector signed long long __vec, int __index)
__constant_range(__index, 0, 1) {
return (__vector signed long long)__vec[__index];
}
static inline __ATTRS_o_ai __vector __bool long long
vec_splat(__vector __bool long long __vec, int __index)
__constant_range(__index, 0, 1) {
return ((__vector __bool long long)
(__vector unsigned long long)__vec[__index]);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_splat(__vector unsigned long long __vec, int __index)
__constant_range(__index, 0, 1) {
return (__vector unsigned long long)__vec[__index];
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_splat(__vector float __vec, int __index)
__constant_range(__index, 0, 3) {
return (__vector float)__vec[__index];
}
#endif
static inline __ATTRS_o_ai __vector double
vec_splat(__vector double __vec, int __index)
__constant_range(__index, 0, 1) {
return (__vector double)__vec[__index];
}
/*-- vec_splat_s* -----------------------------------------------------------*/
static inline __ATTRS_ai __vector signed char
vec_splat_s8(signed char __scalar)
__constant(__scalar) {
return (__vector signed char)__scalar;
}
static inline __ATTRS_ai __vector signed short
vec_splat_s16(signed short __scalar)
__constant(__scalar) {
return (__vector signed short)__scalar;
}
static inline __ATTRS_ai __vector signed int
vec_splat_s32(signed short __scalar)
__constant(__scalar) {
return (__vector signed int)(signed int)__scalar;
}
static inline __ATTRS_ai __vector signed long long
vec_splat_s64(signed short __scalar)
__constant(__scalar) {
return (__vector signed long long)(signed long)__scalar;
}
/*-- vec_splat_u* -----------------------------------------------------------*/
static inline __ATTRS_ai __vector unsigned char
vec_splat_u8(unsigned char __scalar)
__constant(__scalar) {
return (__vector unsigned char)__scalar;
}
static inline __ATTRS_ai __vector unsigned short
vec_splat_u16(unsigned short __scalar)
__constant(__scalar) {
return (__vector unsigned short)__scalar;
}
static inline __ATTRS_ai __vector unsigned int
vec_splat_u32(signed short __scalar)
__constant(__scalar) {
return (__vector unsigned int)(signed int)__scalar;
}
static inline __ATTRS_ai __vector unsigned long long
vec_splat_u64(signed short __scalar)
__constant(__scalar) {
return (__vector unsigned long long)(signed long long)__scalar;
}
/*-- vec_splats -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_splats(signed char __scalar) {
return (__vector signed char)__scalar;
}
static inline __ATTRS_o_ai __vector unsigned char
vec_splats(unsigned char __scalar) {
return (__vector unsigned char)__scalar;
}
static inline __ATTRS_o_ai __vector signed short
vec_splats(signed short __scalar) {
return (__vector signed short)__scalar;
}
static inline __ATTRS_o_ai __vector unsigned short
vec_splats(unsigned short __scalar) {
return (__vector unsigned short)__scalar;
}
static inline __ATTRS_o_ai __vector signed int
vec_splats(signed int __scalar) {
return (__vector signed int)__scalar;
}
static inline __ATTRS_o_ai __vector unsigned int
vec_splats(unsigned int __scalar) {
return (__vector unsigned int)__scalar;
}
static inline __ATTRS_o_ai __vector signed long long
vec_splats(signed long long __scalar) {
return (__vector signed long long)__scalar;
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_splats(unsigned long long __scalar) {
return (__vector unsigned long long)__scalar;
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_splats(float __scalar) {
return (__vector float)__scalar;
}
#endif
static inline __ATTRS_o_ai __vector double
vec_splats(double __scalar) {
return (__vector double)__scalar;
}
/*-- vec_extend_s64 ---------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed long long
vec_extend_s64(__vector signed char __a) {
return (__vector signed long long)(__a[7], __a[15]);
}
static inline __ATTRS_o_ai __vector signed long long
vec_extend_s64(__vector signed short __a) {
return (__vector signed long long)(__a[3], __a[7]);
}
static inline __ATTRS_o_ai __vector signed long long
vec_extend_s64(__vector signed int __a) {
return (__vector signed long long)(__a[1], __a[3]);
}
/*-- vec_mergeh -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_mergeh(__vector signed char __a, __vector signed char __b) {
return (__vector signed char)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3],
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector __bool char
vec_mergeh(__vector __bool char __a, __vector __bool char __b) {
return (__vector __bool char)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3],
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_mergeh(__vector unsigned char __a, __vector unsigned char __b) {
return (__vector unsigned char)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3],
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector signed short
vec_mergeh(__vector signed short __a, __vector signed short __b) {
return (__vector signed short)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector __bool short
vec_mergeh(__vector __bool short __a, __vector __bool short __b) {
return (__vector __bool short)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_mergeh(__vector unsigned short __a, __vector unsigned short __b) {
return (__vector unsigned short)(
__a[0], __b[0], __a[1], __b[1], __a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector signed int
vec_mergeh(__vector signed int __a, __vector signed int __b) {
return (__vector signed int)(__a[0], __b[0], __a[1], __b[1]);
}
static inline __ATTRS_o_ai __vector __bool int
vec_mergeh(__vector __bool int __a, __vector __bool int __b) {
return (__vector __bool int)(__a[0], __b[0], __a[1], __b[1]);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_mergeh(__vector unsigned int __a, __vector unsigned int __b) {
return (__vector unsigned int)(__a[0], __b[0], __a[1], __b[1]);
}
static inline __ATTRS_o_ai __vector signed long long
vec_mergeh(__vector signed long long __a, __vector signed long long __b) {
return (__vector signed long long)(__a[0], __b[0]);
}
static inline __ATTRS_o_ai __vector __bool long long
vec_mergeh(__vector __bool long long __a, __vector __bool long long __b) {
return (__vector __bool long long)(__a[0], __b[0]);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_mergeh(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned long long)(__a[0], __b[0]);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_mergeh(__vector float __a, __vector float __b) {
return (__vector float)(__a[0], __b[0], __a[1], __b[1]);
}
#endif
static inline __ATTRS_o_ai __vector double
vec_mergeh(__vector double __a, __vector double __b) {
return (__vector double)(__a[0], __b[0]);
}
/*-- vec_mergel -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_mergel(__vector signed char __a, __vector signed char __b) {
return (__vector signed char)(
__a[8], __b[8], __a[9], __b[9], __a[10], __b[10], __a[11], __b[11],
__a[12], __b[12], __a[13], __b[13], __a[14], __b[14], __a[15], __b[15]);
}
static inline __ATTRS_o_ai __vector __bool char
vec_mergel(__vector __bool char __a, __vector __bool char __b) {
return (__vector __bool char)(
__a[8], __b[8], __a[9], __b[9], __a[10], __b[10], __a[11], __b[11],
__a[12], __b[12], __a[13], __b[13], __a[14], __b[14], __a[15], __b[15]);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_mergel(__vector unsigned char __a, __vector unsigned char __b) {
return (__vector unsigned char)(
__a[8], __b[8], __a[9], __b[9], __a[10], __b[10], __a[11], __b[11],
__a[12], __b[12], __a[13], __b[13], __a[14], __b[14], __a[15], __b[15]);
}
static inline __ATTRS_o_ai __vector signed short
vec_mergel(__vector signed short __a, __vector signed short __b) {
return (__vector signed short)(
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector __bool short
vec_mergel(__vector __bool short __a, __vector __bool short __b) {
return (__vector __bool short)(
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_mergel(__vector unsigned short __a, __vector unsigned short __b) {
return (__vector unsigned short)(
__a[4], __b[4], __a[5], __b[5], __a[6], __b[6], __a[7], __b[7]);
}
static inline __ATTRS_o_ai __vector signed int
vec_mergel(__vector signed int __a, __vector signed int __b) {
return (__vector signed int)(__a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector __bool int
vec_mergel(__vector __bool int __a, __vector __bool int __b) {
return (__vector __bool int)(__a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_mergel(__vector unsigned int __a, __vector unsigned int __b) {
return (__vector unsigned int)(__a[2], __b[2], __a[3], __b[3]);
}
static inline __ATTRS_o_ai __vector signed long long
vec_mergel(__vector signed long long __a, __vector signed long long __b) {
return (__vector signed long long)(__a[1], __b[1]);
}
static inline __ATTRS_o_ai __vector __bool long long
vec_mergel(__vector __bool long long __a, __vector __bool long long __b) {
return (__vector __bool long long)(__a[1], __b[1]);
}
static inline __ATTRS_o_ai __vector unsigned long long
vec_mergel(__vector unsigned long long __a, __vector unsigned long long __b) {
return (__vector unsigned long long)(__a[1], __b[1]);
}
#if __ARCH__ >= 12
static inline __ATTRS_o_ai __vector float
vec_mergel(__vector float __a, __vector float __b) {
return (__vector float)(__a[2], __b[2], __a[3], __b[3]);
}
#endif
static inline __ATTRS_o_ai __vector double
vec_mergel(__vector double __a, __vector double __b) {
return (__vector double)(__a[1], __b[1]);
}
/*-- vec_pack ---------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_pack(__vector signed short __a, __vector signed short __b) {
__vector signed char __ac = (__vector signed char)__a;
__vector signed char __bc = (__vector signed char)__b;
return (__vector signed char)(
__ac[1], __ac[3], __ac[5], __ac[7], __ac[9], __ac[11], __ac[13], __ac[15],
__bc[1], __bc[3], __bc[5], __bc[7], __bc[9], __bc[11], __bc[13], __bc[15]);
}
static inline __ATTRS_o_ai __vector __bool char
vec_pack(__vector __bool short __a, __vector __bool short __b) {
__vector __bool char __ac = (__vector __bool char)__a;
__vector __bool char __bc = (__vector __bool char)__b;
return (__vector __bool char)(
__ac[1], __ac[3], __ac[5], __ac[7], __ac[9], __ac[11], __ac[13], __ac[15],
__bc[1], __bc[3], __bc[5], __bc[7], __bc[9], __bc[11], __bc[13], __bc[15]);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_pack(__vector unsigned short __a, __vector unsigned short __b) {
__vector unsigned char __ac = (__vector unsigned char)__a;
__vector unsigned char __bc = (__vector unsigned char)__b;
return (__vector unsigned char)(
__ac[1], __ac[3], __ac[5], __ac[7], __ac[9], __ac[11], __ac[13], __ac[15],
__bc[1], __bc[3], __bc[5], __bc[7], __bc[9], __bc[11], __bc[13], __bc[15]);
}
static inline __ATTRS_o_ai __vector signed short
vec_pack(__vector signed int __a, __vector signed int __b) {
__vector signed short __ac = (__vector signed short)__a;
__vector signed short __bc = (__vector signed short)__b;
return (__vector signed short)(
__ac[1], __ac[3], __ac[5], __ac[7],
__bc[1], __bc[3], __bc[5], __bc[7]);
}
static inline __ATTRS_o_ai __vector __bool short
vec_pack(__vector __bool int __a, __vector __bool int __b) {
__vector __bool short __ac = (__vector __bool short)__a;
__vector __bool short __bc = (__vector __bool short)__b;
return (__vector __bool short)(
__ac[1], __ac[3], __ac[5], __ac[7],
__bc[1], __bc[3], __bc[5], __bc[7]);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_pack(__vector unsigned int __a, __vector unsigned int __b) {
__vector unsigned short __ac = (__vector unsigned short)__a;
__vector unsigned short __bc = (__vector unsigned short)__b;
return (__vector unsigned short)(
__ac[1], __ac[3], __ac[5], __ac[7],
__bc[1], __bc[3], __bc[5], __bc[7]);
}
static inline __ATTRS_o_ai __vector signed int
vec_pack(__vector signed long long __a, __vector signed long long __b) {
__vector signed int __ac = (__vector signed int)__a;
__vector signed int __bc = (__vector signed int)__b;
return (__vector signed int)(__ac[1], __ac[3], __bc[1], __bc[3]);
}
static inline __ATTRS_o_ai __vector __bool int
vec_pack(__vector __bool long long __a, __vector __bool long long __b) {
__vector __bool int __ac = (__vector __bool int)__a;
__vector __bool int __bc = (__vector __bool int)__b;
return (__vector __bool int)(__ac[1], __ac[3], __bc[1], __bc[3]);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_pack(__vector unsigned long long __a, __vector unsigned long long __b) {
__vector unsigned int __ac = (__vector unsigned int)__a;
__vector unsigned int __bc = (__vector unsigned int)__b;
return (__vector unsigned int)(__ac[1], __ac[3], __bc[1], __bc[3]);
}
/*-- vec_packs --------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_packs(__vector signed short __a, __vector signed short __b) {
return __builtin_s390_vpksh(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_packs(__vector unsigned short __a, __vector unsigned short __b) {
return __builtin_s390_vpklsh(__a, __b);
}
static inline __ATTRS_o_ai __vector signed short
vec_packs(__vector signed int __a, __vector signed int __b) {
return __builtin_s390_vpksf(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_packs(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vpklsf(__a, __b);
}
static inline __ATTRS_o_ai __vector signed int
vec_packs(__vector signed long long __a, __vector signed long long __b) {
return __builtin_s390_vpksg(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_packs(__vector unsigned long long __a, __vector unsigned long long __b) {
return __builtin_s390_vpklsg(__a, __b);
}
/*-- vec_packs_cc -----------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed char
vec_packs_cc(__vector signed short __a, __vector signed short __b, int *__cc) {
return __builtin_s390_vpkshs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_packs_cc(__vector unsigned short __a, __vector unsigned short __b,
int *__cc) {
return __builtin_s390_vpklshs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector signed short
vec_packs_cc(__vector signed int __a, __vector signed int __b, int *__cc) {
return __builtin_s390_vpksfs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_packs_cc(__vector unsigned int __a, __vector unsigned int __b, int *__cc) {
return __builtin_s390_vpklsfs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector signed int
vec_packs_cc(__vector signed long long __a, __vector signed long long __b,
int *__cc) {
return __builtin_s390_vpksgs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_packs_cc(__vector unsigned long long __a, __vector unsigned long long __b,
int *__cc) {
return __builtin_s390_vpklsgs(__a, __b, __cc);
}
/*-- vec_packsu -------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
vec_packsu(__vector signed short __a, __vector signed short __b) {
const __vector signed short __zero = (__vector signed short)0;
return __builtin_s390_vpklsh(
(__vector unsigned short)(__a >= __zero) & (__vector unsigned short)__a,
(__vector unsigned short)(__b >= __zero) & (__vector unsigned short)__b);
}
static inline __ATTRS_o_ai __vector unsigned char
vec_packsu(__vector unsigned short __a, __vector unsigned short __b) {
return __builtin_s390_vpklsh(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_packsu(__vector signed int __a, __vector signed int __b) {
const __vector signed int __zero = (__vector signed int)0;
return __builtin_s390_vpklsf(
(__vector unsigned int)(__a >= __zero) & (__vector unsigned int)__a,
(__vector unsigned int)(__b >= __zero) & (__vector unsigned int)__b);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_packsu(__vector unsigned int __a, __vector unsigned int __b) {
return __builtin_s390_vpklsf(__a, __b);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_packsu(__vector signed long long __a, __vector signed long long __b) {
const __vector signed long long __zero = (__vector signed long long)0;
return __builtin_s390_vpklsg(
(__vector unsigned long long)(__a >= __zero) &
(__vector unsigned long long)__a,
(__vector unsigned long long)(__b >= __zero) &
(__vector unsigned long long)__b);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_packsu(__vector unsigned long long __a, __vector unsigned long long __b) {
return __builtin_s390_vpklsg(__a, __b);
}
/*-- vec_packsu_cc ----------------------------------------------------------*/
static inline __ATTRS_o_ai __vector unsigned char
vec_packsu_cc(__vector unsigned short __a, __vector unsigned short __b,
int *__cc) {
return __builtin_s390_vpklshs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector unsigned short
vec_packsu_cc(__vector unsigned int __a, __vector unsigned int __b, int *__cc) {
return __builtin_s390_vpklsfs(__a, __b, __cc);
}
static inline __ATTRS_o_ai __vector unsigned int
vec_packsu_cc(__vector unsigned long long __a, __vector unsigned long long __b,
int *__cc) {
return __builtin_s390_vpklsgs(__a, __b, __cc);
}
/*-- vec_unpackh ------------------------------------------------------------*/
static inline __ATTRS_o_ai __vector signed short
vec_unpackh(__vector signed char __a) {
return __builtin_s390_vuphb(__a);
}
static inline __ATTRS_o_ai __vector __bool short
vec_unpackh(__vector __bool char __a) {