POWER Vector Library Manual
1.0.4
|
Go to the documentation of this file.
23 #ifndef VEC_F64_PPC_H_
24 #define VEC_F64_PPC_H_
205 vec_vlxsfdx (
const signed long long ra,
const double *rb);
225 return vec_abs (vf64x);
228 0x8000000000000000UL);
256 #if _ARCH_PWR9 && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
258 #ifdef vec_test_data_class
259 tmp = (
vui64_t)vec_test_data_class (vf64, 0x70);
262 "xvtstdcdp %x0,%x1,0x70;\n"
267 return vec_all_eq(tmp, vec_zero);
270 0x7ff0000000000000UL);
271 tmp = vec_and ((
vui64_t)vf64, expmask);
299 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
301 #ifdef vec_test_data_class
302 tmp = (
vui64_t)vec_test_data_class (vf64, 0x30);
305 "xvtstdcdp %x0,%x1,0x30;\n"
310 return vec_all_eq(tmp, vec_ones);
313 0x8000000000000000UL);
315 0x7ff0000000000000UL);
316 tmp = vec_andc ((
vui64_t)vf64, signmask);
345 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
347 #ifdef vec_test_data_class
348 tmp = (
vui64_t)vec_test_data_class (vf64, 0x40);
351 "xvtstdcdp %x0,%x1,0x40;\n"
356 return vec_all_eq(tmp, vec_ones);
359 0x8000000000000000UL);
361 0x7ff0000000000000UL);
362 tmp = vec_andc ((
vui64_t)vf64, signmask);
392 #if _ARCH_PWR9 && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
393 #ifdef vec_test_data_class
394 tmp = (
vui64_t)vec_test_data_class (vf64, 0x7f);
397 "xvtstdcdp %x0,%x1,0x7f;\n"
402 return vec_all_eq(tmp, vec_zero);
405 0x7ff0000000000000UL);
406 tmp = vec_and ((
vui64_t) vf64, expmask);
436 #if _ARCH_PWR9 && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
438 #ifdef vec_test_data_class
439 tmp = (
vui64_t)vec_test_data_class (vf64, 0x03);
442 "xvtstdcdp %x0,%x1,0x03;\n"
447 return vec_all_eq(tmp, vec_ones);
452 0x8000000000000000UL);
455 tmp = vec_andc ((
vui64_t)vf64, signmask);
484 #if _ARCH_PWR9 && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
486 #ifdef vec_test_data_class
487 tmp = (
vui64_t)vec_test_data_class (vf64, 0x0c);
490 "xvtstdcdp %x0,%x1,0x0c;\n"
495 return vec_all_eq(tmp, vec_ones);
498 0x8000000000000000UL);
501 tmp = vec_andc ((
vui64_t)vf64, signmask);
531 #ifdef vec_test_data_class
532 tmp = (
vui64_t)vec_test_data_class (vf64, 0x70);
535 "xvtstdcdp %x0,%x1,0x70;\n"
540 return vec_any_eq(tmp, vec_zero);
543 0x7ff0000000000000UL);
544 tmp = vec_and ((
vui64_t)vf64, expmask);
571 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
573 #ifdef vec_test_data_class
574 tmp = (
vui64_t)vec_test_data_class (vf64, 0x30);
577 "xvtstdcdp %x0,%x1,0x30;\n"
582 return vec_any_eq(tmp, vec_ones);
585 0x7ff0000000000000UL);
587 0x8000000000000000UL);
588 tmp = vec_andc ((
vui64_t)vf64, signmask);
617 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
619 #ifdef vec_test_data_class
620 tmp = (
vui64_t)vec_test_data_class (vf64, 0x40);
623 "xvtstdcdp %x0,%x1,0x40;\n"
628 return vec_any_eq(tmp, vec_ones);
631 0x8000000000000000UL);
633 0x7ff0000000000000UL);
634 tmp = vec_andc ((
vui64_t)vf64, signmask);
665 #ifdef vec_test_data_class
666 tmp = (
vui64_t)vec_test_data_class (vf64, 0x7f);
669 "xvtstdcdp %x0,%x1,0x7f;\n"
674 return vec_any_eq(tmp, vec_zero);
678 0x7ff0000000000000UL);
680 tmp = vec_and ((
vui64_t) vf64, expmask);
712 #ifdef vec_test_data_class
713 tmp = (
vui64_t)vec_test_data_class (vf64, 0x03);
716 "xvtstdcdp %x0,%x1,0x03;\n"
721 return vec_any_eq(tmp, vec_ones);
724 0x8000000000000000UL);
726 0x0010000000000000UL);
730 tmp2 = vec_andc ((
vui64_t)vf64, signmask);
733 vsubnorm = vec_andc (tmp, tmpz);
764 #ifdef vec_test_data_class
765 tmp = (
vui64_t)vec_test_data_class (vf64, 0x0c);
768 "xvtstdcdp %x0,%x1,0x0c;\n"
773 return vec_any_eq(tmp, vec_ones);
776 0x8000000000000000UL);
778 tmp = vec_andc ((
vui64_t)vf64, signmask);
813 #ifdef PVECLIB_CPSGN_FIXED
814 return (vec_cpsgn (vf64x, vf64y));
818 "xvcpsgndp %x0,%x1,%x2;\n"
820 :
"wa" (vf64x),
"wa" (vf64y)
860 #if defined (_ARCH_PWR9)
861 #ifdef vec_test_data_class
862 tmp2 = vec_test_data_class (vf64, 0x70);
865 "xvtstdcdp %x0,%x1,0x70;\n"
870 return vec_nor (tmp2, tmp2);
873 0x7ff0000000000000UL);
876 tmp = vec_and ((
vui64_t)vf64, expmask);
878 return vec_nor (tmp2, tmp2);
905 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
906 #ifdef vec_test_data_class
907 result = vec_test_data_class (vf64, 0x30);
910 "xvtstdcdp %x0,%x1,0x30;\n"
918 0x7ff0000000000000UL);
920 0x8000000000000000UL);
921 tmp = vec_andc ((
vui64_t) vf64, signmask);
948 #if _ARCH_PWR9 && !(defined(__clang__) && __clang_major__ < 9)
949 #ifdef vec_test_data_class
950 result = vec_test_data_class (vf64, 0x40);
953 "xvtstdcdp %x0,%x1,0x40;\n"
961 0x7ff0000000000000UL);
963 0x8000000000000000UL);
964 tmp = vec_andc ((
vui64_t)vf64, signmask);
994 #ifdef vec_test_data_class
995 tmp2 = vec_test_data_class (vf64, 0x7f);
998 "xvtstdcdp %x0,%x1,0x7f;\n"
1003 return vec_nor (tmp2, tmp2);
1006 0x7ff0000000000000UL);
1010 tmp = vec_and ((
vui64_t) vf64, expmask);
1041 #ifdef vec_test_data_class
1042 result = vec_test_data_class (vf64, 0x03);
1045 "xvtstdcdp %x0,%x1,0x03;\n"
1053 0x0010000000000000UL);
1056 0x8000000000000000UL);
1057 tmp = vec_andc ((
vui64_t) vf64, signmask);
1089 #ifdef vec_test_data_class
1090 result = vec_test_data_class (vf64, 0x0c);
1093 "xvtstdcdp %x0,%x1,0x0c;\n"
1102 0x8000000000000000UL);
1103 tmp2 = vec_andc ((
vui64_t)vf64, signmask);
1114 static inline long double
1125 "xxlor %0,%x1,%x1;\n"
1126 "\txxswapd %L0,%x1;\n"
1185 "xxmrghd %x0,%1,%L1;\n"
1217 const long long offset1)
1225 #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
1294 const unsigned char scale)
1350 const long long offset0,
const long long offset1)
1357 #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
1422 vi64_t vra,
const unsigned char scale)
1498 #if defined (__clang__)
1500 unsigned long long *p = (
unsigned long long *)((
char *)rb + ra);
1504 if (__builtin_constant_p (ra) && (ra < 32760) && (ra >= -32768)
1507 #if defined (_ARCH_PWR9)
1511 :
"m" (*(
double*)((
char *)rb + ra))
1522 unsigned long long rt;
1523 #if defined (_ARCH_PWR8)
1530 :
"=&r" (rt),
"=wa" (xt)
1531 :
"I" (ra),
"b" (rb),
"m" (*(
double*)((
char *)rb+ra))
1544 :
"Z" (*(
double*)((
char *)rb+rt))
1553 :
"Z" (*(
double*)((
char *)rb+ra))
1590 #if defined (__clang__)
1592 unsigned long long *p = (
unsigned long long *)((
char *)rb + ra);
1596 if (__builtin_constant_p (ra) && (ra <= 32760) && (ra >= -32768)
1599 #if defined (_ARCH_PWR9)
1602 :
"=m" (*(
double*)((
char *)rb + ra))
1614 unsigned long long rt;
1622 :
"=Z" (*(
double*)((
char *)rb+rt))
1630 :
"=Z" (*(
double*)((
char *)rb+ra))
1668 #if defined (_ARCH_PWR9) && defined (__VSX__) && (__GNUC__ > 7)
1669 #if defined (vec_insert_exp)
1670 result = vec_insert_exp (sig, exp);
1673 "xviexpdp %x0,%x1,%x2"
1675 :
"wa" (sig),
"wa" (exp)
1716 #if defined (_ARCH_PWR9) && defined (__VSX__) && (__GNUC__ > 7)
1717 #if defined (vec_extract_exp)
1718 result = vec_extract_exp (vrb);
1730 tmp = vec_and ((
vui32_t) vrb, expmask);
1765 #if defined (_ARCH_PWR9) && defined (__VSX__) && (__GNUC__ > 7)
1766 #if defined (vec_extract_sig)
1767 result = vec_extract_sig (vrb);
1786 tmp = vec_and ((
vui32_t) vrb, expmask);
1787 normal = (
vui32_t) vec_nor (vec_cmpeq (tmp, expmask),
1788 vec_cmpeq (tmp, zero));
1789 t128 = vec_and ((
vui32_t) vrb, sigmask);
1790 result = (
vui64_t) vec_sel (t128, normal, hidden);
static int vec_cmpud_all_ne(vui64_t a, vui64_t b)
Vector Compare all Not Equal Unsigned Doubleword.
Definition: vec_int64_ppc.h:2334
static void vec_vsstfddx(vf64_t xs, double *array, vi64_t vra)
Vector Scatter-Store Float Double to Doubleword Indexes.
Definition: vec_f64_ppc.h:1450
static vb64_t vec_isnanf64(vf64_t vf64)
Return 2x64-bit vector boolean true values, for each double NaN value.
Definition: vec_f64_ppc.h:944
static int vec_any_isnanf64(vf64_t vf64)
Return true if any of 2x64-bit vector double values are NaN.
Definition: vec_f64_ppc.h:613
static unsigned long long scalar_extract_uint64_from_high_uint128(unsigned __int128 gprp)
Extract the high doubleword from a __int128 scalar.
Definition: vec_common_ppc.h:503
static vui64_t vec_xxspltd(vui64_t vra, const int ctl)
Vector splat doubleword. Duplicate the selected doubleword element across the doubleword elements of ...
Definition: vec_int64_ppc.h:4647
static vui64_t vec_xvxexpdp(vf64_t vrb)
Vector Extract Exponent Double-Precision.
Definition: vec_f64_ppc.h:1713
static int vec_any_issubnormalf64(vf64_t vf64)
Return true if any of 2x64-bit vector double values is subnormal (denormal).
Definition: vec_f64_ppc.h:706
static int vec_any_isnormalf64(vf64_t vf64)
Return true if any of 2x64-bit vector double values are normal (Not NaN, Inf, denormal,...
Definition: vec_f64_ppc.h:660
static int vec_cmpud_all_lt(vui64_t a, vui64_t b)
Vector Compare all Less than Unsigned Doubleword.
Definition: vec_int64_ppc.h:2311
#define CONST_VINT128_W(__w0, __w1, __w2, __w3)
Arrange word elements of a unsigned int initializer in high->low order. May require an explicit cast.
Definition: vec_common_ppc.h:304
static vf64_t vec_vlxsfdx(const signed long long ra, const double *rb)
Vector Load Scalar Float Double Indexed.
Definition: vec_f64_ppc.h:1494
static vf64_t vec_xviexpdp(vui64_t sig, vui64_t exp)
Vector Insert Exponent Double-Precision.
Definition: vec_f64_ppc.h:1665
static int vec_any_iszerof64(vf64_t vf64)
Return true if any of 2x64-bit vector double values are +-0.0.
Definition: vec_f64_ppc.h:758
static unsigned __int128 vec_transfer_vui128t_to_uint128(vui128_t vra)
Transfer a vector unsigned __int128 to __int128 scalar.
Definition: vec_common_ppc.h:420
static int vec_all_isnanf64(vf64_t vf64)
Return true if all 2x64-bit vector double values are NaN.
Definition: vec_f64_ppc.h:341
static int vec_cmpud_all_eq(vui64_t a, vui64_t b)
Vector Compare all Equal Unsigned Doubleword.
Definition: vec_int64_ppc.h:2193
static vb64_t vec_iszerof64(vf64_t vf64)
Return 2x64-bit vector boolean true values, for each double value that is +-0.0.
Definition: vec_f64_ppc.h:1084
static void vec_vsstfdso(vf64_t xs, double *array, const long long offset0, const long long offset1)
Vector Scatter-Store Float Double to Scalar Offsets.
Definition: vec_f64_ppc.h:1349
static vf64_t vec_vglfddsx(double *array, vi64_t vra, const unsigned char scale)
Vector Gather-Load Float Double from Doubleword Scaled Indexes.
Definition: vec_f64_ppc.h:1293
static vf64_t vec_vglfddo(double *array, vi64_t vra)
Vector Gather-Load Float Double from Doubleword Offsets.
Definition: vec_f64_ppc.h:1253
__vector unsigned long long vui64_t
vector of 64-bit unsigned long long elements.
Definition: vec_common_ppc.h:208
Common definitions and typedef used by the collection of Power Vector Library (pveclib) headers.
static vui64_t vec_sldi(vui64_t vra, const unsigned int shb)
Vector Shift left Doubleword Immediate.
Definition: vec_int64_ppc.h:3253
static int vec_cmpud_all_gt(vui64_t a, vui64_t b)
Vector Compare all Greater Than Unsigned Doubleword.
Definition: vec_int64_ppc.h:2255
static void vec_vsstfddsx(vf64_t xs, double *array, vi64_t vra, const unsigned char scale)
Vector Scatter-Store Float Double to Doubleword Scaled Index.
Definition: vec_f64_ppc.h:1421
static vf64_t vec_absf64(vf64_t vf64x)
Vector double absolute value.
Definition: vec_f64_ppc.h:221
static long double vec_pack_longdouble(vf64_t lval)
Copy the pair of doubles from a vector to IBM long double.
Definition: vec_f64_ppc.h:1115
Header package containing a collection of 128-bit computation functions implemented with PowerISA VMX...
static vui128_t vec_srqi(vui128_t vra, const unsigned int shb)
Vector Shift Right Quadword Immediate.
Definition: vec_int128_ppc.h:7154
struct __VEC_U_128::@0 ulong
Struct of two unsigned long int (64-bit GPR) fields.
static vb64_t vec_isinff64(vf64_t vf64)
Return 2x64-bit vector boolean true values for each double, if infinity.
Definition: vec_f64_ppc.h:901
static int vec_cmpud_any_eq(vui64_t a, vui64_t b)
Vector Compare any Equal Unsigned Doubleword.
Definition: vec_int64_ppc.h:2365
static int vec_any_isfinitef64(vf64_t vf64)
Return true if any of 2x64-bit vector double values are Finite (Not NaN nor Inf).
Definition: vec_f64_ppc.h:526
vui128_t vx1
128 bit Vector of 1 unsigned __int128 element.
Definition: vec_common_ppc.h:277
__vector unsigned __int128 vui128_t
vector of one 128-bit unsigned __int128 element.
Definition: vec_common_ppc.h:237
__vector __bool long long vb64_t
vector of 64-bit bool long long elements.
Definition: vec_common_ppc.h:230
static int vec_all_isnormalf64(vf64_t vf64)
Return true if all 2x64-bit vector double values are normal (Not NaN, Inf, denormal,...
Definition: vec_f64_ppc.h:388
static void vec_vstxsfdx(vf64_t xs, const signed long long ra, double *rb)
Vector Store Scalar Float Double Indexed.
Definition: vec_f64_ppc.h:1588
static vui64_t vec_permdi(vui64_t vra, vui64_t vrb, const int ctl)
Vector Permute Doubleword Immediate. Combine a doubleword selected from the 1st (vra) vector with a d...
Definition: vec_int64_ppc.h:2983
static int vec_all_iszerof64(vf64_t vf64)
Return true if all 2x64-bit vector double values are +-0.0.
Definition: vec_f64_ppc.h:480
Union used to transfer 128-bit data between vector and non-vector types.
Definition: vec_common_ppc.h:256
__vector long long vi64_t
vector of 64-bit signed long long elements.
Definition: vec_common_ppc.h:217
#define CONST_VINT128_DW(__dw0, __dw1)
Initializer for 128-bits vector, as two unsigned long long elements in high->low order....
Definition: vec_common_ppc.h:298
static vf64_t vec_copysignf64(vf64_t vf64x, vf64_t vf64y)
Copy the sign bit from vf64x merged with magnitude from vf64y and return the resulting vector double ...
Definition: vec_f64_ppc.h:809
static vui64_t vec_xvxsigdp(vf64_t vrb)
Vector Extract Significand Double-Precision.
Definition: vec_f64_ppc.h:1762
static int vec_all_isfinitef64(vf64_t vf64)
Return true if all 2x64-bit vector double values are Finite (Not NaN nor Inf).
Definition: vec_f64_ppc.h:253
static int vec_any_isinff64(vf64_t vf64)
Return true if any of 2x64-bit vector double values are infinity.
Definition: vec_f64_ppc.h:567
#define VEC_DW_L
Element index for low order dword.
Definition: vec_common_ppc.h:324
static int vec_all_isinff64(vf64_t vf64)
Return true if all 2x64-bit vector double values are infinity.
Definition: vec_f64_ppc.h:295
static int vec_cmpud_any_ne(vui64_t a, vui64_t b)
Vector Compare any Not Equal Unsigned Doubleword.
Definition: vec_int64_ppc.h:2508
__vector unsigned int vui32_t
vector of 32-bit unsigned int elements.
Definition: vec_common_ppc.h:206
static vb64_t vec_setb_sd(vi64_t vra)
Vector Set Bool from Signed Doubleword.
Definition: vec_int64_ppc.h:3164
static vb64_t vec_cmpltud(vui64_t a, vui64_t b)
Vector Compare less Than Unsigned Doubleword.
Definition: vec_int64_ppc.h:1771
static int vec_all_issubnormalf64(vf64_t vf64)
Return true if all 2x64-bit vector double values are subnormal (denormal).
Definition: vec_f64_ppc.h:432
static unsigned long long scalar_extract_uint64_from_low_uint128(unsigned __int128 gprp)
Extract the low doubleword from a __int128 scalar.
Definition: vec_common_ppc.h:490
static vb64_t vec_cmpgtud(vui64_t a, vui64_t b)
Vector Compare Greater Than Unsigned Doubleword.
Definition: vec_int64_ppc.h:1622
static vf64_t vec_vglfdso(double *array, const long long offset0, const long long offset1)
Vector Gather-Load Float Double from scalar Offsets.
Definition: vec_f64_ppc.h:1216
__vector double vf64_t
vector of 64-bit double elements.
Definition: vec_common_ppc.h:221
static vf64_t vec_unpack_longdouble(long double lval)
Copy the pair of doubles from a IBM long double to a vector double.
Definition: vec_f64_ppc.h:1175
static vb64_t vec_isfinitef64(vf64_t vf64)
Return 2x64-bit vector boolean true values for each double element that is Finite (Not NaN nor Inf).
Definition: vec_f64_ppc.h:857
vf64_t vf2
128 bit Vector of 2 double float elements.
Definition: vec_common_ppc.h:279
static vf64_t vec_vglfddx(double *array, vi64_t vra)
Vector Gather-Load Float Double from Doubleword indexes.
Definition: vec_f64_ppc.h:1322
static vui128_t vec_slqi(vui128_t vra, const unsigned int shb)
Vector Shift Left Quadword Immediate.
Definition: vec_int128_ppc.h:6748
static vb64_t vec_setb_dp(vf64_t vra)
Vector Set Bool from Sign, Double Precision.
Definition: vec_f64_ppc.h:1163
long double ldbl128
IBM long double float from pair of double float registers.
Definition: vec_common_ppc.h:267
static vb64_t vec_cmpequd(vui64_t a, vui64_t b)
Vector Compare Equal Unsigned Doubleword.
Definition: vec_int64_ppc.h:1451
static vb64_t vec_issubnormalf64(vf64_t vf64)
Return 2x64-bit vector boolean true values, for each double value that is subnormal (denormal).
Definition: vec_f64_ppc.h:1036
#define VEC_DW_H
Element index for high order dword.
Definition: vec_common_ppc.h:322
static vb64_t vec_isnormalf64(vf64_t vf64)
Return 2x64-bit vector boolean true values, for each double value, if normal (Not NaN,...
Definition: vec_f64_ppc.h:990
static int vec_cmpud_any_gt(vui64_t a, vui64_t b)
Vector Compare any Greater Than Unsigned Doubleword.
Definition: vec_int64_ppc.h:2429
static void vec_vsstfddo(vf64_t xs, double *array, vi64_t vra)
Vector Scatter-Store Float Double to Doubleword Offsets.
Definition: vec_f64_ppc.h:1384