POWER Vector Library Manual
1.0.4
|
Go to the documentation of this file.
23 #ifndef VEC_BCD_PPC_H_
24 #define VEC_BCD_PPC_H_
25 #ifdef PVECLIB_DISABLE_DFP
30 #warning Support for BCD is disabled until _Decimal128 support is added.
1565 #define vBCD_t vui32_t
1567 #define vbBCD_t vb32_t
1570 #define _BCD_CONST_PLUS_NINES ((vBCD_t) CONST_VINT128_DW128(0x9999999999999999, 0x999999999999999c))
1572 #define _BCD_CONST_PLUS_ONE ((vBCD_t) CONST_VINT128_DW128(0, 0x1c))
1574 #define _BCD_CONST_MINUS_ONE ((vBCD_t) CONST_VINT128_DW128(0, 0x1d))
1576 #define _BCD_CONST_ZERO ((vBCD_t) CONST_VINT128_DW128(0, 0x0c))
1578 #define _BCD_CONST_SIGN_MASK ((vBCD_t) CONST_VINT128_DW128(0, 0xf))
1626 _Decimal128 x, y, z;
1633 "denbcd 0,%L1,%L2;\n"
1662 static inline _Decimal128
1669 "xxpermdi %0,%x1,%x1,0b00;\n"
1670 "\txxpermdi %L0,%x1,%x1,0b10;\n"
1671 "\tdenbcdq 1,%0,%0;\n"
1677 t = __builtin_denbcdq (1, t);
1710 _Decimal128 x, y, z;
1719 "ddedpd 0,%L0,%L1;\n"
1755 "ddedpdq 2,%1,%2;\n"
1756 "\txxpermdi %x0,%1,%L1,0b00;\n"
1762 x = __builtin_ddedpdq (2, val);
1769 t.
dpd128 = __builtin_ddedpdq (1, val);
1795 "bcdadd. %0,%1,%2,0;\n"
1809 if (vec_all_eq((
vui32_t) t, mz))
1839 #if defined ( _ARCH_PWR8) && (__GNUC__ > 6)
1843 #else // Else load a BCD const 0.
1846 if (__builtin_expect (__builtin_bcdadd_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
1853 _Decimal128 d_a, d_b, d_s, d_t;
1859 d_t = __builtin_dscriq (d_s, 31);
1862 if (vec_all_eq ((
vui32_t) t, mz))
1899 if (__builtin_expect (__builtin_bcdadd_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
1915 #else // Else load a BCD const 0.
1922 _Decimal128 d_a, d_b, d_c, d_s, d_t;
1926 d_s = d_a + d_b + d_c;
1928 d_t = __builtin_dscriq (d_s, 31);
1931 if (vec_all_eq ((
vui32_t) t, mz))
1997 "bcdcfsq. %0,%1,0;\n"
2131 "bcdcfz. %0,%1,0;\n"
2136 const vui8_t dmask = vec_splat_u8(15);
2137 const vui8_t dx0 = vec_splat_u8(0);
2140 vui8_t bcd, bcd_h, bcd_l;
2142 znd_d = vec_and (vrb, dmask);
2150 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
2158 bcd = vec_or (bcd_h, bcd_l);
2190 result = (
vbBCD_t) vec_splat_s32 (-1);
2192 _Decimal128 d_a, d_b;
2196 result = (
vbBCD_t) vec_splat_s32 (-1);
2224 result = (
vbBCD_t) vec_splat_s32 (0);
2226 _Decimal128 d_a, d_b;
2230 result = (
vbBCD_t) vec_splat_s32 (0);
2258 result = (
vbBCD_t) vec_splat_s32 (-1);
2260 _Decimal128 d_a, d_b;
2264 result = (
vbBCD_t) vec_splat_s32 (-1);
2292 result = (
vbBCD_t) vec_splat_s32 (0);
2294 _Decimal128 d_a, d_b;
2298 result = (
vbBCD_t) vec_splat_s32 (0);
2326 result = (
vbBCD_t) vec_splat_s32 (-1);
2328 _Decimal128 d_a, d_b;
2332 result = (
vbBCD_t) vec_splat_s32 (-1);
2360 result = (
vbBCD_t) vec_splat_s32 (0);
2392 _Decimal128 d_a, d_b;
2395 return (d_a == d_b);
2422 _Decimal128 d_a, d_b;
2425 return (d_a >= d_b);
2452 _Decimal128 d_a, d_b;
2482 _Decimal128 d_a, d_b;
2485 return (d_a <= d_b);
2512 _Decimal128 d_a, d_b;
2568 "bcdcpsgn. %0,%1,%2;\n"
2757 sbcd = (
vBCD_t) vec_sel ((
vui32_t) vra, bcd_one, sign_mask);
2811 "bcdctz. %0,%1,0;\n"
2816 const vui8_t dmask = vec_splat_u8(15);
2820 '0',
'0',
'0', 0x70 );
2824 const vui32_t bcd_sign_mask = vec_splat_u32(15);
2825 vui8_t znd_s, znd_d, znd_t;
2829 bcd_s = vec_and ((
vui8_t) vrb, (
vui8_t) bcd_sign_mask);
2835 znd_d = vec_and (bcd_u, dmask);
2837 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
2838 znd_s = vec_mergeh (znd_d, znd_t);
2840 znd_s = vec_mergel (znd_t, znd_d);
2843 zone_code = zone_minus;
2845 if (vec_any_eq(sign_splat, plus_sign))
2850 vrt = vec_or (znd_s, zone_code);
2873 _Decimal128 d_t, d_a, d_b;
2903 _Decimal128 d_t, d_a, d_b;
2907 d_a = d_a * 10E31DL;
2955 vBCD_t t, low_a, low_b, high_a, high_b;
2956 _Decimal128 d_p, d_t, d_a, d_b;
2958 low_a = vec_and (a, dword_mask);
2959 low_b = vec_and (b, dword_mask);
2970 _Decimal128 d_ah, d_bh, d_hl, d_lh, d_h;
2982 d_h = __builtin_dscliq (d_h, 17);
2983 d_h = __builtin_dscriq (d_h, 1);
2992 if (vec_all_eq((
vui32_t) t, mz))
3039 vBCD_t t, low_a, low_b, high_a, high_b;
3040 _Decimal128 d_p, d_t, d_al, d_bl;
3042 low_a = vec_and (a, dword_mask);
3043 low_b = vec_and (b, dword_mask);
3050 d_t = __builtin_dscriq (d_p, 31);
3054 _Decimal128 d_ah, d_bh, d_hl, d_lh, d_h, d_ll, d_m;
3063 d_ll = __builtin_dscriq (d_p, 16);
3065 d_m = d_hl + d_lh + d_ll;
3066 d_m = __builtin_dscriq (d_m, 15);
3069 d_h = __builtin_dscliq (d_h, 1);
3077 if (vec_all_eq((
vui32_t) t, mz))
3102 "bcds. %0,%1,%2,0;\n"
3108 const vi8_t zero = vec_splat_s8(0);
3112 shd = vec_add (shd, shd);
3113 shd = vec_add (shd, shd);
3117 if (vec_all_ge(shd, zero))
3125 shd = vec_sub (zero, shd);
3163 "bcdsetsgn. %0,%1,0;\n"
3168 const vui32_t match_mask = vec_splat_u32(15);
3178 sign_code = vec_and (sign_splat, match_mask);
3180 if (vec_any_eq (sign_code, plus_sign))
3185 if (vec_any_eq (sign_code, minus_sign))
3212 vi8_t shd = vec_splats ((
const signed char) (_N));
3241 vi8_t shd = vec_splats ((
const signed char) (_N));
3270 "bcdsr. %0,%1,%2,0;\n"
3276 const vi8_t zero = vec_splat_s8(0);
3281 shd = vec_add (shd, shd);
3282 shd = vec_add (shd, shd);
3286 if (vec_all_ge(shd, zero))
3298 shd = vec_sub (zero, shd);
3303 r_d = vec_add (r_d, rnd6);
3339 vi8_t shd = vec_splats ((
const signed char) (-_N));
3368 vi8_t shd = vec_splats ((
const signed char) (-_N));
3384 r_d = vec_add (r_d, rnd6);
3423 vi8_t shd = vec_splats ((
const signed char) (-_N));
3451 "bcdsub. %0,%1,%2,0;\n"
3461 _Decimal128 d_t, d_a, d_b;
3467 if (vec_all_eq((
vui32_t) t, mz))
3497 #if defined (_ARCH_PWR8) && (__GNUC__ > 6)
3502 #else // Else load a BCD const 0.
3505 if (__builtin_expect (__builtin_bcdsub_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
3512 _Decimal128 d_a, d_b, d_s, d_t;
3517 d_t = __builtin_dscriq (d_s, 31);
3520 if (vec_all_eq ((
vui32_t) t, mz))
3557 if (__builtin_expect (__builtin_bcdsub_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
3573 #else // Else load a BCD const 0.
3580 _Decimal128 d_a, d_b, d_c, d_s, d_t;
3584 d_s = d_a - d_b + d_c;
3586 d_t = __builtin_dscriq (d_s, 31);
3589 if (vec_all_eq ((
vui32_t) t, mz))
3624 if (vec_all_eq ((
vui32_t) t, mz))
3651 "bcdtrunc. %0,%1,%2,0;\n"
3657 const vui16_t c124 = vec_splats ((
unsigned short) 124);
3658 const vui16_t c4 = vec_splats ((
unsigned short) 4);
3662 shd = vec_add (shd, shd);
3663 shd = vec_add (shd, shd);
3666 shd = vec_add (shd, c4);
3668 one_s = (
vui16_t) vec_cmple (shd, c124);
3697 vui16_t shd = vec_splats ((
const unsigned short) (_N));
3701 const vui16_t ones = vec_splat_u16(-1);
3735 "bcdus. %0,%1,%2;\n"
3741 const vi8_t zero = vec_splat_s8(0);
3745 shd = vec_add (shd, shd);
3746 shd = vec_add (shd, shd);
3749 if (vec_all_ge(shd, zero))
3757 shd = vec_sub (zero, shd);
3786 "bcdutrunc. %0,%1,%2;\n"
3792 const vui16_t c128 = vec_splats ((
unsigned short) 128);
3797 shd = vec_add (shd, shd);
3798 shd = vec_add (shd, shd);
3800 one_s = (
vui16_t) vec_cmplt (shd, c128);
3829 vui16_t shd = vec_splats ((
const unsigned short) (_N));
3833 const vui16_t ones = vec_splat_u16(-1);
3876 if (__builtin_expect (__builtin_bcdadd_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
3884 if (!vec_all_eq(sign_ab, sum_ab) && !vec_all_eq(
_BCD_CONST_ZERO, sum_ab))
3895 _Decimal128 d_a, d_b, d_s, d_t;
3902 d_t = __builtin_dscriq (d_s, 31);
3905 if (vec_all_eq((
vui32_t ) c, mz))
3948 vBCD_t sum_ab, sum_abc, sign_abc;
3952 if (__builtin_expect (__builtin_bcdadd_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
3960 if (__builtin_expect (__builtin_bcdadd_ov ((
vi128_t) sum_ab, (
vi128_t) cin, 0), 0))
3968 if (!vec_all_eq(sign_abc, sum_abc) && !vec_all_eq(
_BCD_CONST_ZERO, sum_abc))
3981 _Decimal128 d_a, d_b, d_c, d_s, d_t;
3985 d_s = d_a + d_b + d_c;
3988 d_t = __builtin_dscriq (d_s, 31);
3991 if (vec_all_eq((
vui32_t) c, mz))
4051 vBCD_t t, ph, low_a, low_b, high_a, high_b;
4052 _Decimal128 d_p, d_t, d_al, d_bl;
4054 low_a = vec_and (a, dword_mask);
4055 low_b = vec_and (b, dword_mask);
4062 d_t = __builtin_dscriq (d_p, 31);
4068 _Decimal128 d_ah, d_bh, d_hl, d_lh, d_h, d_hh, d_ll, d_m, d_mp;
4074 d_ll = __builtin_dscriq (d_p, 16);
4080 d_m = __builtin_dscriq (d_m, 15);
4083 d_hh = __builtin_dscliq (d_hh, 1);
4088 d_h = __builtin_dscliq (d_mp, 17);
4089 d_h = __builtin_dscriq (d_h, 1);
4098 if (vec_all_eq((
vui32_t) ph, mz))
4107 if (vec_all_eq((
vui32_t) t, mz))
4142 if (__builtin_expect (__builtin_bcdsub_ov ((
vi128_t) a, (
vi128_t) b, 0), 0))
4150 if (!vec_all_eq(sign_ab, sum_ab) && !vec_all_eq(
_BCD_CONST_ZERO, sum_ab))
4161 _Decimal128 d_a, d_b, d_s, d_t;
4168 d_t = __builtin_dscriq (d_s, 31);
4171 if (vec_all_eq((
vui32_t ) c, mz))
4204 "\txxpermdi %x0,%1,%L1,0b00;\n"
4234 static inline _Decimal128
4240 "dquaiq 0,%0,%1,0b01;\n"
4246 return (quantized128(val, 0DL));
4282 high_digit = vra / 10;
4285 x6 = high_digit * 6;
4290 c6 = vec_splats ((
unsigned char) 0x06);
4294 result = vec_add (vra, x6);
4329 vui16_t x156, c156, high_digit;
4333 high_digit = vra / 100;
4334 c156 = vec_splats ((
unsigned short) 156);
4335 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4336 x156 = vec_vmuleub ((
vui8_t) high_digit, (
vui8_t) c156);
4338 x156 = vec_vmuloub ((
vui8_t) high_digit, (
vui8_t) c156);
4342 result = (
vui8_t) vec_add (vra, x156);
4379 const vui32_t c = vec_splats ((
unsigned int) 55536);
4381 high_digit = vra / 10000;
4388 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4395 result = (
vui16_t) vec_add (vra, x);
4433 12379400392853802749UL, 12379400392853802749UL);
4434 const int shift_ten8 = 26;
4445 high_digit =
vec_mulhud (vra, mul_invs_ten8);
4446 high_digit =
vec_srdi (high_digit, shift_ten8);
4447 c = vec_splats ((
unsigned long)4194967296);
4448 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4499 0x39a5652fb1137856UL, 0xd30baf9a1e626a6dUL);
4500 const int shift_ten16 = 51;
4508 high_digit =
vec_mulhuq (vra, mul_invs_ten16);
4509 high_digit =
vec_srqi (high_digit, shift_ten16);
4561 const vui8_t dmask = vec_splat_u8 (15);
4562 const vui8_t dx10 = vec_splat_u8 (10);
4568 znd00 = vec_and (zone00, dmask);
4569 znd16 = vec_and (zone16, dmask);
4572 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4580 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4581 ten00 = vec_mulo (znd00, dx10);
4582 ten16 = vec_mulo (znd16, dx10);
4583 tens = vec_pack (ten16, ten00);
4585 ten00 = vec_mule (znd00, dx10);
4586 ten16 = vec_mule (znd16, dx10);
4587 tens = vec_pack (ten00, ten16);
4591 return vec_add (tens, ones);
4625 vui8_t x6, c6, high_digit;
4630 c6 = vec_splats ((
unsigned char) 0x06);
4633 x6 = vec_mul (high_digit, c6);
4639 return vec_sub (vra, x6);
4679 c156 = vec_splats ((
unsigned char) 156);
4680 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4681 x156 = vec_mulo ((
vui8_t) vra, c156);
4683 x156 = vec_mule ((
vui8_t) vra, c156);
4687 return vec_sub ((
vui16_t) vra, x156);
4727 c55536 = vec_splats ((
unsigned short) 55536);
4728 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4729 x55536 = vec_mulo ((
vui16_t) vra, c55536);
4731 x55536 = vec_mule ((
vui16_t) vra, c55536);
4736 return vec_sub ((
vui32_t) vra, x55536);
4777 c4194967296 = vec_splats ((
unsigned int) 4194967296);
4778 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4860 #if defined (_ARCH_PWR8) && (__GNUC__ > 6)
4866 result = (
vb128_t) vec_splat_s8 (-1);
4868 result = (
vb128_t) vec_splat_s8 (0);
4870 const vui16_t sign_mask = vec_splat_u16(15);
4875 const vui8_t max_digit = vec_splat_u8(9);
4876 const vui8_t msk_digit = vec_splat_u8(15);
4884 sign_code = vec_and (sign_splat, sign_mask);
4886 if (vec_any_eq(sign_code, sign_vals))
4890 even = vec_andc ((
vui8_t) vra, msk_digit);
4891 odd = vec_and ((
vui8_t) vra, msk_digit);
4896 if (vec_any_gt (even, max_digit) || vec_any_gt(odd, max_digit))
4897 result = (
vb128_t) vec_splat_s8(-1);
4899 result = (
vb128_t) vec_splat_s8(0);
4902 result = (
vb128_t) vec_splat_s8(-1);
4931 #if defined (_ARCH_PWR8) && (__GNUC__ > 6)
4933 result = (
vb128_t) vec_splat_s8 (0);
4935 result = (
vb128_t) vec_splat_s8 (-1);
4937 const vui32_t sign_mask = vec_splat_u32(15);
4946 sign_code = vec_and (sign_splat, sign_mask);
4948 if (vec_any_eq(sign_code, plus_sign))
4949 result = (
vb128_t) vec_splat_s8(0);
4951 result = (
vb128_t) vec_splat_s8(-1);
4979 #if defined (_ARCH_PWR8) && (__GNUC__ > 6)
4982 const vui32_t sign_mask = vec_splat_u32(15);
4990 sign_code = vec_and (sign_splat, sign_mask);
4992 result = vec_any_eq(sign_code, minus_sign);
5008 static inline _Decimal128
5014 "xxpermdi %0,%x1,%x1,0b00;\n"
5015 "\txxpermdi %L0,%x1,%x1,0b10;\n"
#define vbBCD_t
vector vector bool from 128-bit signed BCD integer.
Definition: vec_bcd_ppc.h:1567
static int vec_bcdcmplt(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for less than.
Definition: vec_bcd_ppc.h:2507
static int vec_bcdcmpne(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for not equal.
Definition: vec_bcd_ppc.h:2537
static vBCD_t vec_bcdaddesqm(vBCD_t a, vBCD_t b, vBCD_t c)
Decimal Add Extended Signed Modulo Quadword.
Definition: vec_bcd_ppc.h:1955
static vui32_t vec_rdxcf10E16d(vui64_t vra)
Vector Decimal Convert radix 10**16 Binary doublewords to pairs of radix 10**8 binary words.
Definition: vec_bcd_ppc.h:4427
static vui8_t vec_bcdctub(vBCD_t vra)
Vector Decimal Convert Binary Coded Decimal (BCD) digit pairs to binary unsigned bytes .
Definition: vec_bcd_ppc.h:2636
static vBCD_t vec_bcdus(vBCD_t vra, vi8_t vrb)
Decimal Unsigned Shift. Shift a vector unsigned BCD value, left or right a variable amount of digits ...
Definition: vec_bcd_ppc.h:3730
static vui64_t vec_muleuw(vui32_t a, vui32_t b)
Vector multiply even unsigned words.
Definition: vec_int32_ppc.h:1007
static vBCD_t vec_BIN2BCD(vui64_t val)
Convert vector unsigned doubleword binary values to Vector unsigned 16-digit BCD values.
Definition: vec_bcd_ppc.h:1706
static vui128_t vec_subuqm(vui128_t vra, vui128_t vrb)
Vector Subtract Unsigned Quadword Modulo.
Definition: vec_int128_ppc.h:7439
__vector __bool int vb32_t
vector of 32-bit bool int elements.
Definition: vec_common_ppc.h:228
static vBCD_t vec_bcdcpsgn(vBCD_t vra, vBCD_t vrb)
Vector copy sign BCD.
Definition: vec_bcd_ppc.h:2563
static vBCD_t vec_bcdsub(vBCD_t a, vBCD_t b)
Subtract two Vector Signed BCD 31 digit values.
Definition: vec_bcd_ppc.h:3445
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 int vec_bcdcmpeq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for equal.
Definition: vec_bcd_ppc.h:2387
__vector __bool __int128 vb128_t
vector of one 128-bit bool __int128 element.
Definition: vec_common_ppc.h:240
static vui8_t vec_bcdctz(vBCD_t vrb)
Vector Decimal Convert To Zoned.
Definition: vec_bcd_ppc.h:2806
static vb128_t vec_cmpneuq(vui128_t vra, vui128_t vrb)
Vector Compare Not Equal Unsigned Quadword.
Definition: vec_int128_ppc.h:3475
static _Decimal128 vec_unpack_Decimal128(vf64_t lval)
Unpack a doubleword vector (vector double) into a FPR pair. (_Decimal128).
Definition: vec_bcd_ppc.h:5009
static vBCD_t vec_bcdcfud(vui64_t vrb)
Vector Decimal Convert From Unsigned doubleword returning up to 2x16 BCD digits.
Definition: vec_bcd_ppc.h:2046
static vBCD_t vec_bcdslqi(vBCD_t vra, const unsigned int _N)
Vector BCD Shift Right Signed Quadword.
Definition: vec_bcd_ppc.h:3208
static vui128_t vec_rdxct10e32q(vui64_t vra)
Vector Decimal Convert radix 10E16 digit pairs to radix 10E32 __int128 quadwords.
Definition: vec_bcd_ppc.h:4818
_Decimal128 dpd128
128 bit Decimal Float from pair of double float registers.
Definition: vec_common_ppc.h:264
static vbBCD_t vec_bcdcmp_eqsq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for equal.
Definition: vec_bcd_ppc.h:2185
#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 vui128_t vec_bcdctuq(vBCD_t vra)
Vector Decimal Convert groups of 32 BCD digits to binary unsigned quadword.
Definition: vec_bcd_ppc.h:2745
static vui8_t vec_slbi(vui8_t vra, const unsigned int shb)
Vector Shift left Byte Immediate.
Definition: vec_char_ppc.h:809
static vBCD_t vec_bcdmulh(vBCD_t a, vBCD_t b)
Vector Signed BCD Multiply High.
Definition: vec_bcd_ppc.h:3033
static vui8_t vec_rdxcf10kh(vui16_t vra)
Vector Decimal Convert radix 10,000 Binary halfwords to pairs of radix 100 binary bytes.
Definition: vec_bcd_ppc.h:4326
static int vec_bcdcmpge(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for greater than or equal.
Definition: vec_bcd_ppc.h:2417
static vBCD_t vec_bcdsubcsq(vBCD_t a, vBCD_t b)
Decimal Sudtract & write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:3494
static int vec_cmpuq_all_ne(vui128_t vra, vui128_t vrb)
Vector Compare all Not Equal Unsigned Quadword.
Definition: vec_int128_ppc.h:4025
static vBCD_t vec_cbcdaddcsq(vBCD_t *cout, vBCD_t a, vBCD_t b)
Combined Decimal Add & Write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:3869
__vector unsigned short vui16_t
vector of 16-bit unsigned short elements.
Definition: vec_common_ppc.h:204
static vui64_t vec_srdi(vui64_t vra, const unsigned int shb)
Vector Shift Right Doubleword Immediate.
Definition: vec_int64_ppc.h:3604
static vui8_t vec_rdxcf100b(vui8_t vra)
Vector Decimal Convert Binary Coded Decimal (BCD) digit pairs from radix 100 binary integer bytes.
Definition: vec_bcd_ppc.h:4275
static vui128_t vec_vmuleud(vui64_t a, vui64_t b)
Vector Multiply Even Unsigned Doublewords.
Definition: vec_int128_ppc.h:7487
static vui16_t vec_bcdctuh(vBCD_t vra)
Vector Decimal Convert groups of 4 BCD digits to binary unsigned halfwords.
Definition: vec_bcd_ppc.h:2659
static int vec_cmpuq_all_eq(vui128_t vra, vui128_t vrb)
Vector Compare all Equal Unsigned Quadword.
Definition: vec_int128_ppc.h:3804
static vBCD_t vec_bcdcfsq(vi128_t vrb)
Vector Decimal Convert From Signed Quadword returning up to 31 BCD digits.
Definition: vec_bcd_ppc.h:1992
static vBCD_t vec_cbcdaddecsq(vBCD_t *cout, vBCD_t a, vBCD_t b, vBCD_t cin)
Combined Decimal Add Extended & write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:3944
__vector __int128 vi128_t
vector of one 128-bit signed __int128 element.
Definition: vec_common_ppc.h:235
static vBCD_t vec_bcdsruqi(vBCD_t vra, const unsigned int _N)
Vector BCD Shift Right Unsigned Quadword immediate.
Definition: vec_bcd_ppc.h:3420
static vBCD_t vec_bcdtruncqi(vBCD_t vra, const unsigned short _N)
Decimal Truncate Quadword Immediate. Truncate a vector signed BCD value vra to N-digits,...
Definition: vec_bcd_ppc.h:3693
static vBCD_t vec_bcdsr(vBCD_t vra, vi8_t vrb)
Decimal Shift and Round. Shift a vector signed BCD value, left or right a variable amount of digits (...
Definition: vec_bcd_ppc.h:3265
static vBCD_t vec_bcds(vBCD_t vra, vi8_t vrb)
Decimal Shift. Shift a vector signed BCD value, left or right a variable amount of digits (nibbles)....
Definition: vec_bcd_ppc.h:3097
static vBCD_t vec_bcdtrunc(vBCD_t vra, vui16_t vrb)
Decimal Truncate. Truncate a vector signed BCD value vra to N-digits, where N is the unsigned integer...
Definition: vec_bcd_ppc.h:3646
static vbBCD_t vec_bcdcmp_nesq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for not equal.
Definition: vec_bcd_ppc.h:2355
static vBCD_t vec_bcdsubecsq(vBCD_t a, vBCD_t b, vBCD_t c)
Decimal Add Extended & write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:3550
#define _BCD_CONST_MINUS_ONE
vector signed BCD constant -1.
Definition: vec_bcd_ppc.h:1574
__vector unsigned long long vui64_t
vector of 64-bit unsigned long long elements.
Definition: vec_common_ppc.h:208
static vBCD_t vec_bcdmul(vBCD_t a, vBCD_t b)
Multiply two Vector Signed BCD 31 digit values.
Definition: vec_bcd_ppc.h:2949
#define CONST_VINT128_H(__hw0, __hw1, __hw2, __hw3, __hw4, __hw5, __hw6, __hw7)
Arrange halfword elements of a unsigned int initializer in high->low order. May require an explicit c...
Definition: vec_common_ppc.h:309
static vbBCD_t vec_bcdcmp_gtsq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for greater than.
Definition: vec_bcd_ppc.h:2253
Common definitions and typedef used by the collection of Power Vector Library (pveclib) headers.
static vBCD_t vec_bcdaddecsq(vBCD_t a, vBCD_t b, vBCD_t c)
Decimal Add Extended & write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:1892
__vector unsigned char vui8_t
vector of 8-bit unsigned char elements.
Definition: vec_common_ppc.h:202
static vui8_t vec_srbi(vui8_t vra, const unsigned int shb)
Vector Shift Right Byte Immediate.
Definition: vec_char_ppc.h:905
static vBCD_t vec_DFP2BCD(_Decimal128 val)
Convert a __Decimal128 value to Vector BCD.
Definition: vec_bcd_ppc.h:1748
#define _BCD_CONST_ZERO
vector signed BCD constant +0.
Definition: vec_bcd_ppc.h:1576
static vBCD_t vec_bcddiv(vBCD_t a, vBCD_t b)
Divide a Vector Signed BCD 31 digit value by another BCD value.
Definition: vec_bcd_ppc.h:2870
static vBCD_t vec_bcdsrrqi(vBCD_t vra, const unsigned int _N)
Vector BCD Shift Right and Round Signed Quadword Immediate.
Definition: vec_bcd_ppc.h:3364
static vui64_t vec_rdxct10E16d(vui32_t vra)
Vector Decimal Convert radix 100,000,000 digit word pairs to radix 10E16 binary integer doublewords.
Definition: vec_bcd_ppc.h:4769
static vui64_t vec_subudm(vui64_t a, vui64_t b)
Vector Subtract Unsigned Doubleword Modulo.
Definition: vec_int64_ppc.h:3746
#define _BCD_CONST_PLUS_NINES
vector signed BCD constant +9s.
Definition: vec_bcd_ppc.h:1570
static int vec_bcdcmple(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for less than or equal.
Definition: vec_bcd_ppc.h:2477
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
static vb128_t vec_setbool_bcdsq(vBCD_t vra)
Vector Set Bool from Signed BCD Quadword.
Definition: vec_bcd_ppc.h:4928
static vBCD_t vec_bcdadd(vBCD_t a, vBCD_t b)
Decimal Add Signed Modulo Quadword.
Definition: vec_bcd_ppc.h:1789
static vui8_t vec_rdxct100b(vui8_t vra)
Vector Decimal Convert Binary Coded Decimal (BCD) digit pairs to radix 100 binary integer bytes.
Definition: vec_bcd_ppc.h:4623
static _Decimal128 vec_BCD2DFP(vBCD_t val)
Convert a Vector Signed BCD value to __Decimal128.
Definition: vec_bcd_ppc.h:1663
static int vec_signbit_bcdsq(vBCD_t vra)
Vector Sign bit from Signed BCD Quadword.
Definition: vec_bcd_ppc.h:4976
__vector unsigned __int128 vui128_t
vector of one 128-bit unsigned __int128 element.
Definition: vec_common_ppc.h:237
static vui64_t vec_bcdctud(vBCD_t vra)
Vector Decimal Convert groups of 16 BCD digits to binary unsigned doublewords.
Definition: vec_bcd_ppc.h:2711
static vui128_t vec_msumudm(vui64_t a, vui64_t b, vui128_t c)
Vector Multiply-Sum Unsigned Doubleword Modulo.
Definition: vec_int128_ppc.h:5202
static vui128_t vec_vmuloud(vui64_t a, vui64_t b)
Vector Multiply Odd Unsigned Doublewords.
Definition: vec_int128_ppc.h:7733
Union used to transfer 128-bit data between vector and non-vector types.
Definition: vec_common_ppc.h:256
static vui64_t vec_rdxcf10e32q(vui128_t vra)
Vector Decimal Convert radix 10**32 Binary quadword to pairs of radix 10**16 binary doublewords.
Definition: vec_bcd_ppc.h:4489
static vui128_t vec_zndctuq(vui8_t zone00, vui8_t zone16)
Vector Zoned Decimal Convert 32 digits to binary unsigned quadword.
Definition: vec_bcd_ppc.h:5049
#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 vui64_t vec_mulouw(vui32_t a, vui32_t b)
Vector multiply odd unsigned words.
Definition: vec_int32_ppc.h:1043
static vui8_t vec_mulubm(vui8_t vra, vui8_t vrb)
Vector Multiply Unsigned Byte Modulo.
Definition: vec_char_ppc.h:664
static vbBCD_t vec_bcdcmp_gesq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for greater than or equal.
Definition: vec_bcd_ppc.h:2219
__vector signed char vi8_t
vector of 8-bit signed char elements.
Definition: vec_common_ppc.h:211
#define _BCD_CONST_PLUS_ONE
vector signed BCD constant +1.
Definition: vec_bcd_ppc.h:1572
static vBCD_t vec_bcdsubesqm(vBCD_t a, vBCD_t b, vBCD_t c)
Decimal Subtract Extended Signed Modulo Quadword.
Definition: vec_bcd_ppc.h:3613
static vb128_t vec_setb_sq(vi128_t vra)
Vector Set Bool from Signed Quadword.
Definition: vec_int128_ppc.h:6576
static vBCD_t vec_bcdcfuq(vui128_t vra)
Vector Decimal Convert From Unsigned Quadword returning up to 32 BCD digits.
Definition: vec_bcd_ppc.h:2083
static vBCD_t vec_bcdcfz(vui8_t vrb)
Vector Decimal Convert From Zoned.
Definition: vec_bcd_ppc.h:2126
static vBCD_t vec_bcdaddcsq(vBCD_t a, vBCD_t b)
Decimal Add & write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:1836
static vui64_t vec_BCD2BIN(vBCD_t val)
Convert vector of 2 x unsigned 16-digit BCD values to vector 2 x doubleword binary values.
Definition: vec_bcd_ppc.h:1622
static vBCD_t vec_bcdutruncqi(vBCD_t vra, const unsigned short _N)
Decimal Unsigned Truncate Quadword Immediate. Truncate a vector unsigned BCD value vra to N-digits,...
Definition: vec_bcd_ppc.h:3825
static vBCD_t vec_cbcdsubcsq(vBCD_t *cout, vBCD_t a, vBCD_t b)
Combined Decimal Subtract & Write Carry Signed Quadword.
Definition: vec_bcd_ppc.h:4135
static int vec_bcdcmpgt(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for greater than.
Definition: vec_bcd_ppc.h:2447
#define CONST_VINT128_B(_b0, _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8, _b9, _b10, _b11, _b12, _b13, _b14, _b15)
Arrange byte elements of a unsigned int initializer in high->low order. May require an explicit cast.
Definition: vec_common_ppc.h:316
static vui64_t vec_mrgald(vui128_t vra, vui128_t vrb)
Vector Merge Algebraic Low Doublewords.
Definition: vec_int64_ppc.h:2736
static _Decimal128 vec_quantize0_Decimal128(_Decimal128 val)
Quantize (truncate) a _Decimal128 value before convert to BCD.
Definition: vec_bcd_ppc.h:4235
static vi128_t vec_bcdctsq(vBCD_t vra)
Vector Decimal Convert to Signed Quadword.
Definition: vec_bcd_ppc.h:2597
static vui64_t vec_mrgahd(vui128_t vra, vui128_t vrb)
Vector Merge Algebraic High Doublewords.
Definition: vec_int64_ppc.h:2710
__vector unsigned int vui32_t
vector of 32-bit unsigned int elements.
Definition: vec_common_ppc.h:206
#define CONST_VINT128_DW128(__dw0, __dw1)
A vector unsigned __int128 initializer, as two unsigned long long elements in high->low order.
Definition: vec_common_ppc.h:301
static vui64_t vec_mulhud(vui64_t vra, vui64_t vrb)
Vector Multiply High Unsigned Doubleword.
Definition: vec_int128_ppc.h:5277
static vBCD_t vec_bcddive(vBCD_t a, vBCD_t b)
Decimal Divide Extended.
Definition: vec_bcd_ppc.h:2900
static vui32_t vec_bcdctuw(vBCD_t vra)
Vector Decimal Convert groups of 8 BCD digits to binary unsigned words.
Definition: vec_bcd_ppc.h:2684
#define _BCD_CONST_SIGN_MASK
vector BCD sign mask in bits 124:127.
Definition: vec_bcd_ppc.h:1578
#define VEC_HW_L_DWH
Element index for lowest order hword of the high dword.
Definition: vec_common_ppc.h:340
static vui128_t vec_adduqm(vui128_t a, vui128_t b)
Vector Add Unsigned Quadword Modulo.
Definition: vec_int128_ppc.h:2739
static vui8_t vec_rdxcfzt100b(vui8_t zone00, vui8_t zone16)
Vector Decimal Convert Zoned Decimal digit pairs to to radix 100 binary integer bytes....
Definition: vec_bcd_ppc.h:4559
static vui64_t vec_addudm(vui64_t a, vui64_t b)
Vector Add Unsigned Doubleword Modulo.
Definition: vec_int64_ppc.h:1261
__vector double vf64_t
vector of 64-bit double elements.
Definition: vec_common_ppc.h:221
static vui128_t vec_srq(vui128_t vra, vui128_t vrb)
Vector Shift Right Quadword.
Definition: vec_int128_ppc.h:7114
static vui128_t vec_mulhuq(vui128_t a, vui128_t b)
Vector Multiply High Unsigned Quadword.
Definition: vec_int128_ppc.h:5387
static vBCD_t vec_bcdsrqi(vBCD_t vra, const unsigned int _N)
Vector BCD Shift Right Signed Quadword Immediate.
Definition: vec_bcd_ppc.h:3335
vui32_t vx4
128 bit Vector of 4 unsigned int elements.
Definition: vec_common_ppc.h:273
static vb128_t vec_setbool_bcdinv(vBCD_t vra)
Vector Set Bool from Signed BCD Quadword if invalid.
Definition: vec_bcd_ppc.h:4857
vf64_t vf2
128 bit Vector of 2 double float elements.
Definition: vec_common_ppc.h:279
#define vBCD_t
vector signed BCD integer of up to 31 decimal digits.
Definition: vec_bcd_ppc.h:1565
static vui16_t vec_rdxcf100mw(vui32_t vra)
Vector Decimal Convert radix 10**8 Binary words to pairs of radix 10,000 binary halfwords.
Definition: vec_bcd_ppc.h:4372
static vui32_t vec_rdxct100mw(vui16_t vra)
Vector Decimal Convert radix 10,000 digit halfword pairs to radix 100,000,000 binary integer words.
Definition: vec_bcd_ppc.h:4720
static vbBCD_t vec_bcdcmp_lesq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for less than or equal.
Definition: vec_bcd_ppc.h:2287
static vBCD_t vec_bcdutrunc(vBCD_t vra, vui16_t vrb)
Decimal Unsigned Truncate. Truncate a vector unsigned BCD value vra to N-digits, where N is the unsig...
Definition: vec_bcd_ppc.h:3781
static vBCD_t vec_bcdsetsgn(vBCD_t vrb)
Vector Set preferred BCD Sign.
Definition: vec_bcd_ppc.h:3158
static vui128_t vec_slqi(vui128_t vra, const unsigned int shb)
Vector Shift Left Quadword Immediate.
Definition: vec_int128_ppc.h:6748
static vui16_t vec_rdxct10kh(vui8_t vra)
Vector Decimal Convert radix 100 digit pairs to radix 10,000 binary integer halfwords.
Definition: vec_bcd_ppc.h:4672
static vBCD_t vec_cbcdmul(vBCD_t *p_high, vBCD_t a, vBCD_t b)
Combined Vector Signed BCD Multiply High/Low.
Definition: vec_bcd_ppc.h:4045
static vui128_t vec_slq(vui128_t vra, vui128_t vrb)
Vector Shift Left Quadword.
Definition: vec_int128_ppc.h:6707
static vBCD_t vec_bcdsluqi(vBCD_t vra, const unsigned int _N)
Vector BCD Shift Right unsigned Quadword.
Definition: vec_bcd_ppc.h:3238
#define VEC_W_L
Element index for lowest order word.
Definition: vec_common_ppc.h:328
static vf64_t vec_pack_Decimal128(_Decimal128 lval)
Pack a FPR pair (_Decimal128) to a doubleword vector (vector double).
Definition: vec_bcd_ppc.h:4199
static vui128_t vec_mul10euq(vui128_t a, vui128_t cin)
Vector Multiply by 10 Extended Unsigned Quadword.
Definition: vec_int128_ppc.h:4903
static vbBCD_t vec_bcdcmp_ltsq(vBCD_t vra, vBCD_t vrb)
Vector Compare Signed BCD Quadword for less than.
Definition: vec_bcd_ppc.h:2321
Header package containing a collection of 128-bit SIMD operations over 8-bit integer (char) elements.
#define VEC_BYTE_L_DWH
Element index for lowest order byte of the high dword.
Definition: vec_common_ppc.h:346
#define VEC_HW_L
Element index for lowest order hword.
Definition: vec_common_ppc.h:342