POWER Vector Library Manual
1.0.4
|
Go to the documentation of this file.
22 #ifndef VEC_COMMON_PPC_H_
23 #define VEC_COMMON_PPC_H_
230 typedef __vector __bool
long long vb64_t;
233 #ifndef PVECLIB_DISABLE_INT128
238 #ifndef PVECLIB_DISABLE_BOOLINT128
243 typedef __vector __bool
int vb128_t;
249 typedef __vector
unsigned int vui128_t;
251 typedef __vector __bool
int vb128_t;
262 #ifndef PVECLIB_DISABLE_DFP
283 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
293 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
295 #define CONST_VINT64_DW(__dw0, __dw1) {__dw1, __dw0}
298 #define CONST_VINT128_DW(__dw0, __dw1) (vui64_t){__dw1, __dw0}
301 #define CONST_VINT128_DW128(__dw0, __dw1) (vui128_t)((vui64_t){__dw1, __dw0})
304 #define CONST_VINT128_W(__w0, __w1, __w2, __w3) (vui32_t){__w3, __w2, __w1, __w0}
306 #define CONST_VINT32_W(__w0, __w1, __w2, __w3) {__w3, __w2, __w1, __w0}
309 #define CONST_VINT128_H(__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7) \
310 (vui16_t){__hw7, __hw6, __hw5, __hw4, __hw3, __hw2, __hw1, __hw0}
312 #define CONST_VINT16_H(__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7) \
313 {__hw7, __hw6, __hw5, __hw4, __hw3, __hw2, __hw1, __hw0}
316 #define CONST_VINT128_B(_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15) \
317 (vui8_t){_b15, _b14, _b13, _b12, _b11, _b10, _b9, _b8, _b7, _b6, _b5, _b4, _b3, _b2, _b1, _b0}
319 #define CONST_VINT8_B(_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15) \
320 {_b15, _b14, _b13, _b12, _b11, _b10, _b9, _b8, _b7, _b6, _b5, _b4, _b3, _b2, _b1, _b0}
340 #define VEC_HW_L_DWH 4
346 #define VEC_BYTE_L_DWH 8
348 #define VEC_BYTE_L_DWL 0
350 #define VEC_BYTE_H 15
352 #define VEC_BYTE_HHW 14
354 #define CONST_VINT64_DW(__dw0, __dw1) {__dw0, __dw1}
355 #define CONST_VINT128_DW(__dw0, __dw1) (vui64_t){__dw0, __dw1}
356 #define CONST_VINT128_DW128(__dw0, __dw1) (vui128_t)((vui64_t){__dw0, __dw1})
357 #define CONST_VINT128_W(__w0, __w1, __w2, __w3) (vui32_t){__w0, __w1, __w2, __w3}
358 #define CONST_VINT32_W(__w0, __w1, __w2, __w3) {__w0, __w1, __w2, __w3}
361 #define CONST_VINT128_H(__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7) \
362 (vui16_t){__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7}
364 #define CONST_VINT16_H(__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7) \
365 {__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7}
368 #define CONST_VINT128_B(_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15) \
369 (vui8_t){_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15}
371 #define CONST_VINT8_B(_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15) \
372 {_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15}
383 #define VEC_HW_L_DWH 3
385 #define VEC_BYTE_L 15
387 #define VEC_BYTE_L_DWH 7
389 #define VEC_BYTE_L_DWL 15
391 #define VEC_BYTE_HHW 1
399 #ifndef PVECLIB_DISABLE_DFP
419 static inline unsigned __int128
423 unsigned __int128 result;
424 #if defined(_ARCH_PWR8) || defined (__clang__)
445 :
"=Z" (t.
ulong.lower),
447 :
"wa" (vra_l),
"wa" (vra_u)
449 #else //_ARCH_PWR6/970
489 static inline unsigned long long
494 return t.
ulong.lower;
502 static inline unsigned long long
507 return t.
ulong.upper;
516 static inline unsigned __int128
518 unsigned long long low)
522 t.
ulong.upper = high;
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
__vector __bool int vb32_t
vector of 32-bit bool int elements.
Definition: vec_common_ppc.h:228
__vector float vf32_t
vector of 32-bit float elements.
Definition: vec_common_ppc.h:219
__vector __bool __int128 vb128_t
vector of one 128-bit bool __int128 element.
Definition: vec_common_ppc.h:240
_Decimal128 dpd128
128 bit Decimal Float from pair of double float registers.
Definition: vec_common_ppc.h:264
const vui128_t vtifrexpof10[]
table used to verify 128-bit frexp operations for powers of 10.
static unsigned __int128 scalar_insert_uint64_to_uint128(unsigned long long high, unsigned long long low)
Insert High/low doublewords into a __int128 scalar.
Definition: vec_common_ppc.h:517
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
__vector unsigned short vui16_t
vector of 16-bit unsigned short elements.
Definition: vec_common_ppc.h:204
__vector __int128 vi128_t
vector of one 128-bit signed __int128 element.
Definition: vec_common_ppc.h:235
__vector unsigned long long vui64_t
vector of 64-bit unsigned long long elements.
Definition: vec_common_ppc.h:208
unsigned __int128 ui128
Unsigned 128-bit integer from pair of 64-bit GPRs.
Definition: vec_common_ppc.h:261
signed __int128 i128
Signed 128-bit integer from pair of 64-bit GPRs.
Definition: vec_common_ppc.h:259
__vector unsigned char vui8_t
vector of 8-bit unsigned char elements.
Definition: vec_common_ppc.h:202
__vector int vi32_t
vector of 32-bit signed int elements.
Definition: vec_common_ppc.h:215
vui8_t vx16
128 bit Vector of 16 unsigned char elements.
Definition: vec_common_ppc.h:269
struct __VEC_U_128::@0 ulong
Struct of two unsigned long int (64-bit GPR) fields.
vui16_t vx8
128 bit Vector of 8 unsigned short int elements.
Definition: vec_common_ppc.h:271
__vector __bool char vb8_t
vector of 8-bit bool char elements.
Definition: vec_common_ppc.h:224
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
Union used to transfer 128-bit data between vector and non-vector types.
Definition: vec_common_ppc.h:256
const _Decimal128 decpowof2[]
table powers of 2 [0-1077] in _Decimal128 format.
__vector long long vi64_t
vector of 64-bit signed long long elements.
Definition: vec_common_ppc.h:217
__vector signed char vi8_t
vector of 8-bit signed char elements.
Definition: vec_common_ppc.h:211
__vector __bool short vb16_t
vector of 16-bit bool short elements.
Definition: vec_common_ppc.h:226
static vui128_t vec_transfer_uint128_to_vui128t(unsigned __int128 gprp)
Transfer a __int128 scalar to vector unsigned __int128.
Definition: vec_common_ppc.h:477
const vui128_t vtipowof10[]
table powers of 10 [0-38] in vector __int128 format.
__vector unsigned int vui32_t
vector of 32-bit unsigned int elements.
Definition: vec_common_ppc.h:206
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
vui64_t vx2
128 bit Vector of 2 unsigned long int (64-bit) elements.
Definition: vec_common_ppc.h:275
__vector short vi16_t
vector of 16-bit signed short elements.
Definition: vec_common_ppc.h:213
__vector double vf64_t
vector of 64-bit double elements.
Definition: vec_common_ppc.h:221
vui32_t vx4
128 bit Vector of 4 unsigned int elements.
Definition: vec_common_ppc.h:273
vf64_t vf2
128 bit Vector of 2 double float elements.
Definition: vec_common_ppc.h:279
long double ldbl128
IBM long double float from pair of double float registers.
Definition: vec_common_ppc.h:267