diff --git a/src/pveclib/vec_f128_ppc.h b/src/pveclib/vec_f128_ppc.h index e02ac8b..80f2c92 100644 --- a/src/pveclib/vec_f128_ppc.h +++ b/src/pveclib/vec_f128_ppc.h @@ -86,16 +86,27 @@ * It also looks like there is significant instruction latency * associated with the XER carry bit required for extended (128-bit) * integer arithmetic. - * - * \note Both of these issues can be avoided by providing a soft-float + * \note The first issue (parameter store reload) is a compiler bug. + * The second issue is an attribute of the hardware implementation + * and associate trade-offs. + * Both of these issues can be avoided by providing a soft-float * implementation for __float128 using VSX vector 128-bit arithmetic and - * logical operations. So far direct comparisons for _float128 compare - * and conversion operations show a significant performance gain for - * the PVECLIB vector implementations vs the GCC KF mode runtime. - * The most convincing results will come when the round-to-odd - * implementations for IEEE-128 add and multiply are available. - * This allows direct performance comparison across __float128 - * arithmetic operations. Please stand by. + * logical operations. + * + * For the QP operations that have libgcc implementations and we have + * corresponding PVECLIB implementations we can do direct + * performance comparisons. So far micro-benchmarks show a significant + * performance gain for the PVECLIB vector implementations vs the + * GCC KF mode runtime. + * + * | Power8 QP | cmpqp |cvtdpqp|cvtqpdp|cvtuqqp|cvtqpuq| mulqp | addqp | + * |-----------:|:-----:|:------:|:-----:|:-----:|:-----:|:-----:|:------| + * |\%improvement| 263.3 | 58.4 | 157.8 | 34.6 | 241.3 | 46.8 | 118.4 | + * + * \note These micro-benchmarks and others are included in + * src/testsuite. Specifically files vec_perf_f128.c and + * vec_f128_dummy.c. Make check will compile the appropriate files + * and link them into the pveclib_perf executable. * * There are number of __float128 operations that should generate a * single instruction for POWER9 and few (less than 10) instructions @@ -120,18 +131,23 @@ * built-in runtime functions. Performing these operations in-line and * directly in vector registers (VRs) avoids call/return and VR <-> GPR * transfer overhead. - * * It also seems reasonable to provide Quad-Precision extract/insert * exponent/significand and compare exponent operations for POWER7/8. - * And with the PowerISA 3.1 release providing POWER9/8 implementations - * of min/max and quadword integer converts. * - * The quad-precision arithmetic, compare, and conversion operations - * are large enough that most applications will want to call a library. + * The PVECLIB implementations for quad-precision arithmetic and + * conversion operations are large enough + * that most applications will want to call a library. * PVECLIB will build and release the appropriate CPU tuned libraries. * This will follow the general design used for multiple * quadword integer multiply functions (vec_int512_ppc.h). * + * \note At this time, PVECLIB does not intend to replace existing + * GCC/libm IEEE-128 runtime APIs and will maintain it own unique + * name-space. However if the maintainers of these projects want to + * leverage PVECLIB they are allowed under the terms of the + * + * Apache License, Version 2.0. + * * These PVECLIB operations should be useful for applications using * Quad-Precision while needing to still support POWER8 but also * build for POWER9/10. @@ -140,15 +156,8 @@ * operators and functions as point optimizations. * The largest gains will be seen for builds targeting POWER8 without * degrading performance when targeting POWER9/10. - * They should also be useful and improve performance for - * soft-float implementations of math library functions. - * - * \note At this time, PVECLIB does not intend to replace existing - * GCC/libm IEEE-128 runtime APIs and will maintain it own unique - * name-space. However if the maintainers of these projects want to - * leverage PVECLIB they are allowed under the terms of the - * - * Apache License, Version 2.0. + * They should also be useful and improve performance of soft-float + * implementations of Quad-Precision math library functions. * * \note The compiler disables associated built-ins if the * mcpu target does not enable the specific instruction. @@ -174,7 +183,7 @@ * soft-float runtime implementation provided for POWER8. * Examples include the arithmetic/conversion operations supporting * the round-to-odd override. - * - Providing special vector float tests for special conditions + * - Providing vector float tests for special conditions * without generating extraneous floating-point exceptions. * This is important for implementing __float128 forms of ISO C99 Math * functions. Examples include vector isnan, isinf, etc. @@ -217,7 +226,7 @@ * - Quad-Precision comparison operators. * - Initially ignore special cases and exceptions * - Add Signed Zero, Infinity. and NaN special cases - * - Exceptions when someone asks + * - Exceptions (FPSCR) when someone asks * - Quad-Precision from/to integer word/doubleword/quadword. * - Cases that don't require rounding (i.e truncate and DW to QP). * - Cases that require rounding @@ -227,14 +236,14 @@ * - Quad-Precision arithmetic * - Add/Sub/Mul * - Round-to-Odd first - * - Initially ignore special cases and exceptions * - Fused Multiply-Add * - Round-to-Odd first * - Divide * - Round-to-Odd first - * - Add Signed Zero, Infinity. and NaN special cases + * - Will need vec_int128_ppc.h implementation of vec_divuq() + * - Signed Zero, Infinity. and NaN special cases * - Other rounding modes - * - Exceptions when someone asks + * - Exceptions (FPSCR) when someone asks * * The intent is that such PVECLIB operations can be mixed in with or * substituted for C Language _FLoat128 expressions or functions. @@ -245,10 +254,12 @@ * limited resources. * * \note We are focusing on POWER8 here because the implementation gets - * a lot harder for POWER7 and earlier. POWER7 is missing: Quadword - * integer add/sub with carry extend. Wide (word) integer multiply. - * Direct transfer between VRs and GPRs. Doubleword integer arithmetic, - * compares. and count-leading zeros. + * a lot harder for POWER7 and earlier. POWER7 is missing: + * - Vector Quadword integer add/sub with carry extend. + * - Vector Doubleword integer arithmetic, compares. + * and count-leading zeros. + * - Vector Word integer multiply. + * - Direct transfer between VRs and GPRs. * * \subsection f128_softfloat_0_0_0 Quad-Precision data class and exponent access for POWER8 * @@ -429,9 +440,11 @@ vec_xsxexpqp (__binary128 f128) xsxexpqp v2,v2 * \endcode * - * \note Should use the intrinsic scalar_extract_exp() here but this is - * not available until GCC 11. So use in-line assembler until the - * internsic is available and verified. + * \note Would like to use the intrinsic scalar_extract_exp() here but + * this is not available until GCC 11. + * Also GCC defines these scalar built-ins to return integer scalar + * values in GPRs. + * This would defeat the purpose of an all vector implementation. * * For POWER8 we generate * \code @@ -507,6 +520,8 @@ vec_xsxexpqp (__binary128 f128) * additional bits to support normalization and rounding. * The PowerISA describes a * VSX Execution Model for IEEE Operations + * \sa PowerISA 3.0B, Book I, Section 7.3.3 + * VSX Floating-Point Execution Models. * * IEEE quad-precision execution model * | | | 0 |1 ----------------------------- 112| | | | @@ -535,12 +550,15 @@ vec_xsxexpqp (__binary128 f128) * For left shifts, 0 bits shifted into the R-bit * (the X-bit is ignored). * - * As mentioned before, it is convenient to keep sign-bit in a separate - * vector quadword. Its not an extension of the significand but is + * As mentioned before, it is convenient to keep the sign-bit in a + * separate vector quadword. + * This not an extension of the significand but is * needed to select results for arithmetic and some rounding modes. - * * The remaining (C through X) bits can be represented in a vector - * quadword register or a register pair. For example integer to QP + * quadword register or a register pair. + * + * \paragraph f128_softfloat_IRRN_0_1_1 IR for conversion + * For example integer to QP * conversions can be represented in a vector quadword by left * justifying the magnitude before normalization and rounding. * For example from vec_xscvuqqp(): @@ -561,15 +579,10 @@ vec_xsxexpqp (__binary128 f128) ... } * \endcode - * The simplest case is Round Toward Zero - * \code - // Round toward zero to normalize and truncate - q_sig = vec_srqi ((vui128_t) q_sig, 15); - ... - q_exp = vec_swapd (q_exp); - result = vec_xsiexpqp (q_sig, q_exp); - ... - * \endcode + * + * See \ref f128_softfloat_IRRN_0_2_1 + * and \ref f128_softfloat_IRRN_0_2_2. + * * The Round to Nearest Even case may increment the significand * and that may generate a carry from the L-bit. One option is * to use vec_addcuq() to capture the carry. For example: @@ -593,22 +606,119 @@ vec_xsxexpqp (__binary128 f128) * In this case having the carry as a separate vector simplifies * adjusting the exponent. * - * Other cases that require quadword register pairs are QP - * Multiply and Multiply-Add. The product of two 113-bit - * significands requires 226-bits. We can use operations from - * vec_int128_ppc.h. By pre-adjusting the inputs before the - * multiply we can align the split between the high and low 113-bits + * \paragraph f128_softfloat_IRRN_0_1_2 IR for addition + * Quad-precision addition and subtraction is a case where right + * justifying the IR is helpful. + * For addition/subtraction the IR only needs 117-bits which + * can be accommodated in a single 128-vector. + * Significands (which includes the leading/implicit bit) can be + * converted to IR form by shifting left 3-bits. + * This still leaves room on the left for the carry-bit. + * For example: + * \code + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + * \endcode + * In this case we need to insure that any right shifts of the + * IR collect any bits shifted-away into the X-bit. + * For example: + * \code + // At this point we can assume that: + // 1) The magnitude (vfa) >= magnitude (vfb) + // 1a) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 1b) The GRX-bits of a_sig/b_sig are still 0b000. + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) bits + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + // Collect any bits shifted-away, into a single carry bit + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + // OR this into the X-bit + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + * \endcode + * In this case, condition-1 means that, only b_sig needs right + * shifting before significand addition. + * The a_sig can be used directly as it had previously been + * left shifted 3-bits where the GRX-bits were set to 0b000. + * + * A simpler case occurs when addition generates a carry. Here we + * need to shift right 1-bit while preserving any nonzero X-bit. + * For example: + * \code + * // Check for carry and adjust + if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + * \endcode + * These two sequences preserve the X-bit going into the rounding stage. + * See \ref f128_softfloat_IRRN_0_2_1 + * and \ref f128_softfloat_IRRN_0_2_6. + * + * \paragraph f128_softfloat_IRRN_0_1_3 IR for multiply + * Quad-precision Multiply and Multiply-Add require quadword register + * pairs to hold the IR product. The product of two 113-bit + * significands requires 226-bits. This includes the product C-/L-bits + * but we will need at least 3 additional bits for GRX. + * + * We can use operations from + * vec_int128_ppc.h to produce the double quadword product. + * By pre-adjusting the inputs before the + * multiply we can align the split between the high 114-bits + * (right justified) and low 112-bits (left justified) * of the product to align with the high and low quadword registers. * For example: * \code - ... // Not final - // Pre-align that multiply inputs so that the product is split - // with the L-Fraction-bits in high_sig, and GRX-bits in low_sig. + // Pre-align the multiply inputs so that the product is split + // with the CL-Fraction-bits in high_sig, and GRX-bits in low_sig. a_sig = vec_slqi (a_sig, 8); - b_sig = vec_slqi (b_sig, 7); + b_sig = vec_slqi (b_sig, 8); low_sig = vec_muludq (&high_sig, a_sig, b_sig); * \endcode - * This simplifies the Round to Odd case. + * The high_sig includes the C-/L-bits and high-order 112-bits of + * product fraction. + * The low_sig includes the low order 112-bits of the fraction + * followed by 16-bits of zero. + * + * Most of the low-order fraction bits contribute to the X-bit. + * So we can normally delay collecting x-bits until the rounding stage. + * Only the most extreme denormals will result in a right shift large + * enough to require intervention to preserve bits that would otherwise + * be shifted away. + * + * After normalization the high-order bits of low_sig become the + * GRX-bits. Actually we can treat the low order 126-bits as + * uncollected x-bits. We use this to simplify the rounding process. + * For this case we can manipulate low_sig to generate a carry + * for rounding up/down/odd and then add/subtract/or this carry + * to high_sig to produce the rounded product significand. + * See \ref f128_softfloat_IRRN_0_2_1 + * and \ref f128_softfloat_IRRN_0_2_6. * * \subsubsection f128_softfloat_IRRN_0_2 Rounding for Quad-Precision * @@ -677,60 +787,100 @@ vec_xsxexpqp (__binary128 f128) * - Otherwise, choose NL, and if G=1, or R=1, or X=1, * set the least significant bit to 1. * - * Coding examples TBD. Full examples waiting for - * VSX Scalar Round to Quad-Precision Integer implementation. - * - * Coding example for Round to Nearest Even. + * \note The coding examples that follow are incomplete. + * More examples will be provided are more operation are completed + * and tested. + * + * The exact coding for rounding modes depends on how the IR is + * represented in vector registers and this may differ by operation. + * Conversions, addition, and subtraction tend to use a single + * vector register where the GRX resides in the low-order bits. + * While Multiplies generate double quadword results and so use + * vector register pairs. Here the CL and Fraction bits are right + * justified in a high_sig vector. While the low-order fraction/GRX + * bits are left justified in a low_sig vector. + * + * \paragraph f128_softfloat_IRRN_0_2_1 Examples for Round to Nearest Even + * Example for Convert to Quad-precision: * \code - const vui32_t RXmask = CONST_VINT128_W ( 0, 0, 0, 0x3fff); - const vui32_t lowmask = CONST_VINT128_W ( 0, 0, 0, 1); - vui128_t q_carry, q_sigc; - vb128_t qcmask; - vui32_t q_odd; - - // The Significand (including the L-bit) is right justified in - // in the high-order 113-bits of q_sig. - // The guard, round, and sticky (GRX) bits are in the low-order - // 15 bits. - // - // For "Round to Nearest Even". - // GRX = 0b001 - 0b011; truncate - // GRX = 0b100 and bit-112 is odd; round up, otherwise truncate - // GRX = 0b100 - 0b111; round up - // We simplify by copying bit-112 and ORing it with X-bits. - // Then add 0x3fff to q_sig will generate a carry into bit-112 - // if and only if GRX > 0b100 or (GRX == 0b100) && (bit-112 == 1) - // Isolate bit-112 and OR into GRX bits if q_sig is odd - q_odd = (vui32_t) vec_srhi ((vui16_t)q_sig, 15); - q_odd = vec_and (q_odd, lowmask); - q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_odd); - // Now we round by adding 0x3fff to GRX-bits, which may - // carry into bit-112, incrementing the significand. - // This may result in a carry out of bit L into bit-C. + ... + // We add 0x3fff to GRX-bits which may carry into low order sig-bit + // This may result in a carry out from the L-bit into C-bit. q_carry = vec_addcuq (q_sig, (vui128_t) RXmask); q_sig = vec_adduqm (q_sig, (vui128_t) RXmask); - // Now we have two cases with and without carry/renormalize // Generate a bool mask from the carry to use in the vsel qcmask = vec_setb_cyq (q_carry); - // case 1) We did carry so shift left (double quadword) 112 bits + // Two cases; 1) We did carry so shift (double) left 112 bits q_sigc = vec_sldqi (q_carry, q_sig, 112); - // case 2) no carry so shift right 15 bits + // 2) no carry so shift right 15 bits q_sig = vec_srqi ((vui128_t) q_sig, 15); - // Select result based on on carry bool + // Select which based on carry q_sig = (vui128_t) vec_sel ((vui32_t) q_sig, (vui32_t) q_sigc, (vui32_t) qcmask); - // Increment the exponent based on the carry-bit + // Increment the exponent based on the carry q_exp = vec_addudm (q_exp, (vui64_t) q_carry); * \endcode * This code runs about 16 instructions. * - * Coding example for Round toward Zero + * Example for Add/Subtract Quad-precision: + * \code + // Round to nearest even from low_sig bits + // For "round to Nearest, ties to even". + // GRX = 0b001 - 0b011; truncate + // GRX = 0b100 and bit-127 is odd; round up, otherwise truncate + // GRX = 0b100 - 0b111; round up + + const vui32_t rmask = CONST_VINT128_W(0, 0, 0, 3); + vui128_t p_rnd; + // We can simplify by copying the low order fraction bit (p_odd) + // and ADD it to the bit-X. This forces a tie into rounding up + // if the current fraction is odd, making it even. + // This simplifies to (s_sig + rmask + p_odd) + // Rounding will generate a carry into the low order fraction bit + // if and only if GRX > 0b100 or (GRX == 0b100) && (bit-127 == 1) + + p_tmp = vec_srqi (s_sig, 3); + p_odd = (vui128_t) vec_and ((vui32_t) p_tmp, onemask); + s_sig = vec_addecuq (s_sig, (vui128_t) rmask, p_odd); + q_sig = vec_srqi (s_sig, 3); + * \endcode + * Adding 3 plus the fraction odd bit to thex GRX-bits generates + * a carry into the low-order fraction bit for rounding. + * In this case we use the extend form of add quadword to + * effect a 3 way add. + * After rounding convert the IR into a significand + * by shifting right 3 bits. + * + * Example for Multiply Quad-precision: + * \code + const vui32_t rmask = CONST_VINT128_W(0x7fffffff, -1, -1, -1); + vui128_t p_rnd; + // We can simplify by copying the low order bit (p_odd) of high_sig + // and OR it with the bit-X. This forces a tie into rounding up + // if the current fraction is odd, making it even. + // This simplifies to the carry from (low_sig + rmask + p_odd) + // Rounding will generate a carry into p_rnd. + // if and only if GRX > 0b100 or (GRX == 0b100) && (bit-127 == 1) + p_odd = (vui128_t) vec_and ((vui32_t) high_sig, onemask); + p_rnd = vec_addecuq (low_sig, (vui128_t) rmask, p_odd); + q_sig = vec_adduqm (high_sig, p_rnd); + * \endcode + * Here we take advantage of uncollected x-bits in low_sig. + * Until we add the rmask and generate the carry, we can OR/ADD + * p_odd to any bit in low_sig except the Guard or Round bits. + * In this case we use the extend/carry form of add quadword to + * effect a 3 way add and generate the carry/round bit. + * + * + * \paragraph f128_softfloat_IRRN_0_2_2 Examples for Round toward Zero + * Example for Convert Quadword to Quad-precision: * \code // Simplest case, shift right 15 bits q_sig = vec_srqi ((vui128_t) q_sig, 15); * \endcode * This code runs about 3 instructions. * - * Coding example for Round to Odd + * \paragraph f128_softfloat_IRRN_0_2_6 Examples for Round to Odd + * Example for Convert to Quad-precision. * \code const vui32_t RXmask = CONST_VINT128_W ( 0, 0, 0, 0x7fff); vui32_t q_odd; @@ -746,6 +896,26 @@ vec_xsxexpqp (__binary128 f128) * \endcode * This code runs about 6 instructions to load the mask and round=odd. * + * Example for Add/Subtract Quad-precision: + * \code + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + * \endcode + * + * Examples for Multiply Quad-precision. + * For this case we can manipulate low_sig to generate a carry + * for rounding up/down/odd and then add/subtract/or this carry + * to high_sig to produce the rounded product significand. + * For example round-to-odd: + * \code + // Round to odd from low_sig bits + p_odd = vec_addcuq (low_sig, (vui128_t) q_ones); + q_sig = (vui128_t) vec_or ((vui32_t) high_sig, (vui32_t) p_odd); + * \endcode + * * \subsection f128_softfloat_0_0_1 Quad-Precision compares for POWER8 * * IEEE floating-point compare is a bit more complicated than binary @@ -768,7 +938,7 @@ vec_xsxexpqp (__binary128 f128) * floating-point compares, * \=s, \<s, \<\=s, \>s * and \>\=s, are signed integer compares, - * and \=s, \>u, and \>\=u are unsigned + * and \=u, \>u, and \>\=u are unsigned * integer compares. * * \see "Hacker's Delight, 2nd Edition," @@ -2082,10 +2252,567 @@ test_mulqpo_PWR9 (__binary128 vfa, __binary128 vfb) q_exp = q_naninf; q_sig = (vui128_t) q_zero; } - } - } + } + } + * \endcode + * + * + * \subsubsection f128_softfloat_0_0_3_2 Add Quad-Precision with Round-to-Odd. + * + * The PVECLIB implementation of + * Add Quad-Precision with Round-to-Odd + * will use the POWER9 xsaddqpo instruction if the compile target + * supports it. Otherwise provide a POWER8 VSX implementation using + * operations from vec_int128_ppc.h and vec_int64_ppc. + * For example: + * \code +__binary128 +test_addqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#else + // Soft-float implementation +#endif + return result; +} + * \endcode + * We prefer the compiler built-in (if available) but can substitute + * in-line assembler if needed. + * The built-in is subject to additional compiler optimizations + * (like instruction scheduling) while in-line assembler is not. + * + * The PVECLIB soft-float implementation can leverage the 128-bit + * vector registers and operations supported by POWER8. + * The implementation starts with the usual sign-bit, exponent and + * significand extraction and ends with merging the computed sign-bit + * with the significand and inserting the computed exponent. + * For example: + * \code + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + // Vectorize the DW biased exponents + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { // Both operands are finite (normal, denormal, or zero) + } + else + { // One or both operands are NaN or Infinity + } + + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); + * \endcode + * + * Floating-point addition requires that operands are represented with + * the same exponent before the add operation. This means shifting + * the significand of the smaller magnitude right by the absolute + * difference between the exponents. To reduce the effect of round-off + * error this shift must preserve any low order bits (shifted away) + * as the Guard, Round and Sticky bits for internal + * Intermediate Results (IR). + * For addition the IR only needs 117-bits which can be + * accommodated in a single 128-vector. + * Significands (which includes the leading/implicit bit) can be + * converted to IR form by shifting left 3-bits. + * This still leaves room on the left for the carry-bit. + * For example: + * \code + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + * \endcode + * (See: \ref f128_softfloat_IRRN_0_1) + * \note The sign bits are maintained as separate local variables + * (a_sign, b_sign, q_sign) for the power8 VSX software implementation. + * + * Floating-point addition will add or subtract magnitudes depending + * the signs of the operands. + * If the signs are the same, simply add (unsigned quadword) the two + * (IR format) operands. + * Otherwise if the signs differ, simply subtract (unsigned quadword) + * the smaller magnitude from the larger. + * In this case the sign of the result is the sign of the larger + * magnitude. + * + * This discussion implies that knowing the relative absolute magnitude + * up front can simplify the implementation. + * As we saw in \ref f128_softfloat_0_0_1 we can use quadword integer + * compares if we know that QP values are finite. + * By masking off sign-bit from the operands we can use + * unsigned quadword compare to determine relative magnitude. + * For example: + * \code + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + * \endcode + * We can also generate a sign difference mask we can use later. + * For example: + * \code + vui32_t diff_sign; + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + q_sign = vec_xor (a_sign, b_sign); + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + * \endcode + * Again a denormal is encoded as a biased exponent + * of 0x0000 and a nonzero (112-bit) fraction. + * But the architecture defines a denormal as + * 2Emin x (0.fraction). For Quad-Precision, + * Emin is defined as -16382 which is a biased exponent of 0x0001. + * We need to use Emin in the IR to to compute shift values. + * This requires a small fix-up before computing the IR. + * It is simpler at this point to apply Emin to both denormal and + * QP 0.0 values. + * \code + // Vectorize the DW biased exponents + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + //... + // Correct exponent for zeros or denormals to E_min + { + vb64_t exp_mask; + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel (x_exp, (vui64_t) exp_min, exp_mask); + } + * \endcode + * We vectorize this fixup by merging a_exp/b_exp into a + * vector doubleword x_exp and applying compare/select. + * + * Before diving into the add operation we simplify the code that + * follows by swapping the internal representation of vfa/vfb if + * if absolute magnitude of vfa is less than vfb. + * \code + // Now swap operands a/b if necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + * \endcode + * + * At this point we can assume that: + * - Exponents (a_exp, b_exp) are in the range E_min -> E_max + * - And a_exp >= b_exp + * - If a_exp == b_exp then a_sig >= b_sig + * - If a_exp > b_exp then + * - shift (b_sig) right by (a_exp - b_exp) + * - any bits shifted out of b_sig are ORed into the X-bit + * - The result exponent is usually a_exp +/-1 + * + * \code + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + // d_exp = a_exp - b_exp + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { // if (d_exp < 128) then shift b_sig right + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + // retain bits shifted way for X-bits + l_exp = vec_subudm (exp_128, d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { // else all significant bits shifted away + t_sig = (vui128_t) q_zero; + // retain original b_sig for X-bits + x_bits = b_sig; + } + // reduce and X-bits for X-bit in IR + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + // merge shifted b_sig with accumlated X-bit + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + * \endcode + * Now we are ready to compute the significand. For example: + * \code + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + * \endcode + * Now handle the special case of a zero (0.0) result. + * Either added two zero operands or a subtraction + * (equal operands with different signs) produced an exact zero result. + * Exact zero results always have an positive sign, + * otherwise return return the result with same sign as vfa. + * For example: + * \code + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero with different sign + q_sign = vec_sel (a_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + * \endcode + * Next check for overflow/carry. + * In this case we need to shift the significand right one bit and + * increment the exponent by one. + * Also insure that and X-bit is not lost (shifted away) before we + * get to the rounding stage. + * For example: + * \code + // Check for carry and adjust + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + * \endcode + * Otherwise check for underflow (C- and L-bits are 0b0) which + * requires normalization and may result in a denormal value. + * Use count leading zeros to estimate the required normalizing + * left shift. + * The IR internal representation with normally have 12 + * leading zeros and so we need to adjust for that. + * Also we need to prevent shifting beyond denormal range + * (q_exp <= E_min), so use the minimum of leading zero count and + * the delta between the current (q_exp) exponent and E_min. + * For example: + * \code + // Or the significand is below normal range. + // This can happen with subtraction (different signs). + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + const vui64_t exp_12 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_12); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + // ... + } + * \endcode + * + * If the current exponent is greater then E_min then we can + * safely use the minimum shift count to: + * - Normalize the significand by left shift and adjust the exponent. + * - If the adjusted exponent is <= E_min then return denormal by + * setting the biased exponent to zero (q_zero). + * + * For example: + * \code + // ... + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + if (vec_cmpud_all_le (q_exp, c_exp)) + { + // Exponent is less than the required normalization + // so return denormal result + q_exp = q_zero; + } + else + q_exp = vec_subudm (q_exp, d_exp); + } + else + { + // Exponent is less than or equal to E_min + // so return denormal result + q_exp = q_zero; + } + * \endcode + * This can be simplified using boolean select logic. + * Here we replace vec_cmpud_all_le() with vec_cmpgtud() and vec_sel() + * which generates smaller faster code. + * For example: + * \code + // ... + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + vb64_t exp_mask = vec_cmpgtud (q_exp, c_exp); + + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + q_exp = vec_subudm (q_exp, d_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + } + else // ... + * \endcode + * After normalization we are ready to round the IR, + * where round-to-odd is the simplest case. + * For example: + * \code + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + * \endcode + * After rounding we need one more check for overflow. + * For round-to-odd we will not see an significand overflow + * (none-zero C-bit) but we may have overflowed the exponent range. + * + * For normal rounding modes, exponent overflow would generate an + * infinity. However round-to-odd is a special case that returns + * the maximum finite value __FLT128_MAX__. + * For example: + * \code + // Check for exponent overflow -> __FLT128_MAX__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // return maximum finite exponent and significand + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + * \endcode + * This ends the overall path for finite operands. + * the last step will merge the sign bit with the significand then + * insert the exponent. + * For example: + * \code + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); + * \endcode + * + * If either operand is a NaN or infinity special handling is required. + * See PowerISA 3.0B Table 53 Actions for xsaddqp[o]. + * + * The PowerISA specifies that the xsaddqpo operation + * returns a quiet NaN if either operand is a NaN: + * - src1 is a NaN, convert src1 to a quiet NaN + * and return that value. + * - src1 is not a NaN, convert src2 to a quiet NaN + * and return that value. + * + * For example: + * \code + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // + * \endcode + * The sign. significand, and exponent are combined into a + * __float128 quiet NaN and returned. + * + * Otherwise one or both operands are infinity. + * Addition of an infinity and a finite or two infinities + * (of the same sign) returns infinity. + * But subtraction of infinities (additional of different signs) + * returns a default quiet NaN. For example: + * \code + * // else one or both operands are Infinity + { + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_any_ne ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and opposite sign + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vfb; + } + } + } + * \endcode + * + * + * \subsubsection f128_softfloat_0_0_3_3 Subtract Quad-Precision with Round-to-Odd. + * + * The PVECLIB implementation of + * Subtract Quad-Precision with Round-to-Odd + * will use the POWER9 xssubqpo instruction if the compile target + * supports it. Otherwise provide a POWER8 VSX implementation + * based on the PVECLIB Add Quad-Precision implementation. + * This is based on the observation that; + * - floating-point addition becomes subtraction if the signs differ, + * and + * - negation of the second operand allows use of the existing add + * operation to perform subtraction. + * + * For example: + * \code + __binary128 +test_vec_subqpo_V0 (__binary128 src1, __binary128 src2) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_subf128_round_to_odd (src1, src2); +#else + // No extra data moves here. + __asm__( + "xssubqpo %0,%1,%2" + : "=v" (result) + : "v" (src1), "v" (src2) + : ); +#endif +#else // defined (_ARCH_PWR8) + __binary128 nsrc2 = vec_negf128 (src2); + return vec_xsaddqpo (src1, nsrc2); +} + * \endcode + * Unfortunately it is not that simple. The PowerISA specifies that + * the xssubqpo operation must return the original src2 operand + * as a quiet NaN if: + * - src2 is a NaN, and + * - src1 is not a NaN. + * + * See PowerISA 3.0B Table 95 Actions for xssubqp[o]. + * + * To insure compatible results for POWER8 and POWER9 implementations + * we need to avoid negation if src2 is a NaN. + * For example: + * \code + __binary128 +test_vec_subqpo_V1 (__binary128 src1, __binary128 src2) +{ +// ... +#else // defined (_ARCH_PWR8) + __binary128 nsrc2; + + nsrc2 = vec_self128 (vec_negf128 (src2), src2, vec_isnanf128(src2)); + return vec_xsaddqpo (src1, nsrc2); +} + * \endcode + * This requires a relatively expensive (~14 cycle) vec_isnanf128() + * test and adds ~12 instructions to the vec_xssubqpo() operation. + * But this does product correct results for all operand combinations. + * + * \note This assumes that + * vec_xsaddqpo() is fully inlined into vec_xssubqpo(). + * + * To get POWER8 an implementation of + * Subtract Quad-Precision with Round-to-Odd + * with better performance we need to inject + * the src2 sign negation strategically into a copy of the + * Add Quad-Precision implementation. + * This should be after; + * - extracting the sign, exponent and significand + * from the Quad-Precision source operands, and + * - testing for finite, NaN, and infinity + * + * Once we know that neither operand is NaN we can simply flip the + * sign bit for source operand 2. + * For example once we know that both operands are finite: + * \code + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + // Negate sign for subtract, then use add logic + b_sign = vec_xor (signmask, b_sign); + // ... + * \endcode + * The other case is the else leg of the finite case where at + * least one of the operands is NaN or infinity. + * For example once we know the none of the operands are NaN: + * \code + // ... NaNs + else // Or one or both operands are Infinity + { + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_all_eq ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and same sign + // Inifinty - Infinity (same sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and different sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return src1; + } + else + { + // return -src2 (infinity) + return vec_negf128(src2); + } + } + } * \endcode - * + * The changes for vec_xssubqpo() from vec_xsaddqpo() are: + * - When both operands are infinity and the same sign, then + * return the default quiet NaN. + * For vec_xsaddqpo() this tests for signs not equal via + * vec_cmpud_any_ne(). + * - Otherwise if src1 is finite and src2 is infinity then + * return negative src2. * * \section f128_examples_0_0 Examples * For example: using the the classification functions for implementing @@ -2188,11 +2915,16 @@ test_cosf128 (__binary128 value) So far clang does not support/define the __ibm128 type. */ #ifdef __FLOAT128__ typedef __float128 __Float128; +#ifndef __clang__ typedef __float128 __binary128; typedef __float128 __ieee128; -#ifndef __clang__ typedef __ibm128 __IBM128; #else +/* Clang started defining __FLOAT128__ and does not allow redefining + __float128 or __ieee128. Worse it will give errors if you try to + use either type. So define __binary128 as if __FLOAT128__ is not + defined. */ +typedef vui128_t __binary128; /* Clang does not define __ibm128 over IBM long double. So defined it here. */ typedef long double __IBM128; @@ -6027,12 +6759,18 @@ static inline __binary128 vec_negf128 (__binary128 f128) { __binary128 result; -#if _ARCH_PWR9 +#if defined (_ARCH_PWR9) && (__GNUC__ > 6) +#if defined (__FLOAT128__) && (__GNUC__ > 7) + // Let the compilers generate and optimize code. + result = -f128; +#else + // If the compiler supports _ARCH_PWR9, must support mnemonics. __asm__( - "xsneqqp %0,%1;\n" + "xsnegqp %0,%1" : "=v" (result) : "v" (f128) - :); + : ); +#endif #else vui32_t tmp; const vui32_t signmask = CONST_VINT128_W (0x80000000, 0, 0, 0); @@ -6141,6 +6879,521 @@ vec_signbitf128 (__binary128 f128) #endif } +/** \brief VSX Scalar Add Quad-Precision using round to Odd. + * + * The quad-precision element of vectors vfa and vfb are added + * to produce the quad-precision result. + * The rounding mode is round to odd. + * + * For POWER9 use the xsaddqpo instruction. + * For POWER8 use this soft-float implementation using + * vector instruction generated by PVECLIB operations. + * For POWER7 and earlier us the compilers soft-float implementation. + * + * \note This operation may not follow the PowerISA + * relative to setting the FPSCR. + * However if the hardware target includes the xsmulqpo instruction, + * the implementation may use that. + * + * |processor|Latency|Throughput| + * |--------:|:-----:|:---------| + * |power8 | 54-71 | 1/cycle | + * |power9 | 12 |1/12 cycle| + * + * @param vfa 128-bit vector treated as a scalar __binary128. + * @param vfb 128-bit vector treated as a scalar __binary128. + * @return a vector unsigned __int128 value. + */ +static inline __binary128 +vec_xsaddqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + vui128_t add_sig, sub_sig; + vb64_t exp_mask; + vui32_t diff_sign; + + q_sign = vec_xor (a_sign, b_sign); + + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + // Correct exponent for zeros or denormals to E_min + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); + + // Now swap a/b is necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero's with different sign + // and exact-zero-difference result. + q_sign = vec_sel (a_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + const vui64_t q_one = { 1, 1 }; + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + vb64_t exp_mask = vec_cmpgtud (q_exp, c_exp); + + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + q_exp = vec_subudm (q_exp, d_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + } + else + { // Exponent is less than or equal to E_min + // so return denormal result. + q_exp = q_zero; + } + } + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_MAX__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // return maximum finite exponent and significand + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN, return a QNaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN, return a QNaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_any_ne ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and opposite sign + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vfb; + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa + vfb; +#endif + return result; +} + +/** \brief VSX Scalar Subtract Quad-Precision using round to Odd. + * + * The quad-precision element of vector vfb is subtracted from vfa + * to produce the quad-precision result. + * The rounding mode is round to odd. + * + * For POWER9 use the xssubqpo instruction. + * For POWER8 use this soft-float implementation using + * vector instruction generated by PVECLIB operations. + * For POWER7 and earlier us the compilers soft-float implementation. + * + * \note This operation may not follow the PowerISA + * relative to setting the FPSCR. + * However if the hardware target includes the xsmulqpo instruction, + * the implementation may use that. + * + * |processor|Latency|Throughput| + * |--------:|:-----:|:---------| + * |power8 | 51-70 | 1/cycle | + * |power9 | 12 |1/12 cycle| + * + * @param vfa 128-bit vector treated as a scalar __binary128. + * @param vfb 128-bit vector treated as a scalar __binary128. + * @return a vector unsigned __int128 value. + */ +static inline __binary128 +vec_xssubqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_subf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xssubqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#else // defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vb64_t exp_mask; + vui32_t diff_sign; + + // Negate sign for subtract, then use add logic + b_sign = vec_xor (signmask, b_sign); + q_sign = vec_xor (a_sign, b_sign); + + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); + + // Now swap operands a/b if necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero with different sign + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + vb64_t exp_mask = vec_cmpgtud (q_exp, c_exp); + + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + q_exp = vec_subudm (q_exp, d_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + } + else + { // Exponent is less than or equal to E_min + // so return denormal result. + q_exp = q_zero; + } + } + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_INF__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // Intermediate result is huge, unbiased exponent > 16383 + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN, return a QNaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN, return a QNaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_all_eq ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and same sign + // Inifinty - Infinity (same sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and different sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return -vfb (infinity) + return vec_negf128(vfb); + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#endif + return result; +} + /** \brief VSX Scalar Convert Double-Precision to Quad-Precision format. * * The left most double-precision element of vector f64 is converted @@ -6964,7 +8217,7 @@ static inline vec_xscvuqqp (vui128_t int128) * * |processor|Latency|Throughput| * |--------:|:-----:|:---------| - * |power8 | ~75 | 1/cycle | + * |power8 | 70-85 | 1/cycle | * |power9 | 24 |1/12 cycle| * * @param vfa 128-bit vector treated as a scalar __binary128. diff --git a/src/testsuite/arith128_test_f128.c b/src/testsuite/arith128_test_f128.c index a92c5bb..2638c26 100644 --- a/src/testsuite/arith128_test_f128.c +++ b/src/testsuite/arith128_test_f128.c @@ -1173,73 +1173,1214 @@ db_vec_xsmulqpn (__binary128 vfa, __binary128 vfb) #endif return result; } + +__binary128 +db_vec_xsaddqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); #endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); -const vui32_t signmask32 = {0x80000000, 0, 0, 0}; -const vui64_t signmask64 = {0x8000000000000000, 0}; + print_vfloat128x("db_vec_xsaddqpo vfa= ", vfa); + print_vfloat128x(" vfb= ", vfb); -const vui64_t vf128_zero = CONST_VINT64_DW(0x0000000000000000, 0); -const vui64_t vf128_nzero = CONST_VINT64_DW(0x8000000000000000, 0); +#if 0 + a_exp = (vui64_t) vec_sld ((vui32_t) q_zero, (vui32_t) a_mag, 2); + a_exp = vec_splatd (a_exp, VEC_DW_L); +#else + a_exp = vec_xsxexpqp (vfa); +#endif + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + print_vint128x (" sign(vfa):", (vui128_t) a_sign); + print_vint128x (" exp (vfa):", (vui128_t) a_exp); + print_vint128x (" sig (vfa):", (vui128_t) a_sig); +#if 0 + b_exp = (vui64_t) vec_sld ((vui32_t) q_zero, (vui32_t) b_mag, 2); + b_exp = vec_splatd (b_exp, VEC_DW_L); +#else + b_exp = vec_xsxexpqp (vfb); +#endif + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + print_vint128x (" sign(vfb):", (vui128_t) b_sign); + print_vint128x (" exp (vfb):", (vui128_t) b_exp); + print_vint128x (" sig (vfb):", (vui128_t) b_sig); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); -const vui64_t vf128_one = CONST_VINT64_DW(0x3fff000000000000, 0); -const vui64_t vf128_none = CONST_VINT64_DW(0xbfff000000000000, 0); +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vui32_t diff_sign; -const vui64_t vf128_two = CONST_VINT64_DW(0x4000000000000000, 0); -const vui64_t vf128_ntwo = CONST_VINT64_DW(0xc000000000000000, 0); + q_sign = vec_xor (a_sign, b_sign); +#if 1 + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); +#else + diff_sign = (vui32_t) vec_cmpneuq ((vui128_t) a_sign, (vui128_t) b_sign); +#endif -const vui64_t vf128_max = CONST_VINT64_DW(0x7ffeffffffffffff, 0xffffffffffffffff); -const vui64_t vf128_nmax = CONST_VINT64_DW(0xfffeffffffffffff, 0xffffffffffffffff); + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); -const vui64_t vf128_min = CONST_VINT64_DW(0x0001000000000000, 0x0000000000000000); -const vui64_t vf128_nmin = CONST_VINT64_DW(0x8001000000000000, 0x0000000000000000); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + print_vint128x (" sig (a ):", (vui128_t) a_sig); + print_vint128x (" sig (b ):", (vui128_t) b_sig); -const vui64_t vf128_sub = CONST_VINT64_DW(0x0000ffffffffffff, 0xffffffffffffffff); -const vui64_t vf128_nsub = CONST_VINT64_DW(0x8000ffffffffffff, 0xffffffffffffffff); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); -const vui64_t vf128_inf = CONST_VINT64_DW(0x7fff000000000000, 0); -const vui64_t vf128_ninf = CONST_VINT64_DW(0xffff000000000000, 0); +// if (vec_cmpud_any_eq (x_exp, exp_dnrm)) + { // Involves zeros or denormals + print_vint128x (" exps(x_exp):", (vui128_t) x_exp); +#if 0 + // check for zero significands in add + if (vec_cmpuq_all_eq (a_sig, (vui128_t) q_zero)) + { + if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + print_vint128x (" zero+zero):", (vui128_t) a_sign); + print_vint128x (" ):", (vui128_t) b_sign); + + // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else + { + // Add to zero, return vfb + print_vint128x (" zero (+ b):", (vui128_t) b_sig); + return vfb; + } + } + else if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + print_vint128x (" zero (+ a):", (vui128_t) a_sig); + return vfa; + } + else +#endif + { + vb64_t exp_mask; + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel (x_exp, (vui64_t) exp_min, exp_mask); + print_vint128x (" adj (x_exp):", (vui128_t) x_exp); + } + } -const vui64_t vf128_nan = CONST_VINT64_DW(0x7fff800000000000, 0); -const vui64_t vf128_nnan = CONST_VINT64_DW(0xffff800000000000, 0); + // Now swap a/b is necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + print_vint128x (" sign(q ):", (vui128_t) q_sign); + print_vint128x (" exp (q ):", (vui128_t) q_exp); + print_vint128x (" exps(a ):", (vui128_t) a_exp); + print_vint128x (" exps(b ):", (vui128_t) b_exp); + print_vint128x (" sigs(a ):", (vui128_t) a_sig); + print_vint128x (" sigs(b ):", (vui128_t) b_sig); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp-b_exp) + + x_bits = (vui128_t) q_zero; + // If (b_exp < a_exp) then + // Shift right b_sig by (a_exp - b_exp) + // Collect any shift out of b_sig and or them into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); -const vui64_t vf128_snan = CONST_VINT64_DW(0x7fff400000000000, 0); -const vui64_t vf128_nsnan = CONST_VINT64_DW(0xffff000080000000, 0); + d_exp = vec_subudm (a_exp, b_exp); + print_vint128x (" delta (a_exp):", (vui128_t) d_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + print_vint128x (" srq (b_sig):", (vui128_t) t_sig); + print_vint128x (" slq (x_sig):", (vui128_t) x_bits); + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + print_vint128x (" sig (p_odd):", (vui128_t) p_odd); + print_vint128x (" sig (b_sig):", (vui128_t) b_sig); + // b_sig = t_sig; + } -const vui32_t vf128_true = CONST_VINT32_W(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); -const vui32_t vf128_false = CONST_VINT32_W(0, 0, 0, 0); + // Add/subtract significands + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + print_vint128x (" sig (s ):", (vui128_t) s_sig); -// Use this to hide locally defined constants from Clang (etc). -// Thius will prevent incorrect optimization for Clang9/10 -static inline __binary128 -const_xfer_vui64t_2_bin128 (vui64_t f128) -{ -#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) && (__clang_major__ > 6) - __binary128 result; - #ifdef __VSX__ - __asm__( - "xxlor %x0,%x1,%x1" - : "=wa" (result) - : "wa" (f128) - : ); - #else - __asm__( - "vor %0,%1,%1" - : "=v" (result) - : "v" (f128) - : ); - #endif + print_vint128x (" sum (sig):", (vui128_t) s_sig); + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Return Exact-zero-difference result. + print_vint128x (" zero (q_sign):", (vui128_t) q_sign); +#if 1 +#if 1 +#if 1 + // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); +#else + if (vec_cmpuq_all_eq (a_sig, (vui128_t) q_zero) + && vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + print_vint128x (" zero+zero):", (vui128_t) a_sign); + print_vint128x (" ):", (vui128_t) b_sign); + + // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else + { + return vec_xfer_vui64t_2_bin128 (q_zero); + } +#endif +#else + // check for zero significands in add + if (vec_cmpuq_all_eq (a_sig, (vui128_t) q_zero)) + { + if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + print_vint128x (" zero+zero):", (vui128_t) a_sign); + print_vint128x (" ):", (vui128_t) b_sign); + + // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else + { + // Add to zero, return vfb + print_vint128x (" zero (+ b):", (vui128_t) b_sig); + return vfb; + } + } + else if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + print_vint128x (" zero (+ a):", (vui128_t) a_sig); + return vfa; + } + else + return vec_xfer_vui64t_2_bin128 (q_zero); +#endif +#else + return vec_xfer_vui64t_2_bin128 (q_zero); +#endif + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + print_vint128x (" OV (s_sig):", (vui128_t) s_sig); + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + //x_bits = (vui128_t) vec_or ((vui32_t) x_bits, (vui32_t) p_odd); + print_vint128x (" sig (s_xb ):", (vui128_t) s_sig); + q_exp = vec_addudm (q_exp, q_one); + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + print_vint128x (" UFt (s_sig):", (vui128_t) s_sig); + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + print_vint128x (" clz (s_sig):", (vui128_t) c_exp); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + print_vint128x (" exp (exp-1):", (vui128_t) d_exp); + d_exp = vec_minud (c_exp, d_exp); + print_vint128x (" exp (min-d):", (vui128_t) d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { +#if 1 + vb64_t exp_mask; + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + print_vint128x (" sig (s_h):", (vui128_t) s_sig); + exp_mask = vec_cmpgtud (q_exp, c_exp); + print_vint128x (" exp (Emsk)):", (vui128_t) exp_mask); + q_exp = vec_subudm (q_exp, d_exp); + print_vint128x (" exp (q-d )):", (vui128_t) q_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + print_vint128x (" exp (Emin)):", (vui128_t) q_exp); +#else + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + print_vint128x (" sig (s_h):", (vui128_t) s_sig); + if (vec_cmpud_all_le (q_exp, c_exp)) + { + // Intermediate result == tiny, unbiased exponent == -16382 + // Check if sig is denormal range (L-bit is 0). + q_exp = q_zero; + print_vint128x (" exp (q<=c):", (vui128_t) q_exp); + } + else + q_exp = vec_subudm (q_exp, d_exp); +#endif + + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + else + { + // Intermediate result == tiny, unbiased exponent == -16382 + // sig is denormal range (L-bit is 0). + print_vint128x (" UFt (s_sig):", (vui128_t) s_sig); + q_exp = q_zero; + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + } +#if 0 + // Accumulate x_bits + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); +#endif + // Round to odd from lower product bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_INF__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // Intermediate result is huge, unbiased exponent > 16383 + print_vint128x (" OV (q_exp):", (vui128_t) q_exp); + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // One or both operands are infinity + { +// a_exp = vec_splatd (a_exp, VEC_DW_H); +// b_exp = vec_splatd (b_exp, VEC_DW_H); + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_any_ne ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands are infinity and opposite sign + print_vint128x (" Inf diff sign:", (vui128_t) b_sign); + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + print_vint128x (" Inf (vra):", (vui128_t) a_sign); + // return infinity + return vfa; + } + else + { + print_vint128x (" Inf (vrb):", (vui128_t) b_sign); + // return infinity + return vfb; + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa + vfb; +#endif return result; +} + +__binary128 +db_vec_xssubqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_subf128_round_to_odd (vfa, vfb); #else - __VF_128 vunion; + // No extra data moves here. + __asm__( + "xssubqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#else // defined (_ARCH_PWR8) +#if 1 + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + print_vfloat128x("db_vec_xssubqpo vfa= ", vfa); + print_vfloat128x(" vfb= ", vfb); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + print_vint128x (" sign(vfa):", (vui128_t) a_sign); + print_vint128x (" exp (vfa):", (vui128_t) a_exp); + print_vint128x (" sig (vfa):", (vui128_t) a_sig); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + print_vint128x (" sign(vfb):", (vui128_t) b_sign); + print_vint128x (" exp (vfb):", (vui128_t) b_exp); + print_vint128x (" sig (vfb):", (vui128_t) b_sig); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vui32_t diff_sign; + // Negate sign for subtract, then use add logic + b_sign = vec_xor (signmask, b_sign); + q_sign = vec_xor (a_sign, b_sign); + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + print_vint128x (" sign(b ):", (vui128_t) b_sign); + print_vint128x (" sign(msk):", (vui128_t) diff_sign); + + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + print_vint128x (" sig (a ):", (vui128_t) a_sig); + print_vint128x (" sig (b ):", (vui128_t) b_sig); + + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + +// if (vec_cmpud_any_eq (x_exp, exp_dnrm)) + { // Involves zeros or denormals + print_vint128x (" exps(x_exp):", (vui128_t) x_exp); + { + vb64_t exp_mask; + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel (x_exp, (vui64_t) exp_min, exp_mask); + print_vint128x (" adj (x_exp):", (vui128_t) x_exp); + } + } + + // Now swap a/b is necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + print_vint128x (" sign(q ):", (vui128_t) q_sign); + print_vint128x (" exp (q ):", (vui128_t) q_exp); + print_vint128x (" exps(a ):", (vui128_t) a_exp); + print_vint128x (" exps(b ):", (vui128_t) b_exp); + print_vint128x (" sigs(a ):", (vui128_t) a_sig); + print_vint128x (" sigs(b ):", (vui128_t) b_sig); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp-b_exp) + + x_bits = (vui128_t) q_zero; + // If (b_exp < a_exp) then + // Shift right b_sig by (a_exp - b_exp) + // Collect any shift out of b_sig and or them into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + print_vint128x (" delta (a_exp):", (vui128_t) d_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + print_vint128x (" srq (b_sig):", (vui128_t) t_sig); + print_vint128x (" slq (x_sig):", (vui128_t) x_bits); + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + print_vint128x (" sig (p_odd):", (vui128_t) p_odd); + print_vint128x (" sig (b_sig):", (vui128_t) b_sig); + // b_sig = t_sig; + } + + // Add/subtract significands + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + print_vint128x (" sig (s ):", (vui128_t) s_sig); + + print_vint128x (" sum (sig):", (vui128_t) s_sig); + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Return Exact-zero-difference result. + print_vint128x (" zero (q_sign):", (vui128_t) q_sign); +#if 1 +#if 1 +#if 1 + // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); +#else +#endif +#else +#endif +#else +#endif + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + print_vint128x (" OV (s_sig):", (vui128_t) s_sig); + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + //x_bits = (vui128_t) vec_or ((vui32_t) x_bits, (vui32_t) p_odd); + print_vint128x (" sig (s_xb ):", (vui128_t) s_sig); + q_exp = vec_addudm (q_exp, q_one); + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + print_vint128x (" UFt (s_sig):", (vui128_t) s_sig); + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + print_vint128x (" clz (s_sig):", (vui128_t) c_exp); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + print_vint128x (" exp (exp-1):", (vui128_t) d_exp); + d_exp = vec_minud (c_exp, d_exp); + print_vint128x (" exp (min-d):", (vui128_t) d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + print_vint128x (" sig (s_h):", (vui128_t) s_sig); + if (vec_cmpud_all_le (q_exp, c_exp)) + { + // Intermediate result == tiny, unbiased exponent == -16382 + // Check if sig is denormal range (L-bit is 0). + q_exp = q_zero; + print_vint128x (" exp (q<=c):", (vui128_t) q_exp); + } + else + q_exp = vec_subudm (q_exp, d_exp); + + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + else + { + // Intermediate result == tiny, unbiased exponent == -16382 + // sig is denormal range (L-bit is 0). + print_vint128x (" UFt (s_sig):", (vui128_t) s_sig); + q_exp = q_zero; + print_vint128x (" adj (q_exp):", (vui128_t) q_exp); + } + } +#if 0 +#endif + // Round to odd from lower product bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_INF__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // Intermediate result is huge, unbiased exponent > 16383 + print_vint128x (" OV (q_exp):", (vui128_t) q_exp); + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // One or both operands are infinity + { +// a_exp = vec_splatd (a_exp, VEC_DW_H); +// b_exp = vec_splatd (b_exp, VEC_DW_H); + +// b_sign = vec_xor (signmask, b_sign); + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_all_eq ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands are infinity and opposite sign + print_vint128x (" Inf diff sign:", (vui128_t) b_sign); + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + print_vint128x (" Inf (vra):", (vui128_t) a_sign); + // return infinity + return vfa; + } + else + { + print_vint128x (" Inf (vrb):", (vui128_t) b_sign); + // return infinity + return vec_negf128(vfb); + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else + __binary128 nvfb; + nvfb = vec_self128 (vec_negf128 (vfb), vfb, vec_isnanf128(vfb)); + result = db_vec_xsaddqpo (vfa, nvfb); +#endif +#endif + return result; +} +#endif + +const vui32_t signmask32 = {0x80000000, 0, 0, 0}; +const vui64_t signmask64 = {0x8000000000000000, 0}; + +const vui64_t vf128_zero = CONST_VINT64_DW(0x0000000000000000, 0); +const vui64_t vf128_nzero = CONST_VINT64_DW(0x8000000000000000, 0); + +const vui64_t vf128_one = CONST_VINT64_DW(0x3fff000000000000, 0); +const vui64_t vf128_none = CONST_VINT64_DW(0xbfff000000000000, 0); + +const vui64_t vf128_two = CONST_VINT64_DW(0x4000000000000000, 0); +const vui64_t vf128_ntwo = CONST_VINT64_DW(0xc000000000000000, 0); + +const vui64_t vf128_max = CONST_VINT64_DW(0x7ffeffffffffffff, 0xffffffffffffffff); +const vui64_t vf128_nmax = CONST_VINT64_DW(0xfffeffffffffffff, 0xffffffffffffffff); + +const vui64_t vf128_min = CONST_VINT64_DW(0x0001000000000000, 0x0000000000000000); +const vui64_t vf128_nmin = CONST_VINT64_DW(0x8001000000000000, 0x0000000000000000); + +const vui64_t vf128_sub = CONST_VINT64_DW(0x0000ffffffffffff, 0xffffffffffffffff); +const vui64_t vf128_nsub = CONST_VINT64_DW(0x8000ffffffffffff, 0xffffffffffffffff); + +const vui64_t vf128_inf = CONST_VINT64_DW(0x7fff000000000000, 0); +const vui64_t vf128_ninf = CONST_VINT64_DW(0xffff000000000000, 0); + +const vui64_t vf128_nan = CONST_VINT64_DW(0x7fff800000000000, 0); +const vui64_t vf128_nnan = CONST_VINT64_DW(0xffff800000000000, 0); + +const vui64_t vf128_snan = CONST_VINT64_DW(0x7fff400000000000, 0); +const vui64_t vf128_nsnan = CONST_VINT64_DW(0xffff000080000000, 0); + +const vui32_t vf128_true = CONST_VINT32_W(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff); +const vui32_t vf128_false = CONST_VINT32_W(0, 0, 0, 0); + +// Use this to hide locally defined constants from Clang (etc). +// Thius will prevent incorrect optimization for Clang9/10 +static inline __binary128 +const_xfer_vui64t_2_bin128 (vui64_t f128) +{ +#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) && (__clang_major__ > 6) + __binary128 result; + #ifdef __VSX__ + __asm__( + "xxlor %x0,%x1,%x1" + : "=wa" (result) + : "wa" (f128) + : ); + #else + __asm__( + "vor %0,%1,%1" + : "=v" (result) + : "v" (f128) + : ); + #endif + return result; +#else + __VF_128 vunion; + + vunion.vx2 = f128; + + return (vunion.vf1); +#endif +} + +int +test_isinf_signf128 (void) +{ + const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0)); + const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0)); + + const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x3fff000000000000, 0)); + const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xbfff000000000000, 0)); + + const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); + const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); + + const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff000000000000, 0)); + const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000000000000, 0)); + + const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff800000000000, 0)); + const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff800000000000, 0)); + + const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff400000000000, 0)); + const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000080000000, 0)); + + __binary128 x; + long tests_count = 0; + int test, expt; + int rc = 0; + + printf ("\ntest_isinf_signf128 f128 -> int , ...\n"); + +#if 1 + tests_count++; + x = (__binary128) f128_zero; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nzero; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_one; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_none; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_max; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nmax; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_min; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nmin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_sub; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsub; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_inf; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 1; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_ninf; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = -1; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_snan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_isinf_signf128 (x); + expt = 0; + rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); +#endif + /* accumulate the number of values tested, in case we are doing + * detail timing and want to compute function averages. */ + tcount += tests_count; + printf ("\ntest_isinf_signf128, tests=%ld fails=%d\n", tests_count, rc); + + return (rc); +} + +int +test_setb_qp (void) +{ + const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0)); + const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0)); + + const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x3fff000000000000, 0)); + const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xbfff000000000000, 0)); + + const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); + const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); + + const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff000000000000, 0)); + const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000000000000, 0)); + + const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff800000000000, 0)); + const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff800000000000, 0)); + + const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff400000000000, 0)); + const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000080000000, 0)); + + __binary128 x; + vb128_t test, expt; + long tests_count = 0; + int rc = 0; + + printf ("\ntest_setb_qp f128 -> vector bool , ...\n"); + +#if 1 + tests_count++; + x = (__binary128) f128_zero; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nzero; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_one; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_none; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_max; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nmax; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_min; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nmin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_sub; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsub; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_inf; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_ninf; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_snan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_setb_qp (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_setb_qp", x, test, expt); +#endif - vunion.vx2 = f128; + /* accumulate the number of values tested, in case we are doing + * detail timing and want to compute function averages. */ + tcount += tests_count; + printf ("\ntest_setb_qp, tests=%ld fails=%d\n", tests_count, rc); - return (vunion.vf1); -#endif + return (rc); } int -test_isinf_signf128 (void) +test_signbitf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -1286,7 +2427,42 @@ test_isinf_signf128 (void) int test, expt; int rc = 0; - printf ("\ntest_isinf_signf128 f128 -> int , ...\n"); +#ifdef __DEBUG_PRINT__ + x = (__binary128)f128_zero; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nzero; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_one; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_none; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_max; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nmax; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_min; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nmin; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_sub; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nsub; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_inf; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_ninf; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nan; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nnan; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_snan; + print_vfloat128x(" x= ", x); + x = (__binary128)f128_nsnan; + print_vfloat128x(" x= ", x); +#endif + + printf ("\ntest_signbitf128 f128 -> int bool , ...\n"); #if 1 tests_count++; @@ -1294,9 +2470,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1304,9 +2480,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1314,9 +2490,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1324,9 +2500,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1334,9 +2510,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1344,9 +2520,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1354,9 +2530,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1364,9 +2540,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1374,9 +2550,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1384,9 +2560,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1394,9 +2570,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 1; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 0; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1404,9 +2580,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = -1; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1414,9 +2590,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1424,9 +2600,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1434,9 +2610,9 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); + test = vec_signbitf128 (x); expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif #if 1 tests_count++; @@ -1444,20 +2620,19 @@ test_isinf_signf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinf_signf128 (x); - expt = 0; - rc += check_isf128 ("check vec_isinf_signf128", x, test, expt); + test = vec_signbitf128 (x); + expt = 1; + rc += check_isf128 ("check vec_signbitf128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_isinf_signf128, tests=%ld fails=%d\n", tests_count, rc); - + printf ("\ntest_signbitf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_setb_qp (void) +test_isinff128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -1504,7 +2679,7 @@ test_setb_qp (void) long tests_count = 0; int rc = 0; - printf ("\ntest_setb_qp f128 -> vector bool , ...\n"); + printf ("\ntest_isinff128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -1512,9 +2687,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1522,9 +2697,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1532,9 +2707,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1542,9 +2717,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1552,9 +2727,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1562,9 +2737,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1572,9 +2747,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1582,9 +2757,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1592,9 +2767,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1602,9 +2777,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1612,9 +2787,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1622,9 +2797,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1632,9 +2807,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1642,9 +2817,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1652,9 +2827,9 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); + test = vec_isinff128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif #if 1 tests_count++; @@ -1662,21 +2837,20 @@ test_setb_qp (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_setb_qp (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_setb_qp", x, test, expt); + test = vec_isinff128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isinff128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_setb_qp, tests=%ld fails=%d\n", tests_count, rc); - + printf ("\ntest_isinff128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_signbitf128 (void) +test_isnanf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -1719,46 +2893,11 @@ test_signbitf128 (void) CONST_VINT128_DW(0xffff000080000000, 0)); __binary128 x; + vb128_t test, expt; long tests_count = 0; - int test, expt; int rc = 0; -#ifdef __DEBUG_PRINT__ - x = (__binary128)f128_zero; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nzero; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_one; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_none; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_max; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nmax; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_min; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nmin; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_sub; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nsub; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_inf; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_ninf; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nan; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nnan; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_snan; - print_vfloat128x(" x= ", x); - x = (__binary128)f128_nsnan; - print_vfloat128x(" x= ", x); -#endif - - printf ("\ntest_signbitf128 f128 -> int bool , ...\n"); + printf ("\ntest_isnanf128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -1766,9 +2905,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1776,9 +2915,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1786,9 +2925,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1796,9 +2935,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1806,9 +2945,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1816,9 +2955,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1826,9 +2965,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1836,9 +2975,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1846,9 +2985,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1856,9 +2995,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1866,9 +3005,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1876,9 +3015,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1886,9 +3025,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1896,9 +3035,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1906,9 +3045,9 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 0; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -1916,19 +3055,20 @@ test_signbitf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_signbitf128 (x); - expt = 1; - rc += check_isf128 ("check vec_signbitf128", x, test, expt); + test = vec_isnanf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnanf128", x, test, expt); #endif + /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_signbitf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_isnanf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_isinff128 (void) +test_isfinitef128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -1975,7 +3115,7 @@ test_isinff128 (void) long tests_count = 0; int rc = 0; - printf ("\ntest_isinff128 f128 -> vector bool ...\n"); + printf ("\ntest_isfinitef128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -1983,9 +3123,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -1993,9 +3133,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2003,9 +3143,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2013,9 +3153,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2023,9 +3163,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2033,9 +3173,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2043,9 +3183,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2053,9 +3193,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2063,9 +3203,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2073,9 +3213,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2083,9 +3223,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2093,9 +3233,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + test = vec_isfinitef128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2103,9 +3243,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); + test = vec_isfinitef128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2113,9 +3253,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); + test = vec_isfinitef128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2123,9 +3263,9 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); + test = vec_isfinitef128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif #if 1 tests_count++; @@ -2133,20 +3273,20 @@ test_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isinff128 (x); + test = vec_isfinitef128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isinff128", x, test, expt); + rc += check_f128bool ("check vec_isfinitef128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_isinff128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_isfinitef128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_isnanf128 (void) +test_isnormalf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -2193,7 +3333,7 @@ test_isnanf128 (void) long tests_count = 0; int rc = 0; - printf ("\ntest_isnanf128 f128 -> vector bool ...\n"); + printf ("\ntest_isnormalf128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -2201,9 +3341,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2211,9 +3351,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2221,9 +3361,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2231,9 +3371,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2241,9 +3381,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2251,9 +3391,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2261,9 +3401,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2271,9 +3411,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2281,9 +3421,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2291,9 +3431,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2301,9 +3441,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2311,9 +3451,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); + test = vec_isnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2321,9 +3461,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2331,9 +3471,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2341,9 +3481,9 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2351,20 +3491,20 @@ test_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnanf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnanf128", x, test, expt); + test = vec_isnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_isnormalf128", x, test, expt); #endif - /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_isnanf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_isnormalf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } +//#define __DEBUG_PRINT__ 1 int -test_isfinitef128 (void) +test_issubnormalf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -2391,6 +3531,11 @@ test_isfinitef128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_sub2 = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); + const __binary128 f128_nsub2 = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -2411,7 +3556,7 @@ test_isfinitef128 (void) long tests_count = 0; int rc = 0; - printf ("\ntest_isfinitef128 f128 -> vector bool ...\n"); + printf ("\ntest_issubnormalf128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -2419,9 +3564,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2429,9 +3574,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2439,9 +3584,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2449,9 +3594,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2459,9 +3604,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2469,9 +3614,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2479,9 +3624,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2489,9 +3634,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2499,9 +3644,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2509,9 +3654,29 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_sub2; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsub2; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_issubnormalf128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2519,9 +3684,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2529,9 +3694,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2539,9 +3704,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2549,9 +3714,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2559,9 +3724,9 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -2569,20 +3734,21 @@ test_isfinitef128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isfinitef128 (x); + test = vec_issubnormalf128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isfinitef128", x, test, expt); + rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); #endif - /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_isfinitef128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_issubnormalf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } +#undef __DEBUG_PRINT__ +//#define __DEBUG_PRINT__ 1 int -test_isnormalf128 (void) +test_iszerof128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -2609,6 +3775,11 @@ test_isnormalf128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_sub2 = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); + const __binary128 f128_nsub2 = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -2629,7 +3800,7 @@ test_isnormalf128 (void) long tests_count = 0; int rc = 0; - printf ("\ntest_isnormalf128 f128 -> vector bool ...\n"); + printf ("\ntest_iszerof128 f128 -> vector bool ...\n"); #if 1 tests_count++; @@ -2637,9 +3808,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2647,9 +3818,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_true; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2657,9 +3828,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2667,9 +3838,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2677,9 +3848,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2687,49 +3858,69 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_min; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nmin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128) f128_min; + x = (__binary128) f128_sub; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128) f128_nmin; + x = (__binary128) f128_nsub; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + test = vec_iszerof128 (x); + expt = (vb128_t) vf128_false; + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128) f128_sub; + x = (__binary128) f128_sub2; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128) f128_nsub; + x = (__binary128) f128_nsub2; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2737,9 +3928,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2747,9 +3938,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2757,9 +3948,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2767,9 +3958,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2777,9 +3968,9 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -2787,20 +3978,21 @@ test_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_isnormalf128 (x); + test = vec_iszerof128 (x); expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_isnormalf128", x, test, expt); + rc += check_f128bool ("check vec_iszerof128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_isnormalf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_iszerof128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } +#undef __DEBUG_PRINT__ //#define __DEBUG_PRINT__ 1 int -test_issubnormalf128 (void) +test_absf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -2827,11 +4019,6 @@ test_issubnormalf128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_sub2 = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); - const __binary128 f128_nsub2 = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -2845,14 +4032,15 @@ test_issubnormalf128 (void) const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff400000000000, 0)); const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000080000000, 0)); + CONST_VINT128_DW(0xffff400000000000, 0)); + __binary128 x; - vb128_t test, expt; + __binary128 t, e; long tests_count = 0; int rc = 0; - printf ("\ntest_issubnormalf128 f128 -> vector bool ...\n"); + printf ("\ntest_absf128 f128 -> f128 ...\n"); #if 1 tests_count++; @@ -2860,9 +4048,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = (__binary128) f128_zero; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2870,9 +4058,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = (__binary128) f128_zero; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2880,9 +4068,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_one; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2890,9 +4078,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_one; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2900,9 +4088,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_max; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2910,9 +4098,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_max; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2920,9 +4108,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_min; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2930,9 +4118,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_min; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2940,9 +4128,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_sub; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2950,29 +4138,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_sub2; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_nsub2; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_sub; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2980,9 +4148,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_inf; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -2990,9 +4158,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_inf; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -3000,9 +4168,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_nan; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -3010,9 +4178,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_nan; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -3020,9 +4188,9 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_snan; + rc += check_f128 ("check vec_absf128", x, t, e); #endif #if 1 tests_count++; @@ -3030,21 +4198,21 @@ test_issubnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_issubnormalf128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_issubnormalf128", x, test, expt); + t = vec_absf128 (x); + e = f128_snan; + rc += check_f128 ("check vec_absf128", x, t, e); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_issubnormalf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_absf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } #undef __DEBUG_PRINT__ //#define __DEBUG_PRINT__ 1 int -test_iszerof128 (void) +test_copysignf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -3071,11 +4239,6 @@ test_iszerof128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_sub2 = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); - const __binary128 f128_nsub2 = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -3088,25 +4251,24 @@ test_iszerof128 (void) const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff400000000000, 0)); - const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000080000000, 0)); - __binary128 x; - vb128_t test, expt; + __binary128 x, y, t, e; long tests_count = 0; int rc = 0; - printf ("\ntest_iszerof128 f128 -> vector bool ...\n"); + printf ("\ntest_copysignf128 f128 -> f128 ...\n"); #if 1 tests_count++; x = (__binary128) f128_zero; + y = (__binary128) f128_zero; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = (__binary128) f128_zero; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3114,9 +4276,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_true; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = (__binary128) f128_zero; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3124,9 +4286,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_one; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3134,9 +4296,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_one; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3144,79 +4306,59 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_nmax; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_min; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_max; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_nmin; + x = (__binary128) f128_nmax; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_max; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_sub; + x = (__binary128) f128_min; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_min; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_nsub; + x = (__binary128) f128_nmin; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_min; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_sub2; + x = (__binary128) f128_sub; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_sub; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_nsub2; + x = (__binary128) f128_nsub; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_sub; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3224,9 +4366,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_inf; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3234,9 +4376,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_inf; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3244,9 +4386,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_nan; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3254,9 +4396,9 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_nan; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3264,89 +4406,22 @@ test_iszerof128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_nsnan; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_iszerof128 (x); - expt = (vb128_t) vf128_false; - rc += check_f128bool ("check vec_iszerof128", x, test, expt); + t = vec_copysignf128 (x, y); + e = f128_snan; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif - /* accumulate the number of values tested, in case we are doing - * detail timing and want to compute function averages. */ - tcount += tests_count; - printf ("\ntest_iszerof128, tests=%ld fails=%d\n", tests_count, rc); - return (rc); -} -#undef __DEBUG_PRINT__ - -//#define __DEBUG_PRINT__ 1 -int -test_absf128 (void) -{ - const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0)); - const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0)); - - const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x3fff000000000000, 0)); - const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xbfff000000000000, 0)); - - const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); - - const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); - const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); - - const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); - - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff000000000000, 0)); - const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000000000000, 0)); - - const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff800000000000, 0)); - const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff800000000000, 0)); - - const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff400000000000, 0)); - const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff400000000000, 0)); - - - __binary128 x; - __binary128 t, e; - long tests_count = 0; - int rc = 0; - - printf ("\ntest_absf128 f128 -> f128 ...\n"); #if 1 tests_count++; x = (__binary128) f128_zero; + y = (__binary128) f128_nzero; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_absf128 (x); - e = (__binary128) f128_zero; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = (__binary128) f128_nzero; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3354,9 +4429,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = (__binary128) f128_zero; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = (__binary128) f128_nzero; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3364,9 +4439,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_one; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_none; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3374,9 +4449,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_one; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_none; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3384,9 +4459,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_max; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nmax; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3394,9 +4469,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_max; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nmax; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3404,9 +4479,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_min; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nmin; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3414,9 +4489,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_min; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nmin; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3424,9 +4499,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_sub; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nsub; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3434,9 +4509,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_sub; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nsub; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3444,9 +4519,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_inf; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_ninf; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3454,9 +4529,9 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_inf; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_ninf; + rc += check_f128 ("check vec_copysignf128", x, t, e); #endif #if 1 tests_count++; @@ -3464,51 +4539,94 @@ test_absf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_absf128 (x); - e = f128_nan; - rc += check_f128 ("check vec_absf128", x, t, e); + t = vec_copysignf128 (x, y); + e = f128_nnan; + rc += check_f128 ("check vec_copysignf128", x, t, e); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + t = vec_copysignf128 (x, y); + e = f128_nnan; + rc += check_f128 ("check vec_copysignf128", x, t, e); +#endif + /* accumulate the number of values tested, in case we are doing + * detail timing and want to compute function averages. */ + tcount += tests_count; + printf ("\ntest_copysignf128, tests=%ld fails=%d\n", tests_count, rc); + return (rc); +} +#undef __DEBUG_PRINT__ + +//#define __DEBUG_PRINT__ 1 +int +test_const_f128 (void) +{ + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff000000000000, 0)); + + const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff800000000000, 0)); + + const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff400000000000, 0)); + + __binary128 x, t, e; + long tests_count = 0; + int rc = 0; +#if 1 + tests_count++; + x = vec_const_huge_valf128 (); +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); +#endif + t = x; + e = f128_inf; + rc += check_f128 ("check __huge_valf128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_nnan; + x = vec_const_inff128 (); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x (" x= ", x); #endif - t = vec_absf128 (x); - e = f128_nan; - rc += check_f128 ("check vec_absf128", x, t, e); + t = x; + e = f128_inf; + rc += check_f128 ("check inff128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_snan; + x = vec_const_nanf128 (); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x (" x= ", x); #endif - t = vec_absf128 (x); - e = f128_snan; - rc += check_f128 ("check vec_absf128", x, t, e); + t = x; + e = f128_nan; + rc += check_f128 ("check inff128", x, t, e); #endif #if 1 tests_count++; - x = (__binary128) f128_nsnan; + x = vec_const_nansf128 (); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x (" x= ", x); #endif - t = vec_absf128 (x); + t = x; e = f128_snan; - rc += check_f128 ("check vec_absf128", x, t, e); + rc += check_f128 ("check inff128", x, t, e); #endif + /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_absf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } #undef __DEBUG_PRINT__ -//#define __DEBUG_PRINT__ 1 int -test_copysignf128 (void) +test_all_isfinitef128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -3547,177 +4665,244 @@ test_copysignf128 (void) const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff400000000000, 0)); + const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000080000000, 0)); - __binary128 x, y, t, e; + __binary128 x; long tests_count = 0; + int test, expt; int rc = 0; - printf ("\ntest_copysignf128 f128 -> f128 ...\n"); + printf ("\ntest_all_isfinitef128 f128 -> bool int , ...\n"); #if 1 tests_count++; - x = (__binary128) f128_zero; - y = (__binary128) f128_zero; + x = (__binary128)f128_zero; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = (__binary128) f128_zero; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nzero; + x = (__binary128)f128_nzero; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = (__binary128) f128_zero; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_one; + x = (__binary128)f128_one; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_one; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_none; + x = (__binary128)f128_none; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_one; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_max; + x = (__binary128)f128_max; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_max; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nmax; + x = (__binary128)f128_nmax; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_max; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_min; + x = (__binary128)f128_min; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_min; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nmin; + x = (__binary128)f128_nmin; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_min; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_sub; + x = (__binary128)f128_sub; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_sub; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nsub; + x = (__binary128)f128_nsub; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_sub; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_inf; + x = (__binary128)f128_inf; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_inf; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_ninf; + x = (__binary128)f128_ninf; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_inf; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nan; + x = (__binary128)f128_nan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nan; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_nnan; + x = (__binary128)f128_nnan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nan; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif #if 1 tests_count++; - x = (__binary128) f128_snan; + x = (__binary128)f128_snan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_snan; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; +#endif +#if 1 + tests_count++; + x = (__binary128)f128_nsnan; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_all_isfinitef128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; #endif + /* accumulate the number of values tested, in case we are doing + * detail timing and want to compute function averages. */ + tcount += tests_count; + printf ("\ntest_all_isfinitef128, tests=%ld fails=%d\n", tests_count, rc); + + return (rc); +} + +int +test_all_isnanf128 (void) +{ + const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0)); + const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0)); + + const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x3fff000000000000, 0)); + const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xbfff000000000000, 0)); + + const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); + const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); + + const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff000000000000, 0)); + const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000000000000, 0)); + + const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff800000000000, 0)); + const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff800000000000, 0)); + + const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x7fff400000000000, 0)); + const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0xffff000080000000, 0)); + + __binary128 x; + long tests_count = 0; + int test, expt; + int rc = 0; + + printf ("\ntest_all_isnanf128 f128 -> bool int , ...\n"); + #if 1 tests_count++; x = (__binary128) f128_zero; - y = (__binary128) f128_nzero; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - t = vec_copysignf128 (x, y); - e = (__binary128) f128_nzero; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3725,9 +4910,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = (__binary128) f128_nzero; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3735,9 +4920,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_none; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3745,9 +4930,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_none; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3755,9 +4940,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nmax; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3765,9 +4950,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nmax; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3775,9 +4960,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nmin; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3785,9 +4970,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nmin; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3795,9 +4980,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nsub; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3805,9 +4990,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nsub; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3815,9 +5000,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_ninf; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3825,9 +5010,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_ninf; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3835,9 +5020,9 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nnan; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; @@ -3845,84 +5030,61 @@ test_copysignf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - t = vec_copysignf128 (x, y); - e = f128_nnan; - rc += check_f128 ("check vec_copysignf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif - /* accumulate the number of values tested, in case we are doing - * detail timing and want to compute function averages. */ - tcount += tests_count; - printf ("\ntest_copysignf128, tests=%ld fails=%d\n", tests_count, rc); - return (rc); -} -#undef __DEBUG_PRINT__ - -//#define __DEBUG_PRINT__ 1 -int -test_const_f128 (void) -{ - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff000000000000, 0)); - - const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff800000000000, 0)); - - const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff400000000000, 0)); - - __binary128 x, t, e; - long tests_count = 0; - int rc = 0; #if 1 tests_count++; - x = vec_const_huge_valf128 (); + x = (__binary128) f128_snan; #ifdef __DEBUG_PRINT__ - print_vfloat128x (" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = x; - e = f128_inf; - rc += check_f128 ("check __huge_valf128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; - x = vec_const_inff128 (); + x = (__binary128) f128_nsnan; #ifdef __DEBUG_PRINT__ - print_vfloat128x (" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = x; - e = f128_inf; - rc += check_f128 ("check inff128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; x = vec_const_nanf128 (); #ifdef __DEBUG_PRINT__ - print_vfloat128x (" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = x; - e = f128_nan; - rc += check_f128 ("check inff128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif #if 1 tests_count++; x = vec_const_nansf128 (); #ifdef __DEBUG_PRINT__ - print_vfloat128x (" x= ", x); + print_vfloat128x(" x= ", x); #endif - t = x; - e = f128_snan; - rc += check_f128 ("check inff128", x, t, e); + test = vec_all_isnanf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; + printf ("\ntest_all_isnanf128, tests=%ld fails=%d\n", tests_count, rc); + return (rc); } -#undef __DEBUG_PRINT__ int -test_all_isfinitef128 (void) +test_all_isinff128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -3969,179 +5131,179 @@ test_all_isfinitef128 (void) int test, expt; int rc = 0; - printf ("\ntest_all_isfinitef128 f128 -> bool int , ...\n"); + printf ("\ntest_all_isinff128 f128 -> bool int , ...\n"); #if 1 tests_count++; - x = (__binary128)f128_zero; + x = (__binary128) f128_zero; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nzero; + x = (__binary128) f128_nzero; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_one; + x = (__binary128) f128_one; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_none; + x = (__binary128) f128_none; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_max; + x = (__binary128) f128_max; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nmax; + x = (__binary128) f128_nmax; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_min; + x = (__binary128) f128_min; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nmin; + x = (__binary128) f128_nmin; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_sub; + x = (__binary128) f128_sub; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nsub; + x = (__binary128) f128_nsub; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_inf; + x = (__binary128) f128_inf; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_ninf; + x = (__binary128) f128_ninf; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nan; + x = (__binary128) f128_nan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nnan; + x = (__binary128) f128_nnan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_snan; + x = (__binary128) f128_snan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128)f128_nsnan; + x = (__binary128) f128_nsnan; #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + print_vfloat128x(" x= ", x); #endif - test = vec_all_isfinitef128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isfinitef128", x, test, expt) ; + test = vec_all_isinff128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isinff128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_all_isfinitef128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_all_isinff128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_all_isnanf128 (void) +test_all_isnormalf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -4188,7 +5350,7 @@ test_all_isnanf128 (void) int test, expt; int rc = 0; - printf ("\ntest_all_isnanf128 f128 -> bool int , ...\n"); + printf ("\ntest_all_isnormalf128 f128 -> bool int , ...\n"); #if 1 tests_count++; @@ -4196,9 +5358,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4206,9 +5368,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4216,9 +5378,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4226,9 +5388,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4236,9 +5398,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4246,9 +5408,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4256,9 +5418,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4266,9 +5428,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4276,9 +5438,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4286,9 +5448,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4296,9 +5458,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4306,9 +5468,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); + test = vec_all_isnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4316,9 +5478,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4326,9 +5488,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4336,9 +5498,9 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4346,41 +5508,21 @@ test_all_isnanf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = vec_const_nanf128 (); -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = vec_const_nansf128 (); -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); -#endif - test = vec_all_isnanf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnanf128", x, test, expt); + test = vec_all_isnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_all_isnanf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_all_isnormalf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_all_isinff128 (void) +test_all_issubnormalf128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -4407,6 +5549,11 @@ test_all_isinff128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_submin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); + const __binary128 f128_nsubmin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -4426,8 +5573,9 @@ test_all_isinff128 (void) long tests_count = 0; int test, expt; int rc = 0; + tcount = 0; - printf ("\ntest_all_isinff128 f128 -> bool int , ...\n"); + printf ("\ntest_all_issubnormalf128 f128 -> bool int , ...\n"); #if 1 tests_count++; @@ -4435,9 +5583,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4445,9 +5593,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4455,9 +5603,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4465,9 +5613,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4475,9 +5623,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4485,9 +5633,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4495,9 +5643,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4505,9 +5653,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4515,9 +5663,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + test = vec_all_issubnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4525,19 +5673,39 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + test = vec_all_issubnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; - x = (__binary128) f128_inf; + x = (__binary128) f128_submin; #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 1; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsubmin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_all_issubnormalf128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_inf; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_all_issubnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4545,9 +5713,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + test = vec_all_issubnormalf128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4555,9 +5723,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4565,9 +5733,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4575,9 +5743,9 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif #if 1 tests_count++; @@ -4585,21 +5753,21 @@ test_all_isinff128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isinff128 (x); + test = vec_all_issubnormalf128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isinff128", x, test, expt); + rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_all_isinff128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_all_issubnormalf128, tests=%ld fails=%d\n", tests_count, rc); return (rc); } int -test_all_isnormalf128 (void) +test_all_iszerof128 (void) { const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x0000000000000000, 0)); @@ -4626,6 +5794,11 @@ test_all_isnormalf128 (void) const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + const __binary128 f128_submin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); + const __binary128 f128_nsubmin = vec_xfer_vui64t_2_bin128 ( + CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( CONST_VINT128_DW(0x7fff000000000000, 0)); const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( @@ -4646,7 +5819,7 @@ test_all_isnormalf128 (void) int test, expt; int rc = 0; - printf ("\ntest_all_isnormalf128 f128 -> bool int , ...\n"); + printf ("\ntest_all_iszerof128 f128 -> bool int , ...\n"); #if 1 tests_count++; @@ -4654,9 +5827,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4664,9 +5837,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 1; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4674,9 +5847,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4684,9 +5857,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4694,9 +5867,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4704,9 +5877,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4714,9 +5887,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4724,9 +5897,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4734,9 +5907,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4744,9 +5917,29 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_submin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); +#endif +#if 1 + tests_count++; + x = (__binary128) f128_nsubmin; +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + test = vec_all_iszerof128 (x); + expt = 0; + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4754,9 +5947,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4764,9 +5957,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4774,9 +5967,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4784,9 +5977,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4794,9 +5987,9 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif #if 1 tests_count++; @@ -4804,4508 +5997,5769 @@ test_all_isnormalf128 (void) #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_isnormalf128 (x); + test = vec_all_iszerof128 (x); expt = 0; - rc += check_isf128 ("check vec_all_isnormalf128", x, test, expt); + rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif /* accumulate the number of values tested, in case we are doing * detail timing and want to compute function averages. */ tcount += tests_count; - printf ("\ntest_all_isnormalf128, tests=%ld fails=%d\n", tests_count, rc); + printf ("\ntest_all_iszerof128, tests=%ld fails=%d\n", tests_count, rc); + + return (rc); +} + +int +test_all_is_f128 (void) +{ + int rc = 0; + tcount = 0; + + printf ("\ntest_all_is_f128, ...\n"); + + rc += test_all_isfinitef128 (); + rc += test_all_isinff128 (); + rc += test_all_isnanf128 (); + rc += test_all_isnormalf128 (); + rc += test_all_issubnormalf128 (); + rc += test_all_iszerof128 (); + rc += test_isinf_signf128 (); + rc += test_signbitf128 (); + + printf ("\ntest_all_is f128, tests=%ld fails=%d\n", tcount, rc); + + return (rc); +} + +int +test_vec_bool_f128 (void) +{ + int rc = 0; + tcount = 0; + + printf ("\ntest_vec_bool_f128, ...\n"); + + rc += test_setb_qp (); + rc += test_isinff128 (); + rc += test_isnanf128 (); + rc += test_isfinitef128 (); + rc += test_isnormalf128 (); + rc += test_issubnormalf128 (); + rc += test_iszerof128 (); + + printf ("\ntest_vec_bool f128, tests=%ld fails=%d\n", tcount, rc); + + return (rc); +} + +int +test_vec_f128_f128 (void) +{ + int rc = 0; + tcount = 0; + + printf ("\ntest_vec_f128 -> f128, ...\n"); + + rc += test_absf128 (); + rc += test_copysignf128 (); + + printf ("\ntest_vec_f128 f128, tests=%ld fails=%d\n", tcount, rc); + + return (rc); +} + +int +test_extract_insert_f128 () +{ + __binary128 x, xp, xpt; + vui128_t sig, sigt, sigs; + vui64_t exp, expt; + int rc = 0; + + printf ("\ntest_extract_insert_f128 ...\n"); + + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxexpqp 1", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 1", (vui128_t) sig, (vui128_t) sigt); + + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsiexpqp 1", x, xpt, xp); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxexpqp 2", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 2", (vui128_t) sig, (vui128_t) sigt); + + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsiexpqp 2", x, xp, xpt); + + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000003fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 3", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0001000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 3", (vui128_t) sig, (vui128_t) sigt); - return (rc); -} + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsiexpqp 3", x, xpt, xp); -int -test_all_issubnormalf128 (void) -{ - const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0)); - const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0)); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000003fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 4", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x3fff000000000000, 0)); - const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xbfff000000000000, 0)); + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0001000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 4", (vui128_t) sig, (vui128_t) sigt); - const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsiexpqp 4", x, xpt, xp); - const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); - const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007ffe, 0); + rc += check_vuint128x ("check vec_xsxexpqp 5", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0001ffffffffffff, 0xffffffffffffffff); + rc += check_vuint128x ("check vec_xsxsigqp 5", (vui128_t) sig, (vui128_t) sigt); - const __binary128 f128_submin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); - const __binary128 f128_nsubmin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsiexpqp 5", x, xpt, xp); - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff000000000000, 0)); - const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000000000000, 0)); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007ffe, 0); + rc += check_vuint128x ("check vec_xsxexpqp 6", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff800000000000, 0)); - const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff800000000000, 0)); + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0001ffffffffffff, 0xffffffffffffffff); + rc += check_vuint128x ("check vec_xsxsigqp 6", (vui128_t) sig, (vui128_t) sigt); - const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff400000000000, 0)); - const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000080000000, 0)); + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + rc += check_f128 ("check vec_xsiexpqp 6", x, xpt, xp); - __binary128 x; - long tests_count = 0; - int test, expt; - int rc = 0; - tcount = 0; + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); +#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxexpqp 7", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_all_issubnormalf128 f128 -> bool int , ...\n"); + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff); + rc += check_vuint128x ("check vec_xsxsigqp 7", (vui128_t) sig, (vui128_t) sigt); -#if 1 - tests_count++; - x = (__binary128) f128_zero; + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + rc += check_f128 ("check vec_xsiexpqp 7", x, xpt, xp); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_nzero; + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxexpqp 8", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff); + rc += check_vuint128x ("check vec_xsxsigqp 8", (vui128_t) sig, (vui128_t) sigt); + + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + rc += check_f128 ("check vec_xsiexpqp 8", x, xpt, xp); + + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_one; + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 9", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 9", (vui128_t) sig, (vui128_t) sigt); + + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_inf); + rc += check_f128 ("check vec_xsiexpqp 9", x, xpt, xp); + + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_none; + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 10", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 10", (vui128_t) sig, (vui128_t) sigt); + + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsiexpqp 10", x, xp, xpt); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_max; + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 11", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000800000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 11", (vui128_t) sig, (vui128_t) sigt); + + xp = vec_xsiexpqp (sig, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_nan); + rc += check_f128 ("check vec_xsiexpqp 11", x, xpt, xp); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif + exp = vec_xsxexpqp (x); + expt = CONST_VINT128_DW(0x0000000000007fff, 0); + rc += check_vuint128x ("check vec_xsxexpqp 12", (vui128_t) exp, (vui128_t) expt); + + sig = vec_xsxsigqp (x); + sigt = (vui128_t) CONST_VINT128_DW(0x0000800000000000, 0); + rc += check_vuint128x ("check vec_xsxsigqp 12", (vui128_t) sig, (vui128_t) sigt); + + sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); + xp = vec_xsiexpqp (sigs, exp); + xpt = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + rc += check_f128 ("check vec_xsiexpqp 12", x, xp, xpt); + + return (rc); +} + +int +test_cmpeq_f128 () +{ + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; + + printf ("\ntest_cmpeq_f128 ...\n"); #if 1 - tests_count++; - x = (__binary128) f128_nmax; + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 1", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 1", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 1", (vui128_t) exp, (vui128_t) expt); #endif -#if 1 - tests_count++; - x = (__binary128) f128_min; + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 2", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 2", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 2", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nmin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 3", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_sub; + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 4", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 4", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 4", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nsub; + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 5", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 5", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 5", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_submin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 6", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 6", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 6", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nsubmin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 7", (vui128_t) exp, (vui128_t) expt); + + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 7", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 7", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_inf; + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif -#if 1 - tests_count++; - x = (__binary128) f128_ninf; -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 8", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 8", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 8", (vui128_t) exp, (vui128_t) expt); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nan; + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 9", (vui128_t) exp, (vui128_t) expt); + + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 9", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 9", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nnan; + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 10", (vui128_t) exp, (vui128_t) expt); + + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 10", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 10", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_snan; + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequqp 11", (vui128_t) exp, (vui128_t) expt); + + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpequzqp 11", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpeqtoqp 11", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nsnan; + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_issubnormalf128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_issubnormalf128", x, test, expt); -#endif + exp = vec_cmpequqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequqp 12", (vui128_t) exp, (vui128_t) expt); - /* accumulate the number of values tested, in case we are doing - * detail timing and want to compute function averages. */ - tcount += tests_count; - printf ("\ntest_all_issubnormalf128, tests=%ld fails=%d\n", tests_count, rc); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpequzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpequzqp 12", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpeqtoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpeqtoqp 12", (vui128_t) exp, (vui128_t) expt); +#endif return (rc); } int -test_all_iszerof128 (void) +test_cmpgt_f128 () { - const __binary128 f128_zero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0)); - const __binary128 f128_nzero = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0)); - - const __binary128 f128_one = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x3fff000000000000, 0)); - const __binary128 f128_none = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xbfff000000000000, 0)); - - const __binary128 f128_max = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7ffeffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nmax = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xfffeffffffffffff, 0xffffffffffffffff)); + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; - const __binary128 f128_min = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0001000000000000, 0x0000000000000000)); - const __binary128 f128_nmin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8001000000000000, 0x0000000000000000)); + printf ("\n%s\n", __FUNCTION__); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 0", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_sub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff)); - const __binary128 f128_nsub = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000ffffffffffff, 0xffffffffffffffff)); + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 0", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_submin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x0000000000000000, 0x0000000000000001)); - const __binary128 f128_nsubmin = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x8000000000000000, 0x0000000000000001)); + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 0", (vui128_t) exp, (vui128_t) expt); +#endif - const __binary128 f128_inf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff000000000000, 0)); - const __binary128 f128_ninf = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000000000000, 0)); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 1", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_nan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff800000000000, 0)); - const __binary128 f128_nnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff800000000000, 0)); + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 1", (vui128_t) exp, (vui128_t) expt); - const __binary128 f128_snan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0x7fff400000000000, 0)); - const __binary128 f128_nsnan = vec_xfer_vui64t_2_bin128 ( - CONST_VINT128_DW(0xffff000080000000, 0)); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 1", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - __binary128 x; - long tests_count = 0; - int test, expt; - int rc = 0; +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 1b", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_all_iszerof128 f128 -> bool int , ...\n"); + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 1b", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 1b", (vui128_t) exp, (vui128_t) expt); +#endif +#endif #if 1 - tests_count++; - x = (__binary128) f128_zero; + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuqp 2", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuzqp 2", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgttoqp 2", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nzero; + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 2b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 2b", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 2b", (vui128_t) exp, (vui128_t) expt); #endif - test = vec_all_iszerof128 (x); - expt = 1; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_one; + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuzqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgttoqp 3", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_none; + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 3b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 3b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 3b", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_max; + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 3c", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 3c", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 3c", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nmax; + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuqp 3d", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuzqp 3d", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgttoqp 3d", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_min; + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuqp 4", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuzqp 4", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgttoqp 4", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nmin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 4b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 4b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 4b", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_sub; + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuqp 5", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgtuzqp 5", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgttoqp 5", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nsub; + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 5b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 5b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 5b", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_submin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 6", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 6", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 6", (vui128_t) exp, (vui128_t) expt); #endif +#endif + #if 1 - tests_count++; - x = (__binary128) f128_nsubmin; + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpgtuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuqp 6b", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgtuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgtuzqp 6b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpgttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgttoqp 6b", (vui128_t) exp, (vui128_t) expt); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif + + return (rc); +} + +int +test_cmplt_f128 () +{ + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; + + printf ("\n%s\n", __FUNCTION__); #if 1 - tests_count++; - x = (__binary128) f128_inf; + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 0", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 0", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 0", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_ninf; + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 1", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 1", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 1", (vui128_t) exp, (vui128_t) expt); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nan; + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 1b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 1b", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 1b", (vui128_t) exp, (vui128_t) expt); #endif +#endif + #if 1 - tests_count++; - x = (__binary128) f128_nnan; + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 2", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 2", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 2", (vui128_t) exp, (vui128_t) expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_snan; + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuqp 2b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuzqp 2b", (vui128_t) exp, (vui128_t) expt); + +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmplttoqp 2b", (vui128_t) exp, (vui128_t) expt); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); #endif + #if 1 - tests_count++; - x = (__binary128) f128_nsnan; + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - test = vec_all_iszerof128 (x); - expt = 0; - rc += check_isf128 ("check vec_all_iszerof128", x, test, expt); -#endif - - /* accumulate the number of values tested, in case we are doing - * detail timing and want to compute function averages. */ - tcount += tests_count; - printf ("\ntest_all_iszerof128, tests=%ld fails=%d\n", tests_count, rc); - - return (rc); -} + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 3", (vui128_t) exp, (vui128_t) expt); -int -test_all_is_f128 (void) -{ - int rc = 0; - tcount = 0; + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 3", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_all_is_f128, ...\n"); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 3", (vui128_t) exp, (vui128_t) expt); +#endif - rc += test_all_isfinitef128 (); - rc += test_all_isinff128 (); - rc += test_all_isnanf128 (); - rc += test_all_isnormalf128 (); - rc += test_all_issubnormalf128 (); - rc += test_all_iszerof128 (); - rc += test_isinf_signf128 (); - rc += test_signbitf128 (); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuqp 3b", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_all_is f128, tests=%ld fails=%d\n", tcount, rc); + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuzqp 3b", (vui128_t) exp, (vui128_t) expt); - return (rc); -} + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmplttoqp 3b", (vui128_t) exp, (vui128_t) expt); +#endif -int -test_vec_bool_f128 (void) -{ - int rc = 0; - tcount = 0; +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuqp 3c", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_vec_bool_f128, ...\n"); + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuzqp 3c", (vui128_t) exp, (vui128_t) expt); - rc += test_setb_qp (); - rc += test_isinff128 (); - rc += test_isnanf128 (); - rc += test_isfinitef128 (); - rc += test_isnormalf128 (); - rc += test_issubnormalf128 (); - rc += test_iszerof128 (); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmplttoqp 3c", (vui128_t) exp, (vui128_t) expt); +#endif - printf ("\ntest_vec_bool f128, tests=%ld fails=%d\n", tcount, rc); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 3d", (vui128_t) exp, (vui128_t) expt); - return (rc); -} + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 3d", (vui128_t) exp, (vui128_t) expt); -int -test_vec_f128_f128 (void) -{ - int rc = 0; - tcount = 0; + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 3d", (vui128_t) exp, (vui128_t) expt); +#endif - printf ("\ntest_vec_f128 -> f128, ...\n"); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 4", (vui128_t) exp, (vui128_t) expt); - rc += test_absf128 (); - rc += test_copysignf128 (); + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 4", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_vec_f128 f128, tests=%ld fails=%d\n", tcount, rc); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 4", (vui128_t) exp, (vui128_t) expt); +#endif - return (rc); -} +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuqp 4b", (vui128_t) exp, (vui128_t) expt); -int -test_extract_insert_f128 () -{ - __binary128 x, xp, xpt; - vui128_t sig, sigt, sigs; - vui64_t exp, expt; - int rc = 0; + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuzqp 4b", (vui128_t) exp, (vui128_t) expt); - printf ("\ntest_extract_insert_f128 ...\n"); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmplttoqp 4b", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxexpqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 5", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 1", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 5", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsiexpqp 1", x, xpt, xp); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 5", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxexpqp 2", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuqp 5b", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 2", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpltuzqp 5b", (vui128_t) exp, (vui128_t) expt); - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsiexpqp 2", x, xp, xpt); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmplttoqp 5b", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000003fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 3", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 6", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0001000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 3", (vui128_t) sig, (vui128_t) sigt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 6", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsiexpqp 3", x, xpt, xp); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 6", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000003fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 4", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpltuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuqp 6b", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0001000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 4", (vui128_t) sig, (vui128_t) sigt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpltuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpltuzqp 6b", (vui128_t) exp, (vui128_t) expt); - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_none ); - rc += check_f128 ("check vec_xsiexpqp 4", x, xpt, xp); + exp = vec_cmplttoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmplttoqp 6b", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + return (rc); +} + +int +test_cmpge_f128 () +{ + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; + + printf ("\n%s\n", __FUNCTION__); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007ffe, 0); - rc += check_vuint128x ("check vec_xsxexpqp 5", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 0", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0001ffffffffffff, 0xffffffffffffffff); - rc += check_vuint128x ("check vec_xsxsigqp 5", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 0", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsiexpqp 5", x, xpt, xp); + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 0", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007ffe, 0); - rc += check_vuint128x ("check vec_xsxexpqp 6", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 1", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0001ffffffffffff, 0xffffffffffffffff); - rc += check_vuint128x ("check vec_xsxsigqp 6", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 1", (vui128_t) exp, (vui128_t) expt); - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - rc += check_f128 ("check vec_xsiexpqp 6", x, xpt, xp); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 1", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxexpqp 7", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 1b", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff); - rc += check_vuint128x ("check vec_xsxsigqp 7", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 1b", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - rc += check_f128 ("check vec_xsiexpqp 7", x, xpt, xp); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 1b", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxexpqp 8", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 2", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000ffffffffffff, 0xffffffffffffffff); - rc += check_vuint128x ("check vec_xsxsigqp 8", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 2", (vui128_t) exp, (vui128_t) expt); - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - rc += check_f128 ("check vec_xsiexpqp 8", x, xpt, xp); + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 2", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 9", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuqp 2b", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 9", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuzqp 2b", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_inf); - rc += check_f128 ("check vec_xsiexpqp 9", x, xpt, xp); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgetoqp 2b", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 10", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 2c", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000000000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 10", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 2c", (vui128_t) exp, (vui128_t) expt); - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsiexpqp 10", x, xp, xpt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 2c", (vui128_t) exp, (vui128_t) expt); +#endif +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 11", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuqp 3", (vui128_t) exp, (vui128_t) expt); - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000800000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 11", (vui128_t) sig, (vui128_t) sigt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgeuzqp 3", (vui128_t) exp, (vui128_t) expt); - xp = vec_xsiexpqp (sig, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_nan); - rc += check_f128 ("check vec_xsiexpqp 11", x, xpt, xp); + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpgetoqp 3", (vui128_t) exp, (vui128_t) expt); +#endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - exp = vec_xsxexpqp (x); - expt = CONST_VINT128_DW(0x0000000000007fff, 0); - rc += check_vuint128x ("check vec_xsxexpqp 12", (vui128_t) exp, (vui128_t) expt); - - sig = vec_xsxsigqp (x); - sigt = (vui128_t) CONST_VINT128_DW(0x0000800000000000, 0); - rc += check_vuint128x ("check vec_xsxsigqp 12", (vui128_t) sig, (vui128_t) sigt); - - sigs = (vui128_t) vec_or ((vui64_t) sig, vf128_nzero); - xp = vec_xsiexpqp (sigs, exp); - xpt = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); - rc += check_f128 ("check vec_xsiexpqp 12", x, xp, xpt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuqp 3b", (vui128_t) exp, (vui128_t) expt); - return (rc); -} + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuzqp 3b", (vui128_t) exp, (vui128_t) expt); -int -test_cmpeq_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgetoqp 3b", (vui128_t) exp, (vui128_t) expt); +#endif - printf ("\ntest_cmpeq_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuqp 3c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgeuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgeuzqp 3c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpgetoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpgetoqp 3c", (vui128_t) exp, (vui128_t) expt); #endif - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 3d", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 3d", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 3d", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 3e", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 3e", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 3e", (vui128_t) exp, (vui128_t) expt); #endif #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 4", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 4", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 4", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 4", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 5", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 4b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 5", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 4b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 5", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 4b", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 6", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 5", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 6", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 5", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 6", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 5", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 7", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 5b", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 7", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 5b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 7", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 5b", (vui128_t) exp, (vui128_t) expt); #endif #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 8", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 6", (vui128_t) exp, (vui128_t) expt); #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpequzqp (x, y); + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 8", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 8", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 6", (vui128_t) exp, (vui128_t) expt); #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpgeuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 9", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuqp 6b", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpequzqp (x, y); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpgeuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 9", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgeuzqp 6b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); + exp = vec_cmpgetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 9", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpgetoqp 6b", (vui128_t) exp, (vui128_t) expt); #endif +#endif + + return (rc); +} +int +test_cmple_f128 () +{ + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 10", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 0", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpequzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 10", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 0", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 10", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 0", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequqp 11", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 1", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpequzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpequzqp 11", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 1", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpeqtoqp 11", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 1", (vui128_t) exp, (vui128_t) expt); +#endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpequqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequqp 12", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 1b", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpequzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpequzqp 12", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 1b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpeqtoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpeqtoqp 12", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 1b", (vui128_t) exp, (vui128_t) expt); +#endif #endif - return (rc); -} - -int -test_cmpgt_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 2", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 2", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 2", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 2b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 2b", (vui128_t) exp, (vui128_t) expt); #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 2b", (vui128_t) exp, (vui128_t) expt); #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 1b", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 2c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 1b", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 2c", (vui128_t) exp, (vui128_t) expt); #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 2c", (vui128_t) exp, (vui128_t) expt); +#endif +#endif + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 1b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpleuzqp 3", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpletoqp 3", (vui128_t) exp, (vui128_t) expt); +#endif + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 3b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 3b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 3b", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 3c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuzqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 3c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgttoqp 2", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 3c", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 2b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 3d", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 2b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 3d", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 2b", (vui128_t) exp, (vui128_t) expt); -#endif + rc += check_vuint128x ("check vec_cmpletoqp 3d", (vui128_t) exp, (vui128_t) expt); #endif #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 3e", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuzqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 3e", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgttoqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 3e", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 4", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuqp 4b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpleuzqp 4b", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpletoqp 4b", (vui128_t) exp, (vui128_t) expt); +#endif + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 3c", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 5", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 3c", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 5", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 3c", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 5", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuqp 3d", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 5b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuzqp 3d", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 5b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgttoqp 3d", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 5b", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuqp 4", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpleuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpleuqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuzqp 4", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpleuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpleuzqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgttoqp 4", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpletoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpletoqp 6", (vui128_t) exp, (vui128_t) expt); +#endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpleuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 4b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuqp 6b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpleuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 4b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpleuzqp 6b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpletoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 4b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpletoqp 6b", (vui128_t) exp, (vui128_t) expt); #endif +#endif + + return (rc); +} +int +test_cmpne_f128 () +{ + __binary128 x, y; + vb128_t exp, expt; + int rc = 0; + + printf ("\ntest_cmpne_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuqp 5", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpneuqp 1", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgtuzqp 5", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuzqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpneuzqp 1", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgttoqp 5", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpnetoqp (x, y); + expt = (vb128_t) vf128_false; + rc += check_vuint128x ("check vec_cmpnetoqp 1", (vui128_t) exp, (vui128_t) expt); #endif - -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 5b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 2", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 5b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 2", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 5b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpnetoqp 2", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 6", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 3", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 6", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 3", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 6", (vui128_t) exp, (vui128_t) expt); -#endif + rc += check_vuint128x ("check vec_cmpnetoqp 3", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgtuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuqp 6b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 4", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgtuzqp (x, y); + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgtuzqp 6b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgttoqp 6b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpnetoqp 4", (vui128_t) exp, (vui128_t) expt); #endif + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + exp = vec_cmpneuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuqp 5", (vui128_t) exp, (vui128_t) expt); - return (rc); -} + exp = vec_cmpneuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuzqp 5", (vui128_t) exp, (vui128_t) expt); -int -test_cmplt_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; + exp = vec_cmpnetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpnetoqp 5", (vui128_t) exp, (vui128_t) expt); +#endif - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmplttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 0", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpnetoqp 6", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 1", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuqp 7", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 1", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpneuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuzqp 7", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 1", (vui128_t) exp, (vui128_t) expt); -#endif + exp = vec_cmpnetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpnetoqp 7", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 1b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 1b", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuqp 8", (vui128_t) exp, (vui128_t) expt); #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 1b", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuzqp 8", (vui128_t) exp, (vui128_t) expt); + + exp = vec_cmpnetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpnetoqp 8", (vui128_t) exp, (vui128_t) expt); #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 2", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpneuqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuqp 9", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 2", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpneuzqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpneuzqp 9", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 2", (vui128_t) exp, (vui128_t) expt); + exp = vec_cmpnetoqp (x, y); + expt = (vb128_t) vf128_true; + rc += check_vuint128x ("check vec_cmpnetoqp 9", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuqp 2b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 10", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuzqp 2b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 10", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmplttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmplttoqp 2b", (vui128_t) exp, (vui128_t) expt); -#endif + rc += check_vuint128x ("check vec_cmpnetoqp 10", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 11", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 11", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmplttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 3", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpnetoqp 11", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); + exp = vec_cmpneuqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuqp 12", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpltuzqp (x, y); + // P8 should detect these because absolute magnitudes are different + exp = vec_cmpneuzqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuzqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpneuzqp 12", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmplttoqp (x, y); + exp = vec_cmpnetoqp (x, y); expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmplttoqp 3b", (vui128_t) exp, (vui128_t) expt); + rc += check_vuint128x ("check vec_cmpnetoqp 12", (vui128_t) exp, (vui128_t) expt); #endif + return (rc); +} + +//#define __DEBUG_PRINT__ +int +test_cmpeq_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\ntest_cmpeq_all_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuqp 3c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuzqp 3c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmplttoqp 3c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 3d", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 3d", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 3d", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 4", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 4", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 4", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuqp 4b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuzqp 4b", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmplttoqp 4b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + x = const_xfer_vui64t_2_bin128 ( vf128_max ); + y = const_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 5", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 5", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 5", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuqp 5b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpltuzqp 5b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmplttoqp 5b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = const_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = const_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 6", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 6 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 6", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 6 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 6", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 6 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } #endif #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpltuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuqp 6b", (vui128_t) exp, (vui128_t) expt); - -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpltuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpltuzqp 6b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmplttoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmplttoqp 6b", (vui128_t) exp, (vui128_t) expt); -#endif + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 7 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } - return (rc); -} - -int -test_cmpge_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; + // P8 should detect these because absolute magnitudes are different + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 7 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - printf ("\n%s\n", __FUNCTION__); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 0", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 0", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 0", (vui128_t) exp, (vui128_t) expt); + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 1", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 8 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 8 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } + + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 8 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 1b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 9 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 1b", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 9 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 1b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 9 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 2", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 10 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 2", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 10 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 2", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 10 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 2b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 11 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 2b", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + if (!vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 11 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 2b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 11 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 2c", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_eq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_eq 12 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 2c", (vui128_t) exp, (vui128_t) expt); + // P8 should detect these because absolute magnitudes are different + if (vec_cmpqp_all_uzeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzeq 12 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 2c", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_toeq (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_toeq 12 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_eq (x, y)); #endif + } #endif + return (rc); +} + +int +test_cmpgt_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 3", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 3", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 3", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 0 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 3b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 3b", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 3b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 0 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 3c", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 3c", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 3c", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 3d", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 3d", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 3d", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } +#endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 3e", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 3e", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 3e", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 1b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 4", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 4", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 4", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 1b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } +#endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 4b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 4b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 4b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + if (!vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuqp 5", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgeuzqp 5", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpgetoqp 5", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 5b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 5b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 5b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 2b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 6", (vui128_t) exp, (vui128_t) expt); + } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 6", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 6", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 2b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpgeuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuqp 6b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpgeuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgeuzqp 6b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpgetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpgetoqp 6b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } #endif - return (rc); -} -int -test_cmple_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; - - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 0", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 0", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 3b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 0", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 3b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } + + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 3b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 1", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 3c fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 3c fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } + + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 3c fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 1b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 1b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 1b", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 2b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 2b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 4b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 2b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 4b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } + + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 4b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 2c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 2c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 2c", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 5 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 3", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 3", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 3", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 5b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 3b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 3b", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 3b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 5b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 3c", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 3c", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 6 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 3c", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 6 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 3d", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 3d", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 3d", (vui128_t) exp, (vui128_t) expt); #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 3e", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 3e", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_gt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_gt 6b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 3e", (vui128_t) exp, (vui128_t) expt); +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzgt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzgt 6b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + if (vec_cmpqp_all_togt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_togt 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_gt (x, y)); +#endif + } +#endif #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 4", (vui128_t) exp, (vui128_t) expt); + return (rc); +} - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 4", (vui128_t) exp, (vui128_t) expt); -#endif +int +test_cmplt_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 4b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 4b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 4b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 0 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 5", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 5", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 5", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 0 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuqp 5b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpleuzqp 5b", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpletoqp 5b", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 6", (vui128_t) exp, (vui128_t) expt); + } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 6", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 6", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 1 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpleuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuqp 6b", (vui128_t) exp, (vui128_t) expt); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpleuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpleuzqp 6b", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpletoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpletoqp 6b", (vui128_t) exp, (vui128_t) expt); -#endif + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 1b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } - return (rc); -} + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 1b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } -int -test_cmpne_f128 () -{ - __binary128 x, y; - vb128_t exp, expt; - int rc = 0; +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 1b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } +#endif +#endif - printf ("\ntest_cmpne_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 1", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 2 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + } +#endif + +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 2b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 2b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 2", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 2b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } +#endif #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 3", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 3", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 3", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 3 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 4", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 4", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 4", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 3b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + if (!vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 5", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 5", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 5", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 3b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 6", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 6", (vui128_t) exp, (vui128_t) expt); - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 6", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 3c fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + if (!vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 7", (vui128_t) exp, (vui128_t) expt); - - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 7", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 7", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 3c fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 8", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 8", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 8", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 3d fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } #endif #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 9", (vui128_t) exp, (vui128_t) expt); - - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 9", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 9", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + if (vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 10", (vui128_t) exp, (vui128_t) expt); - - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 10", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 10", (vui128_t) exp, (vui128_t) expt); + if (vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 4 fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuqp 11", (vui128_t) exp, (vui128_t) expt); - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpneuzqp 11", (vui128_t) exp, (vui128_t) expt); - - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_false; - rc += check_vuint128x ("check vec_cmpnetoqp 11", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_lt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_lt 4b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif + } -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + if (!vec_cmpqp_all_uzlt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_uzlt 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); #endif - exp = vec_cmpneuqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuqp 12", (vui128_t) exp, (vui128_t) expt); - - // P8 should detect these because absolute magnitudes are different - exp = vec_cmpneuzqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpneuzqp 12", (vui128_t) exp, (vui128_t) expt); + } - exp = vec_cmpnetoqp (x, y); - expt = (vb128_t) vf128_true; - rc += check_vuint128x ("check vec_cmpnetoqp 12", (vui128_t) exp, (vui128_t) expt); + if (!vec_cmpqp_all_tolt (x, y)) + { + rc += 1; + printf ("vec_cmpqp_all_tolt 4b fail\n"); +#ifdef __DEBUG_PRINT__ + print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x (" ,", y); + printf (" )= %d", + vec_cmpqp_all_lt (x, y)); +#endif + } #endif - return (rc); -} - -//#define __DEBUG_PRINT__ -int -test_cmpeq_all_f128 () -{ - __binary128 x, y; - int rc = 0; - printf ("\ntest_cmpeq_all_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + if (vec_cmpqp_all_lt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 1 fail\n"); + printf ("vec_cmpqp_all_lt 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_uzeq (x, y)) + if (vec_cmpqp_all_uzlt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 1 fail\n"); + printf ("vec_cmpqp_all_uzlt 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_toeq (x, y)) + if (vec_cmpqp_all_tolt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 1 fail\n"); + printf ("vec_cmpqp_all_tolt 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + + if (!vec_cmpqp_all_lt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 2 fail\n"); + printf ("vec_cmpqp_all_lt 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzlt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 2 fail\n"); + printf ("vec_cmpqp_all_uzlt 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_toeq (x, y)) + if (!vec_cmpqp_all_tolt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 2 fail\n"); + printf ("vec_cmpqp_all_tolt 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } #endif - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); +#if 1 + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + if (vec_cmpqp_all_lt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 3 fail\n"); + printf ("vec_cmpqp_all_lt 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_uzeq (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzlt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 3 fail\n"); + printf ("vec_cmpqp_all_uzlt 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_toeq (x, y)) + if (vec_cmpqp_all_tolt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 3 fail\n"); + printf ("vec_cmpqp_all_tolt 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } #endif +#endif #if 1 - x = const_xfer_vui64t_2_bin128 ( vf128_max ); - y = const_xfer_vui64t_2_bin128 ( vf128_max ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + if (vec_cmpqp_all_lt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 4 fail\n"); + printf ("vec_cmpqp_all_lt 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_uzeq (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzlt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 4 fail\n"); + printf ("vec_cmpqp_all_uzlt 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } - if (!vec_cmpqp_all_toeq (x, y)) + if (vec_cmpqp_all_tolt (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 4 fail\n"); + printf ("vec_cmpqp_all_tolt 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_lt( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_lt (x, y)); #endif } #endif +#endif + + return (rc); +} + +int +test_cmpge_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 5 fail\n"); + printf ("vec_cmpqp_all_ge 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 5 fail\n"); + printf ("vec_cmpqp_all_uzge 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 5 fail\n"); + printf ("vec_cmpqp_all_toge 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif #if 1 - x = const_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = const_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 6 fail\n"); + printf ("vec_cmpqp_all_ge 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 6 fail\n"); + printf ("vec_cmpqp_all_uzge 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_toeq (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 6 fail\n"); + printf ("vec_cmpqp_all_toge 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 7 fail\n"); + printf ("vec_cmpqp_all_ge 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - // P8 should detect these because absolute magnitudes are different - if (vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 7 fail\n"); + printf ("vec_cmpqp_all_uzge 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 7 fail\n"); + printf ("vec_cmpqp_all_toge 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 8 fail\n"); + printf ("vec_cmpqp_all_ge 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 8 fail\n"); + printf ("vec_cmpqp_all_uzge 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 8 fail\n"); + printf ("vec_cmpqp_all_toge 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 9 fail\n"); + printf ("vec_cmpqp_all_ge 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - // P8 should detect these because absolute magnitudes are different - if (vec_cmpqp_all_uzeq (x, y)) + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 9 fail\n"); + printf ("vec_cmpqp_all_uzge 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 9 fail\n"); + printf ("vec_cmpqp_all_toge 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 10 fail\n"); + printf ("vec_cmpqp_all_ge 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - // P8 should detect these because absolute magnitudes are different - if (vec_cmpqp_all_uzeq (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 10 fail\n"); + printf ("vec_cmpqp_all_uzge 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 10 fail\n"); + printf ("vec_cmpqp_all_toge 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_eq (x, y)) + + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 11 fail\n"); + printf ("vec_cmpqp_all_ge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - // P8 should detect these because absolute magnitudes are different - if (!vec_cmpqp_all_uzeq (x, y)) + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 11 fail\n"); + printf ("vec_cmpqp_all_uzge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_toeq (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 11 fail\n"); + printf ("vec_cmpqp_all_toge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_eq (x, y)) + + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_eq 12 fail\n"); + printf ("vec_cmpqp_all_ge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - // P8 should detect these because absolute magnitudes are different - if (vec_cmpqp_all_uzeq (x, y)) + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzeq 12 fail\n"); + printf ("vec_cmpqp_all_uzge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_toeq (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toeq 12 fail\n"); + printf ("vec_cmpqp_all_toge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_eq( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_eq (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif - return (rc); -} - -int -test_cmpgt_all_f128 () -{ - __binary128 x, y; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_gt (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 0 fail\n"); + printf ("vec_cmpqp_all_ge 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 0 fail\n"); + printf ("vec_cmpqp_all_uzge 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 0 fail\n"); + printf ("vec_cmpqp_all_toge 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_gt (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 1 fail\n"); + printf ("vec_cmpqp_all_ge 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 1 fail\n"); + printf ("vec_cmpqp_all_uzge 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 1 fail\n"); + printf ("vec_cmpqp_all_toge 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_gt (x, y)) + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 1b fail\n"); + printf ("vec_cmpqp_all_ge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 1b fail\n"); + printf ("vec_cmpqp_all_uzge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 1b fail\n"); + printf ("vec_cmpqp_all_toge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_gt (x, y)) + if (!vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 2 fail\n"); + printf ("vec_cmpqp_all_ge 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 2 fail\n"); + printf ("vec_cmpqp_all_uzge 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 2 fail\n"); + printf ("vec_cmpqp_all_toge 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_gt (x, y)) + + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 2b fail\n"); + printf ("vec_cmpqp_all_ge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 2b fail\n"); + printf ("vec_cmpqp_all_uzge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 2b fail\n"); + printf ("vec_cmpqp_all_toge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_gt (x, y)) + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 3 fail\n"); + printf ("vec_cmpqp_all_ge 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_uzgt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 3 fail\n"); + printf ("vec_cmpqp_all_uzge 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (!vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 3 fail\n"); + printf ("vec_cmpqp_all_toge 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_gt (x, y)) + if (vec_cmpqp_all_ge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 3b fail\n"); + printf ("vec_cmpqp_all_ge 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 3b fail\n"); + printf ("vec_cmpqp_all_uzge 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_toge (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 3b fail\n"); + printf ("vec_cmpqp_all_toge 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_ge( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_ge (x, y)); #endif } #endif +#endif + + return (rc); +} + +int +test_cmple_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_gt (x, y)) + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 3c fail\n"); + printf ("vec_cmpqp_all_le 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 3c fail\n"); + printf ("vec_cmpqp_all_uzle 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 3c fail\n"); + printf ("vec_cmpqp_all_tole 0 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_gt (x, y)) + + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 3d fail\n"); + printf ("vec_cmpqp_all_le 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 3d fail\n"); + printf ("vec_cmpqp_all_uzle 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_togt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 3d fail\n"); + printf ("vec_cmpqp_all_tole 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_gt (x, y)) + + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 4 fail\n"); + printf ("vec_cmpqp_all_le 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 4 fail\n"); + printf ("vec_cmpqp_all_uzle 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_togt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 4 fail\n"); + printf ("vec_cmpqp_all_tole 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_gt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 4b fail\n"); + printf ("vec_cmpqp_all_le 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 4b fail\n"); + printf ("vec_cmpqp_all_uzle 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 4b fail\n"); + printf ("vec_cmpqp_all_tole 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_gt (x, y)) + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 5 fail\n"); + printf ("vec_cmpqp_all_le 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 5 fail\n"); + printf ("vec_cmpqp_all_uzle 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_togt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 5 fail\n"); + printf ("vec_cmpqp_all_tole 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_gt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 5b fail\n"); + printf ("vec_cmpqp_all_le 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzgt (x, y)) + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 5b fail\n"); + printf ("vec_cmpqp_all_uzle 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 5b fail\n"); + printf ("vec_cmpqp_all_tole 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_gt (x, y)) + + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 6 fail\n"); + printf ("vec_cmpqp_all_le 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 6 fail\n"); + printf ("vec_cmpqp_all_uzle 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 6 fail\n"); + printf ("vec_cmpqp_all_tole 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_gt (x, y)) + + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_gt 6b fail\n"); + printf ("vec_cmpqp_all_le 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzgt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzgt 6b fail\n"); + printf ("vec_cmpqp_all_uzle 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_togt (x, y)) + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_togt 6b fail\n"); + printf ("vec_cmpqp_all_tole 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_gt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_gt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif -#endif - - return (rc); -} - -int -test_cmplt_all_f128 () -{ - __binary128 x, y; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 0 fail\n"); + printf ("vec_cmpqp_all_le 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 0 fail\n"); + printf ("vec_cmpqp_all_uzle 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 0 fail\n"); + printf ("vec_cmpqp_all_tole 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 1 fail\n"); + printf ("vec_cmpqp_all_le 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 1 fail\n"); + printf ("vec_cmpqp_all_uzle 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 1 fail\n"); + printf ("vec_cmpqp_all_tole 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 1b fail\n"); + printf ("vec_cmpqp_all_le 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 1b fail\n"); + printf ("vec_cmpqp_all_uzle 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_tolt (x, y)) + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 1b fail\n"); + printf ("vec_cmpqp_all_tole 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 2 fail\n"); + printf ("vec_cmpqp_all_le 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 2 fail\n"); + printf ("vec_cmpqp_all_uzle 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 2 fail\n"); + printf ("vec_cmpqp_all_tole 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_lt (x, y)) + + if (!vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 2b fail\n"); + printf ("vec_cmpqp_all_le 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_uzlt (x, y)) + if (!vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 2b fail\n"); + printf ("vec_cmpqp_all_uzle 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_tolt (x, y)) + if (!vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 2b fail\n"); + printf ("vec_cmpqp_all_tole 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 3 fail\n"); + printf ("vec_cmpqp_all_le 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 3 fail\n"); + printf ("vec_cmpqp_all_uzle 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 3 fail\n"); + printf ("vec_cmpqp_all_tole 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_le (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 3b fail\n"); + printf ("vec_cmpqp_all_le 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_uzlt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_uzle (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 3b fail\n"); + printf ("vec_cmpqp_all_uzle 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } - if (!vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tole (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 3b fail\n"); + printf ("vec_cmpqp_all_tole 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_le( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_le (x, y)); #endif } #endif +#endif + + return (rc); +} + +//#define __DEBUG_PRINT__ +int +test_cmpne_all_f128 () +{ + __binary128 x, y; + int rc = 0; + printf ("\ntest_cmpne_all_f128 ...\n"); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 3c fail\n"); + printf ("vec_cmpqp_all_ne 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 3c fail\n"); + printf ("vec_cmpqp_all_uzne 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 3c fail\n"); + printf ("vec_cmpqp_all_tone 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif - -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 3d fail\n"); + printf ("vec_cmpqp_all_ne 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 3d fail\n"); + printf ("vec_cmpqp_all_uzne 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // Don't expect to detect this case for P8 but should on P9 + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 3d fail\n"); + printf ("vec_cmpqp_all_tone 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 4 fail\n"); + printf ("vec_cmpqp_all_ne 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 4 fail\n"); + printf ("vec_cmpqp_all_uzne 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 4 fail\n"); + printf ("vec_cmpqp_all_tone 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = const_xfer_vui64t_2_bin128 ( vf128_max ); + y = const_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 4b fail\n"); + printf ("vec_cmpqp_all_ne 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 4b fail\n"); + printf ("vec_cmpqp_all_uzne 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 4b fail\n"); + printf ("vec_cmpqp_all_tone 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 5 fail\n"); + printf ("vec_cmpqp_all_ne 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_uzlt (x, y)) + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 5 fail\n"); + printf ("vec_cmpqp_all_uzne 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 5 fail\n"); + printf ("vec_cmpqp_all_tone 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = const_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = const_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_lt (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 5b fail\n"); + printf ("vec_cmpqp_all_ne 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzlt (x, y)) + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 5b fail\n"); + printf ("vec_cmpqp_all_uzne 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_tolt (x, y)) + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 5b fail\n"); + printf ("vec_cmpqp_all_tone 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif @@ -9317,41 +11771,41 @@ test_cmplt_all_f128 () print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 6 fail\n"); + printf ("vec_cmpqp_all_ne 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzlt (x, y)) + // P8 should detect these because absolute magnitudes are different + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 6 fail\n"); + printf ("vec_cmpqp_all_uzne 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 6 fail\n"); + printf ("vec_cmpqp_all_tone 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif @@ -9359,3403 +11813,3587 @@ test_cmplt_all_f128 () #if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_lt (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_lt 6b fail\n"); + printf ("vec_cmpqp_all_ne 8 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzlt (x, y)) + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzlt 6b fail\n"); + printf ("vec_cmpqp_all_uzne 8 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (vec_cmpqp_all_tolt (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_tolt 6b fail\n"); + printf ("vec_cmpqp_all_tone 8 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_lt( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_lt (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif #endif - return (rc); -} - -int -test_cmpge_all_f128 () -{ - __binary128 x, y; - int rc = 0; - - printf ("\n%s\n", __FUNCTION__); #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ge (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_ge 0 fail\n"); + printf ("vec_cmpqp_all_ne 9 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzge (x, y)) +#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) + // P8 should detect these because absolute magnitudes are different + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzge 0 fail\n"); + printf ("vec_cmpqp_all_uzne 9 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_toge (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toge 0 fail\n"); + printf ("vec_cmpqp_all_tone 9 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif +#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_ge (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_ge 1 fail\n"); + printf ("vec_cmpqp_all_ne 10 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzge (x, y)) + // P8 should detect these because absolute magnitudes are different + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzge 1 fail\n"); + printf ("vec_cmpqp_all_uzne 10 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_toge (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toge 1 fail\n"); + printf ("vec_cmpqp_all_tone 10 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - - if (!vec_cmpqp_all_ge (x, y)) + if (vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_ge 1b fail\n"); + printf ("vec_cmpqp_all_ne 11 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzge (x, y)) + // P8 should detect these because absolute magnitudes are different + if (vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzge 1b fail\n"); + printf ("vec_cmpqp_all_uzne 11 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_toge (x, y)) + if (vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toge 1b fail\n"); + printf ("vec_cmpqp_all_tone 11 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif -#endif #if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ge (x, y)) + if (!vec_cmpqp_all_ne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_ge 2 fail\n"); + printf ("vec_cmpqp_all_ne 12 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_uzge (x, y)) + // P8 should detect these because absolute magnitudes are different + if (!vec_cmpqp_all_uzne (x, y)) { rc += 1; - printf ("vec_cmpqp_all_uzge 2 fail\n"); + printf ("vec_cmpqp_all_uzne 12 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } - if (!vec_cmpqp_all_toge (x, y)) + if (!vec_cmpqp_all_tone (x, y)) { rc += 1; - printf ("vec_cmpqp_all_toge 2 fail\n"); + printf ("vec_cmpqp_all_tone 12 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); + print_vfloat128x ("vec_cmpqp_all_ne( ", x); print_vfloat128x (" ,", y); printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + vec_cmpqp_all_ne (x, y)); #endif } #endif + return (rc); +} -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + + +#define __DOUBLE_ZERO (0x0000000000000000UL) +#define __DOUBLE_NZERO (0x8000000000000000UL) +#define __DOUBLE_ONE (0x3ff0000000000000UL) +#define __DOUBLE_NONE (0xbff0000000000000UL) +#define __DOUBLE_MAX (0x7fefffffffffffffUL) +#define __DOUBLE_NMAX (0xffefffffffffffffUL) +#define __DOUBLE_MIN (0x0010000000000000UL) +#define __DOUBLE_NMIN (0x8010000000000000UL) +#define __DOUBLE_SUB (0x0000000000000001UL) +#define __DOUBLE_NSUB (0x8000000000000001UL) +#define __DOUBLE_INF (0x7ff0000000000000UL) +#define __DOUBLE_NINF (0xfff0000000000000UL) +#define __DOUBLE_NAN (0x7ff8000000000000UL) +#define __DOUBLE_NNAN (0xfff8000000000000UL) +#define __DOUBLE_SNAN (0x7ff0000000000001UL) +#define __DOUBLE_NSNAN (0xfff0000000000001UL) +#define __DOUBLE_TRUE (0xffffffffffffffffUL) +#define __DOUBLE_NTRUE (0x0000000000000000UL) +#define __DOUBLE_HIDDEN (0x0010000000000000UL) + +//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); +#define test_xscvdpqp(_i) db_vec_xscvdpqp(_i) +#else +#define test_xscvdpqp(_i) vec_xscvdpqp(_i) #endif - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 2b fail\n"); + +int +test_convert_dpqp (void) +{ + vf64_t x; + __binary128 t, e; + vui64_t eui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_ZERO, 0 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2f64x (" x=", x); #endif - } + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NZERO, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_nzero); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_ONE, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NONE, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_none); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_MAX, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_MAX as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0x43feffffffffffff, 0xf000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NMAX, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_NMAX as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0xc3feffffffffffff, 0xf000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_MIN, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_MIN as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0x3c01000000000000,0); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NMIN, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_NMIN as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0xbc01000000000000,0); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_SUB, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_MAX as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0x3bcd000000000000,0); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NSUB, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2f64x (" x=", x); +#endif + t = test_xscvdpqp (x); + // __DOUBLE_MAX as QUAD-Precision + eui = (vui64_t) CONST_VINT64_DW ( 0xbbcd000000000000,0); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_INF, 0 ); - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2f64x (" x=", x); #endif - } + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_inf); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NINF, 0 ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } -#endif + print_v2f64x (" x=", x); #endif + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_ninf); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NAN, 0 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2f64x (" x=", x); #endif - if (!vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 3 fail\n"); + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_nan); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NNAN, 0 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2f64x (" x=", x); #endif - } + t = test_xscvdpqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_nnan); + rc += check_f128 ("check vec_xscvdpqp", e, t, e); + + return (rc); +} + +//#define __DEBUG_PRINT__ 1 + +int +test_convert_udqp (void) +{ + vui64_t x; + __binary128 t, e; + vui64_t eui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = (vui64_t) CONST_VINT64_DW ( 0, 0 ); - if (!vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvudqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xscvudqp", e, t, e); + + x = (vui64_t) CONST_VINT64_DW ( 1, 2 ); - if (!vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvudqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xscvudqp", e, t, e); + + x = (vui64_t) CONST_VINT64_DW ( 0x7fffffffffffffff, 3 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif + t = vec_xscvudqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvudqp", e, t, e); + + x = (vui64_t) CONST_VINT64_DW ( 0x8000000000000000, 4 ); - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvudqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvudqp", e, t, e); + + x = (vui64_t) CONST_VINT64_DW ( 0xffffffffffffffff, 5 ); - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvudqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403effffffffffff, 0xfffe000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvudqp", e, t, e); + + return (rc); +} + +int +test_convert_sdqp (void) +{ + vi64_t x; + __binary128 t, e; + vui64_t eui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = (vi64_t) CONST_VINT64_DW ( 0, 0 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", (vui64_t) x); #endif + t = vec_xscvsdqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xscvsdqp", e, t, e); + + x = (vi64_t) CONST_VINT64_DW ( 1, 2 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", (vui64_t) x); #endif + t = vec_xscvsdqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xscvsdqp", e, t, e); + + x = (vi64_t) CONST_VINT64_DW ( 0x7fffffffffffffff, 3 ); - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", (vui64_t) x); #endif - } + t = vec_xscvsdqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsdqp", e, t, e); + + x = (vi64_t) CONST_VINT64_DW ( 0x8000000000000000, 4 ); - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", (vui64_t) x); #endif - } + t = vec_xscvsdqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0xc03e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsdqp", e, t, e); + + x = (vi64_t) CONST_VINT64_DW ( 0xffffffffffffffff, 5 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", (vui64_t) x); #endif - } + t = vec_xscvsdqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_none); + rc += check_f128 ("check vec_xscvsdqp", e, t, e); + + return (rc); +} + +int +test_convert_uqqp (void) +{ + vui128_t x; + __binary128 t, e; + vui64_t eui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + +#ifdef __DEBUG_PRINT__ + print_v2xint64 (" x=", x); #endif + t = vec_xscvuqqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0, 1 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif - if (!vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 3d fail\n"); + t = vec_xscvuqqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0, 0x7fffffffffffffff ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0, 0x8000000000000000 ); - if (!vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0x8000000000000000, 0 ); - if (!vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif - if (!vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 4 fail\n"); + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407f000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + // Test various Even/odd and GRX combinations. + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff0000 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff4000 ); - if (!vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff5000 ); - if (!vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff6000 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff8000 ); - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff9000 ); - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffa000 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffc000 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif - if (!vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 5 fail\n"); + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407f000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff4000 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff6000 ); - if (!vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvuqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvuqqp", e, t, e); + + return (rc); +} + +int +test_convert_sqqp (void) +{ + vi128_t x; + __binary128 t, e; + vui64_t eui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = (vi128_t) CONST_VINT128_DW ( 0, 0 ); - if (!vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvsqqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0, 1 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif + t = vec_xscvsqqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0, 0x7fffffffffffffff ); - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0, 0x8000000000000000 ); - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x8000000000000000, 0 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } + print_v2xint64 (" x=", x); #endif + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0xc07e000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 6 fail\n"); + t = vec_xscvsqqp (x); + e = vec_xfer_vui64t_2_bin128 (vf128_none); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + // Test various Even/odd and GRX combinations. + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffff8000 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffa000 ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffb800 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } -#endif + print_v2xint64 (" x=", x); #endif + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffb000 ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_v2xint64 (" x=", x); #endif - if (vec_cmpqp_all_ge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ge 6b fail\n"); + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffc000 ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffa000 ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzge 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); + print_v2xint64 (" x=", x); #endif - } + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); + + x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffff6000 ); - if (vec_cmpqp_all_toge (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_toge 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ge( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ge (x, y)); -#endif - } -#endif + print_v2xint64 (" x=", x); #endif + t = vec_xscvsqqp (x); + eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (eui); + rc += check_f128 ("check vec_xscvsqqp", e, t, e); return (rc); } +//#define __DEBUG_PRINT__ 1 int -test_cmple_all_f128 () +test_convert_qpuqz (void) { - __binary128 x, y; + __binary128 x; + vui128_t t, e; + vui64_t xui; int rc = 0; - printf ("\n%s\n", __FUNCTION__); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); -#endif - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 0 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } - - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 0 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } - - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 0 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif -#if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); -#endif - - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 1 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 1 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif -#endif + x = vec_xfer_vui64t_2_bin128 ( vf128_min ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nmin ); - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 1 ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407e000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 1b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0x8000000000000000, 0); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407effffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 2 fail\n"); + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff8000 ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0x0, 0x8000000000000000); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x403effffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0x0, 0xffffffffffffffff ); + + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407f000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407fffffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 2b fail\n"); + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 2b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpuqz (x); + e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + + return (rc); +} + +//#define __DEBUG_PRINT__ 1 +int +test_convert_qpudz (void) +{ + __binary128 x; + vui64_t t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_sub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 3 fail\n"); + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_min ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nmin ); - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 1, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nsub ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0x8000000000000000, 0); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407effffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0x8000000000000000, 0); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x403effffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 3b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0); + + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407f000000000000, 0); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + xui = (vui64_t) CONST_VINT64_DW(0x407fffffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 3c fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 3d fail\n"); + t = vec_xscvqpudz (x); + e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); + rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + + return (rc); +} + + +//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); +#define test_xscvqpdpo(_l) db_vec_xscvqpdpo(_l) +#else +#define test_xscvqpdpo(_l) vec_xscvqpdpo(_l) #endif - } +int +test_convert_qpdpo (void) +{ + __binary128 x; + vf64_t t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_ZERO, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 3d fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NZERO, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3c01000000000000, 0x0000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x0010000000000000, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3c00000000000000, 0x0000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 4 fail\n"); + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x0008000000000000, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3bcd000000000000, 0x0000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x0000000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3bcc000000000000, 0x0000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x0000000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x1000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x0800000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x1800000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x0000000000000001 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 4b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 1, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + // Smallest QP denormal + xui = CONST_VINT128_DW ( 0x0000000000000000, 0x0000000000000001 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 5 fail\n"); + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( 1, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_ONE, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NONE, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x43feffffffffffff, 0xf000000000000000 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + xui = CONST_VINT128_DW ( 0x43ff000000000000, 0x0000000000000001 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - if (!vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - if (!vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_INF, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (!vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 5b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + print_vfloat128x(" x= ", x); #endif + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NINF, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); -#if 1 x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 6 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } + t = test_xscvqpdpo (x); + e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NAN, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); #endif - } + t = test_xscvqpdpo (x); + // Signaling converted to Quite + e = (vf64_t) CONST_VINT128_DW ( 0x7ffc000000000000, 0 ); + rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 6 fail\n"); + return (rc); +} + +//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif +#define test_xsmulqpo(_l,_k) db_vec_xsmulqpo(_l,_k) +#else +extern __binary128 test_vec_mulqpo (__binary128 vfa, __binary128 vfb); +extern __binary128 test_vec_xsmulqpo (__binary128 vfa, __binary128 vfb); +#define test_xsmulqpo(_l,_k) test_vec_xsmulqpo(_l,_k) +//#define test_xsmulqpo(_l,_k) test_vec_mulqpo(_l,_k) #endif -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nnan ); +int +test_mul_qpo (void) +{ + __binary128 x, y; + __binary128 t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_le (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_le 6b fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_uzle (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzle 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + +// x = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); +// y = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_tole (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tole 6b fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_le( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_le (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); - return (rc); -} +// e = 9.0Q; + xui = CONST_VINT128_DW ( 0x4002200000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -//#define __DEBUG_PRINT__ -int -test_cmpne_all_f128 () -{ - __binary128 x, y; - int rc = 0; + // x = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + + #ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); + #endif + t = test_xsmulqpo (x, y); + + // e = 9.0Q; + xui = CONST_VINT128_DW ( 0x4002200000000000, 1 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - printf ("\ntest_cmpne_all_f128 ...\n"); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 1 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + // x = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x0000400000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + // x = 1.0p-8191Q; + xui = CONST_VINT128_DW ( 0x2000000000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.5Q; + xui = CONST_VINT128_DW ( 0x3ffe000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 1 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x00007fffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.0p-111Q; + xui = CONST_VINT128_DW ( 0x3f90000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 2 fail\n"); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0, 1); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.5Q; + xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x00017fffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3ffe800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x0000bfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.999999Q; + xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 2 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffd); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3ffeffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0x0000ffffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f8fffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 3 fail\n"); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0, 1); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f8effffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0, 1); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f87ffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW (0, 1); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 3 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + // x = 1.5Q; + xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); -#if 1 - x = const_xfer_vui64t_2_bin128 ( vf128_max ); - y = const_xfer_vui64t_2_bin128 ( vf128_max ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 4 fail\n"); + t = test_xsmulqpo (x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + // x = 2.0Q; + xui = CONST_VINT128_DW ( 0x4000000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + e = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + return (rc); +} + +int +test_mul_qpo_xtra (void) +{ + __binary128 x, y; + __binary128 t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + // PowerISA 3.1 Table 84 Actions for xsmulqp[o] + // Line -infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 4 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 5 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 5 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); -#if 1 - x = const_xfer_vui64t_2_bin128 ( vf128_nmax ); - y = const_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 6 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + // Line -NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 6 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 7 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // P8 should detect these because absolute magnitudes are different - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 7 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 8 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // Don't expect to detect this case for P8 but should on P9 - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 8 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + // Line -zero + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 8 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 9 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); -#if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) - // P8 should detect these because absolute magnitudes are different - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 9 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 9 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } -#endif + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 10 fail\n"); -#ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - // P8 should detect these because absolute magnitudes are different - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 10 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 10 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); -#endif - } + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + // Line +zero + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 11 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - // P8 should detect these because absolute magnitudes are different - if (vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 11 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - if (vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 11 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -#if 1 - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - if (!vec_cmpqp_all_ne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_ne 12 fail\n"); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); - // P8 should detect these because absolute magnitudes are different - if (!vec_cmpqp_all_uzne (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_uzne 12 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + // Line +NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - if (!vec_cmpqp_all_tone (x, y)) - { - rc += 1; - printf ("vec_cmpqp_all_tone 12 fail\n"); #ifdef __DEBUG_PRINT__ - print_vfloat128x ("vec_cmpqp_all_ne( ", x); - print_vfloat128x (" ,", y); - printf (" )= %d", - vec_cmpqp_all_ne (x, y)); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - } + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - return (rc); -} + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -#define __DOUBLE_ZERO (0x0000000000000000UL) -#define __DOUBLE_NZERO (0x8000000000000000UL) -#define __DOUBLE_ONE (0x3ff0000000000000UL) -#define __DOUBLE_NONE (0xbff0000000000000UL) -#define __DOUBLE_MAX (0x7fefffffffffffffUL) -#define __DOUBLE_NMAX (0xffefffffffffffffUL) -#define __DOUBLE_MIN (0x0010000000000000UL) -#define __DOUBLE_NMIN (0x8010000000000000UL) -#define __DOUBLE_SUB (0x0000000000000001UL) -#define __DOUBLE_NSUB (0x8000000000000001UL) -#define __DOUBLE_INF (0x7ff0000000000000UL) -#define __DOUBLE_NINF (0xfff0000000000000UL) -#define __DOUBLE_NAN (0x7ff8000000000000UL) -#define __DOUBLE_NNAN (0xfff8000000000000UL) -#define __DOUBLE_SNAN (0x7ff0000000000001UL) -#define __DOUBLE_NSNAN (0xfff0000000000001UL) -#define __DOUBLE_TRUE (0xffffffffffffffffUL) -#define __DOUBLE_NTRUE (0x0000000000000000UL) -#define __DOUBLE_HIDDEN (0x0010000000000000UL) + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); -//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ -#define test_xscvdpqp(_i) db_vec_xscvdpqp(_i) -#else -#define test_xscvdpqp(_i) vec_xscvdpqp(_i) + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -int -test_convert_dpqp (void) -{ - vf64_t x; - __binary128 t, e; - vui64_t eui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_ZERO, 0 ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_zero); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NZERO, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_nzero); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_ONE, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_one); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NONE, 0 ); + // Line +infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_none); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_MAX, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_MAX as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0x43feffffffffffff, 0xf000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NMAX, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_NMAX as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0xc3feffffffffffff, 0xf000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_MIN, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_MIN as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0x3c01000000000000,0); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NMIN, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_NMIN as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0xbc01000000000000,0); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_SUB, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_MAX as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0x3bcd000000000000,0); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NSUB, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - // __DOUBLE_MAX as QUAD-Precision - eui = (vui64_t) CONST_VINT64_DW ( 0xbbcd000000000000,0); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_INF, 0 ); + // Line QNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_inf); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NINF, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_ninf); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NAN, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_nan); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vf64_t) (vui64_t) CONST_VINT64_DW ( __DOUBLE_NNAN, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ - print_v2f64x (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvdpqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_nnan); - rc += check_f128 ("check vec_xscvdpqp", e, t, e); - - return (rc); -} + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); -//#define __DEBUG_PRINT__ 1 + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); -int -test_convert_udqp (void) -{ - vui64_t x; - __binary128 t, e; - vui64_t eui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vui64_t) CONST_VINT64_DW ( 0, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvudqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_zero); - rc += check_f128 ("check vec_xscvudqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vui64_t) CONST_VINT64_DW ( 1, 2 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvudqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_one); - rc += check_f128 ("check vec_xscvudqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vui64_t) CONST_VINT64_DW ( 0x7fffffffffffffff, 3 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvudqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvudqp", e, t, e); + t = test_xsmulqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vui64_t) CONST_VINT64_DW ( 0x8000000000000000, 4 ); + // Line SNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvudqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvudqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vui64_t) CONST_VINT64_DW ( 0xffffffffffffffff, 5 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvudqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403effffffffffff, 0xfffe000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvudqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - return (rc); -} + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); -int -test_convert_sdqp (void) -{ - vi64_t x; - __binary128 t, e; - vui64_t eui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vi64_t) CONST_VINT64_DW ( 0, 0 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", (vui64_t) x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsdqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_zero); - rc += check_f128 ("check vec_xscvsdqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vi64_t) CONST_VINT64_DW ( 1, 2 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", (vui64_t) x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsdqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_one); - rc += check_f128 ("check vec_xscvsdqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vi64_t) CONST_VINT64_DW ( 0x7fffffffffffffff, 3 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", (vui64_t) x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsdqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsdqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vi64_t) CONST_VINT64_DW ( 0x8000000000000000, 4 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", (vui64_t) x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsdqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0xc03e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsdqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); - x = (vi64_t) CONST_VINT64_DW ( 0xffffffffffffffff, 5 ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", (vui64_t) x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsdqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_none); - rc += check_f128 ("check vec_xscvsdqp", e, t, e); + t = test_xsmulqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpo", e, t, e); return (rc); } +#undef __DEBUG_PRINT__ +//#define __DEBUG_PRINT__ 1 +#ifdef __DEBUG_PRINT__ +#define test_xsmulqpn(_l,_k) db_vec_xsmulqpn(_l,_k) +#else +extern __binary128 test_vec_mulqpn (__binary128 vfa, __binary128 vfb); +#define test_xsmulqpn(_l,_k) test_vec_mulqpn(_l,_k) +#endif + int -test_convert_uqqp (void) +test_mul_qpn (void) { - vui128_t x; + __binary128 x, y; __binary128 t, e; - vui64_t eui; + vui64_t xui; int rc = 0; printf ("\n%s\n", __FUNCTION__); - x = (vui128_t) CONST_VINT128_DW ( 0, 0 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_zero); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_one); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0, 0x7fffffffffffffff ); + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0, 0x8000000000000000 ); +// x = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); +// y = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); - x = (vui128_t) CONST_VINT128_DW ( 0x8000000000000000, 0 ); +// e = 9.0Q; + xui = CONST_VINT128_DW ( 0x4002200000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); -#ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); -#endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + // x = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); + #ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); + #endif + t = test_xsmulqpn (x, y); + + // e = 9.0Q; + xui = CONST_VINT128_DW ( 0x4002200000000000, 1 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); + + // x = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 3.0Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); + + #ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); + #endif + t = test_xsmulqpn (x, y); + + // e = 9.0Q; + xui = CONST_VINT128_DW ( 0x4002200000000000, 2 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); + + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407f000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - // Test various Even/odd and GRX combinations. - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff0000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0, 1 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff4000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_two ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff5000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_two ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0, 2 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff6000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // x = 1.999999Q; + xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0, 2 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff8000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p+64; + xui = CONST_VINT128_DW ( 0x403f000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 1, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff9000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // x = 1.9999999+64Q; + xui = CONST_VINT128_DW ( 0x403effffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 1, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffa000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p+111; + xui = CONST_VINT128_DW ( 0x406e000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x0000800000000000 , 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffc000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // x = 1.9999999+110Q; + xui = CONST_VINT128_DW ( 0x406dffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407f000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x0000800000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff4000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p+112; + xui = CONST_VINT128_DW ( 0x406f000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x1000000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff6000 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // x = 1.9999999+111Q; + xui = CONST_VINT128_DW ( 0x406effffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvuqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407effffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvuqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x0001000000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - return (rc); -} + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p+128; + xui = CONST_VINT128_DW ( 0x407f000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); -int -test_convert_sqqp (void) -{ - vi128_t x; - __binary128 t, e; - vui64_t eui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x11000000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0, 0 ); + // x = 1.0p-16494Q; + xui = CONST_VINT128_DW ( 0, 1 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // x = 1.9999999+127Q; + xui = CONST_VINT128_DW ( 0x407effffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_zero); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x0010ffffffffffff, 0xffffffffffffffff ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0, 1 ); + // x = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_one); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000400000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0, 0x7fffffffffffffff ); + // x = 1.0p-8191Q; + xui = CONST_VINT128_DW ( 0x2000000000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.0p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403dffffffffffff, 0xfffc000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0, 0x8000000000000000 ); + // x = 1.5p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.5p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x403e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000900000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x8000000000000000, 0 ); + // x = 1.8p-8191Q; + xui = CONST_VINT128_DW ( 0x2000800000000000, 0 ); + x = vec_xfer_vui64t_2_bin128 ( xui ); + // y = 1.8p-8192Q; + xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0xc07e000000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0001200000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.5Q; + xui = CONST_VINT128_DW ( 0x3ffe000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - e = vec_xfer_vui64t_2_bin128 (vf128_none); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - // Test various Even/odd and GRX combinations. - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffff8000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.0p-111Q; + xui = CONST_VINT128_DW ( 0x3f90000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0, 2); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffa000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.5Q; + xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x00017fffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffb800 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.5Q; + xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x00027fffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffb000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3ffe800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000bfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffc000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 1.999999Q; + xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffd); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffffa000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3ffeffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0x0000ffffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = (vi128_t) CONST_VINT128_DW ( 0x7fffffffffffffff, 0xffffffffffff6000 ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f8fffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ - print_v2xint64 (" x=", x); + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvsqqp (x); - eui = (vui64_t) CONST_VINT64_DW ( 0x407dffffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 (eui); - rc += check_f128 ("check vec_xscvsqqp", e, t, e); - - return (rc); -} - -//#define __DEBUG_PRINT__ 1 -int -test_convert_qpuqz (void) -{ - __binary128 x; - vui128_t t, e; - vui64_t xui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0, 2); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f8effffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0, 1); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_min ); + x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + // x = 0.75Q; + xui = CONST_VINT128_DW ( 0x3f87ffffffffffff, 0xffffffffffffffff ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW (0, 0); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nmin ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128 ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + // x = 1.5Q; + xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 1 ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407e000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + // x = 2.0Q; + xui = CONST_VINT128_DW ( 0x4000000000000000, 0 ); + y = vec_xfer_vui64t_2_bin128 ( xui ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0x8000000000000000, 0); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // e = vec_xfer_vui64t_2_bin128 ( vf128_max ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407effffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffff8000 ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + // e = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + return (rc); +} + +int +test_mul_qpn_xtra (void) +{ + __binary128 x, y; + __binary128 t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + // PowerISA 3.1 Table 84 Actions for xsmulqp[o] + // Line -infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0x0, 0x8000000000000000); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x403effffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0x0, 0xffffffffffffffff ); - - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407f000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407fffffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0xffffffffffffffff ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpuqz (x); - e = (vui128_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpuqz", (vui128_t) t, (vui128_t) e); - - return (rc); -} - -//#define __DEBUG_PRINT__ 1 -int -test_convert_qpudz (void) -{ - __binary128 x; - vui64_t t, e; - vui64_t xui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_min ); + // Line -NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nmin ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 1, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0x8000000000000000, 0); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407effffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x403e000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0x8000000000000000, 0); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x403effffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0); - - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407f000000000000, 0); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = (vui64_t) CONST_VINT64_DW(0x407fffffffffffff, 0xffffffffffffffff); - x = vec_xfer_vui64t_2_bin128 ( xui ); + // Line -zero + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0xffffffffffffffff, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = vec_xscvqpudz (x); - e = (vui64_t) CONST_VINT128_DW ( 0, 0 ); - rc += check_vuint128x ("check vec_xscvqpudz", (vui128_t) t, (vui128_t) e); - - return (rc); -} + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); -//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ -#define test_xscvqpdpo(_l) db_vec_xscvqpdpo(_l) -#else -#define test_xscvqpdpo(_l) vec_xscvqpdpo(_l) + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif -int -test_convert_qpdpo (void) -{ - __binary128 x; - vf64_t t, e; - vui64_t xui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_ZERO, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NZERO, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3c01000000000000, 0x0000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x0010000000000000, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3c00000000000000, 0x0000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + // Line +zero + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x0008000000000000, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3bcd000000000000, 0x0000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x0000000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3bcc000000000000, 0x0000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x0000000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x1000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x0800000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x1800000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x3fff000000000000, 0x0000000000000001 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 0x3ff0000000000001, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 1, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - // Smallest QP denormal - xui = CONST_VINT128_DW ( 0x0000000000000000, 0x0000000000000001 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + // Line +NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( 1, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_ONE, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NONE, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x43feffffffffffff, 0xf000000000000000 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - xui = CONST_VINT128_DW ( 0x43ff000000000000, 0x0000000000000001 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_MAX, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_INF, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NINF, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + // Line +infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - e = (vf64_t) CONST_VINT128_DW ( __DOUBLE_NAN, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif - t = test_xscvqpdpo (x); - // Signaling converted to Quite - e = (vf64_t) CONST_VINT128_DW ( 0x7ffc000000000000, 0 ); - rc += check_vuint128x ("check vec_xscvqpdpo", (vui128_t) t, (vui128_t) e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - return (rc); -} + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); -//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ -#define test_xsmulqpo(_l,_k) db_vec_xsmulqpo(_l,_k) -#else -extern __binary128 test_vec_mulqpo (__binary128 vfa, __binary128 vfb); -extern __binary128 test_vec_xsmulqpo (__binary128 vfa, __binary128 vfb); -//#define test_xsmulqpo(_l,_k) test_vec_xsmulqpo(_l,_k) -#define test_xsmulqpo(_l,_k) test_vec_mulqpo(_l,_k) + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); -int -test_mul_qpo (void) -{ - __binary128 x, y; - __binary128 t, e; - vui64_t xui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); - - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); -// x = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); -// y = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - -// e = 9.0Q; - xui = CONST_VINT128_DW ( 0x4002200000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); - - // x = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); - #endif - t = test_xsmulqpo (x, y); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); - // e = 9.0Q; - xui = CONST_VINT128_DW ( 0x4002200000000000, 1 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // Line QNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); - // x = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x0000400000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - // x = 1.0p-8191Q; - xui = CONST_VINT128_DW ( 0x2000000000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.5Q; - xui = CONST_VINT128_DW ( 0x3ffe000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x00007fffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.0p-111Q; - xui = CONST_VINT128_DW ( 0x3f90000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0, 1); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.5Q; - xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x00017fffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3ffe800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x0000bfffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.999999Q; - xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffd); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3ffeffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // Line SNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0x0000ffffffffffff, 0xffffffffffffffff); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f8fffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0, 1); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f8effffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0, 1); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f87ffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW (0, 1); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - // x = 1.5Q; - xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - // e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - // x = 2.0Q; - xui = CONST_VINT128_DW ( 0x4000000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - // e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - e = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsmulqpn (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsmulqpn", e, t, e); return (rc); } +//#define __DEBUG_PRINT__ 1 +#ifdef __DEBUG_PRINT__ +#define test_xsaddqpo(_l,_k) db_vec_xsaddqpo(_l,_k) +#else +extern __binary128 test_vec_addqpo (__binary128 vfa, __binary128 vfb); +extern __binary128 test_vec_xsaddqpo (__binary128 vfa, __binary128 vfb); +#define test_xsaddqpo(_l,_k) test_vec_xsaddqpo(_l,_k) +//#define test_xsaddqpo(_l,_k) test_vec_addqpo(_l,_k) +#endif + int -test_mul_qpo_xtra (void) +test_add_qpo (void) { __binary128 x, y; __binary128 t, e; @@ -12763,350 +15401,519 @@ test_mul_qpo_xtra (void) int rc = 0; printf ("\n%s\n", __FUNCTION__); - // PowerISA 3.1 Table 84 Actions for xsmulqp[o] - // Line -infinity - x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + x = vec_xfer_vui64t_2_bin128 (vf128_one); + y = vec_xfer_vui64t_2_bin128 (vf128_ntwo); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_none); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + x = vec_xfer_vui64t_2_bin128 (vf128_zero); + y = vec_xfer_vui64t_2_bin128 (vf128_zero); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + x = vec_xfer_vui64t_2_bin128 (vf128_zero); + y = vec_xfer_vui64t_2_bin128 (vf128_one); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + x = vec_xfer_vui64t_2_bin128 (vf128_one); + y = vec_xfer_vui64t_2_bin128 (vf128_one); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_two); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // x = 1.0Q; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = 0.125Q; + xui = CONST_VINT128_DW(0x3ffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); - - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + t = test_xsaddqpo(x, y); -#ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); -#endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + // e = 1.175Q; + xui = CONST_VINT128_DW(0x3fff200000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + // x = 1.0Q; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -0.125Q; + xui = CONST_VINT128_DW(0xbffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + // e = 0.875Q; + xui = CONST_VINT128_DW(0x3ffec00000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + xui = CONST_VINT128_DW(0x3fff000000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -0.125Q; + xui = CONST_VINT128_DW(0xbffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - // Line -NZF - x = vec_xfer_vui64t_2_bin128 ( vf128_none ); - y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + // e = 0.875Q; + xui = CONST_VINT128_DW(0x3ffebfffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + +// x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); +// y = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); +// e = 6.0Q; + xui = CONST_VINT128_DW(0x4001800000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + y = vec_xfer_vui64t_2_bin128 (vf128_none); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + // e = 6.0Q; + xui = CONST_VINT128_DW(0x4000000000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = +1.c000000000000000000000000000p-16381Q; + xui = CONST_VINT128_DW(0x0002400000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.8000000000000000000000000000p-16381Q + xui = CONST_VINT128_DW(0x8002000000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + // e = 0.8000000000000000000000000000p-16382Q; + xui = CONST_VINT128_DW(0x0000800000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = +1.c000000000000000000000000000p-16380Q; + xui = CONST_VINT128_DW(0x0003400000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.8000000000000000000000000000p-16380Q + xui = CONST_VINT128_DW(0x8003000000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // e = 1.000000000000000000000000000p-16381Q; + xui = CONST_VINT128_DW(0x0001000000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = +1.c000000000000000000000000000p-16382Q; + xui = CONST_VINT128_DW(0x0001c00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.8000000000000000000000000000p-16382Q + xui = CONST_VINT128_DW(0x8001800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_none ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // e = 0.4000000000000000000000000000p-16382Q; + xui = CONST_VINT128_DW(0x0000400000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = +1.c000000000000000000000000000p-16381Q; + xui = CONST_VINT128_DW(0x0002c00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.8000000000000000000000000000p-16381Q + xui = CONST_VINT128_DW(0x8002800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + // e = 0.8000000000000000000000000000p-16382Q; + xui = CONST_VINT128_DW(0x0000800000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + y = vec_xfer_vui64t_2_bin128 (vf128_ntwo); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + // e = 1.0Q; + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-113Q; + xui = CONST_VINT128_DW(0x3f8e800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - // Line -zero - x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-113Q; + xui = CONST_VINT128_DW(0xbf8e800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-115Q; + xui = CONST_VINT128_DW(0x3f8c800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-115Q; + xui = CONST_VINT128_DW(0xbf8c800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-117Q; + xui = CONST_VINT128_DW(0x3f8a800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-117Q; + xui = CONST_VINT128_DW(0xbf8a800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + y = vec_xfer_vui64t_2_bin128 (vf128_sub); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + xui = CONST_VINT128_DW(0x0001ffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + y = vec_xfer_vui64t_2_bin128 (vf128_nsub); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + // y = 1.0p-16382Q; + xui = CONST_VINT128_DW(0, 1); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = 1.0pp-16382Q; + xui = CONST_VINT128_DW(0, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + xui = CONST_VINT128_DW(0x0, 2); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // Line +zero - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + // x = 0.ffffffp-16382QQ; + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + // y = 0.0000001p-16382Q; + xui = CONST_VINT128_DW(0, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_none ); + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x0001000000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 0.ffffffp-16382QQ; + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + // y = -0.0000001p-16382Q; + xui = CONST_VINT128_DW(0x8000000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + // e = 0.fffff...eQ; + xui = CONST_VINT128_DW(0x0000ffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.875Q; + xui = CONST_VINT128_DW(0x3fffe00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = 1.0p-3Q; + xui = CONST_VINT128_DW(0x3ffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + // e = 2.0000Q odd; + xui = CONST_VINT128_DW(0x4000000000000000, 0x0000000000000001); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.875Q; + xui = CONST_VINT128_DW(0x3fffe00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.0p-3Q; + xui = CONST_VINT128_DW(0xbffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3fffbfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -1.0p-3Q; + xui = CONST_VINT128_DW(0xbffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3ffebfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + // x = 1.9999Q; + xui = CONST_VINT128_DW(0x3fffffffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.9998Q; + xui = CONST_VINT128_DW(0xbfffffffffffffff, 0xfffffffffffffffe); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); - y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3f8f000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_max); + y = vec_xfer_vui64t_2_bin128 (vf128_max); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + e = vec_xfer_vui64t_2_bin128 (vf128_max); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + x = vec_xfer_vui64t_2_bin128 (vf128_nmax); + y = vec_xfer_vui64t_2_bin128 (vf128_nmax); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo(x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + e = vec_xfer_vui64t_2_bin128 (vf128_nmax); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // Line +NZF - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + return (rc); +} + +int +test_add_qpo_xtra (void) +{ + __binary128 x, y; + __binary128 t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + // PowerISA 3.1 Table 65 Actions for xsaddqp[o] + // Line -infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -13114,9 +15921,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_none ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -13124,9 +15931,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -13134,9 +15941,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -13144,9 +15951,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -13154,9 +15961,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -13164,9 +15971,10 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + e = y; + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -13174,22 +15982,22 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // Line +infinity - x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + // Line -NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_none ); y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -13197,9 +16005,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ntwo ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -13207,9 +16015,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -13217,9 +16025,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -13227,9 +16035,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -13237,9 +16045,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -13247,9 +16055,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -13257,22 +16065,22 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // Line QNaN - x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + // Line -zero + x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -13280,9 +16088,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -13290,9 +16098,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -13300,9 +16108,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -13310,9 +16118,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -13320,9 +16128,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -13330,9 +16138,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -13340,22 +16148,22 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // Line SNaN - x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + // Line +zero + x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -13363,10 +16171,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -13374,21 +16181,19 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); -#endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + print_vfloat128x(" y= ", y); +#endif + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -13396,10 +16201,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -13407,10 +16211,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -13418,10 +16221,9 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); - xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -13429,574 +16231,738 @@ test_mul_qpo_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpo (x, y); + t = test_xsaddqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpo", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - return (rc); -} + // Line +NZF + x = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); -#undef __DEBUG_PRINT__ -//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ -#define test_xsmulqpn(_l,_k) db_vec_xsmulqpn(_l,_k) -#else -extern __binary128 test_vec_mulqpn (__binary128 vfa, __binary128 vfb); -#define test_xsmulqpn(_l,_k) test_vec_mulqpn(_l,_k) + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); #endif + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); -int -test_mul_qpn (void) -{ - __binary128 x, y; - __binary128 t, e; - vui64_t xui; - int rc = 0; - printf ("\n%s\n", __FUNCTION__); - - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_one ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xsaddqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); -// x = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); -// y = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_two ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); -// e = 9.0Q; - xui = CONST_VINT128_DW ( 0x4002200000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - // x = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); - #endif - t = test_xsmulqpn (x, y); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - // e = 9.0Q; - xui = CONST_VINT128_DW ( 0x4002200000000000, 1 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 3.0Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 1 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); - #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); - #endif - t = test_xsmulqpn (x, y); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); + e = vec_xfer_vui64t_2_bin128 ( xui ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // e = 9.0Q; - xui = CONST_VINT128_DW ( 0x4002200000000000, 2 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + // Line +infinity + x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); +#ifdef __DEBUG_PRINT__ + print_vfloat128x(" x= ", x); + print_vfloat128x(" y= ", y); +#endif + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); + + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0, 1 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - y = vec_xfer_vui64t_2_bin128 ( vf128_two ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffe); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - y = vec_xfer_vui64t_2_bin128 ( vf128_two ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0, 2 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // x = 1.999999Q; - xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0, 2 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p+64; - xui = CONST_VINT128_DW ( 0x403f000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 1, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // x = 1.9999999+64Q; - xui = CONST_VINT128_DW ( 0x403effffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 1, 0 ); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p+111; - xui = CONST_VINT128_DW ( 0x406e000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // Line QNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x0000800000000000 , 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // x = 1.9999999+110Q; - xui = CONST_VINT128_DW ( 0x406dffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x0000800000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p+112; - xui = CONST_VINT128_DW ( 0x406f000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x1000000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // x = 1.9999999+111Q; - xui = CONST_VINT128_DW ( 0x406effffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x0001000000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p+128; - xui = CONST_VINT128_DW ( 0x407f000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x11000000000000, 0 ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-16494Q; - xui = CONST_VINT128_DW ( 0, 1 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // x = 1.9999999+127Q; - xui = CONST_VINT128_DW ( 0x407effffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW ( 0x0010ffffffffffff, 0xffffffffffffffff ); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000400000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.0p-8191Q; - xui = CONST_VINT128_DW ( 0x2000000000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.0p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xsaddqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.5p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.5p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // Line SNaN + x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); + y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000900000000000, 0x0000000000000000); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - // x = 1.8p-8191Q; - xui = CONST_VINT128_DW ( 0x2000800000000000, 0 ); - x = vec_xfer_vui64t_2_bin128 ( xui ); - // y = 1.8p-8192Q; - xui = CONST_VINT128_DW ( 0x1fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_none ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0001200000000000, 0x0000000000000000); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.5Q; - xui = CONST_VINT128_DW ( 0x3ffe000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000800000000000, 0x0000000000000000); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.0p-111Q; - xui = CONST_VINT128_DW ( 0x3f90000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0, 2); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.5Q; - xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_one ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x00017fffffffffff, 0xfffffffffffffffe); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.5Q; - xui = CONST_VINT128_DW ( 0x4000800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x00027fffffffffff, 0xfffffffffffffffe); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3ffe800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000bfffffffffff, 0xffffffffffffffff); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 1.999999Q; - xui = CONST_VINT128_DW ( 0x3fffffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); #ifdef __DEBUG_PRINT__ print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0001ffffffffffff, 0xfffffffffffffffd); + t = test_xsaddqpo (x, y); + xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xsaddqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3ffeffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + return (rc); +} +//#define __DEBUG_PRINT__ 1 #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); +#define test_xssubqpo(_l,_k) db_vec_xssubqpo(_l,_k) +#else +extern __binary128 test_vec_subqpo (__binary128 vfa, __binary128 vfb); +extern __binary128 test_vec_xssubqpo (__binary128 vfa, __binary128 vfb); +#define test_xssubqpo(_l,_k) test_vec_xssubqpo(_l,_k) +//#define test_xssubqpo(_l,_k) test_vec_subqpo(_l,_k) #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0x0000ffffffffffff, 0xffffffffffffffff); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f8fffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); +int +test_sub_qpo (void) +{ + __binary128 x, y; + __binary128 t, e; + vui64_t xui; + int rc = 0; + printf ("\n%s\n", __FUNCTION__); + + x = vec_xfer_vui64t_2_bin128 (vf128_one); + y = vec_xfer_vui64t_2_bin128 (vf128_two); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0, 2); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_none); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_zero); + y = vec_xfer_vui64t_2_bin128 (vf128_nzero); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_zero); + y = vec_xfer_vui64t_2_bin128 (vf128_none); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_one); + y = vec_xfer_vui64t_2_bin128 (vf128_none); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_two); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + +// x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); +// y = 3.0Q; + xui = CONST_VINT128_DW(0xc000800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + +// e = 6.0Q; + xui = CONST_VINT128_DW(0x4001800000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + y = vec_xfer_vui64t_2_bin128 (vf128_one); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 2.0Q; + e = vec_xfer_vui64t_2_bin128 (vf128_two); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 3.0Q; + xui = CONST_VINT128_DW(0x4000800000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + y = vec_xfer_vui64t_2_bin128 (vf128_two); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.0Q; + e = vec_xfer_vui64t_2_bin128 (vf128_one); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-113Q; + xui = CONST_VINT128_DW(0xbf8e800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-113Q; + xui = CONST_VINT128_DW(0x3f8e800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-115Q; + xui = CONST_VINT128_DW(0xbf8c800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-115Q; + xui = CONST_VINT128_DW(0x3f8c800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = 3.0p-117Q; + xui = CONST_VINT128_DW(0xbf8a800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.0Q odd; + xui = CONST_VINT128_DW(0x3fff000000000000, 1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -3.0p-117Q; + xui = CONST_VINT128_DW(0x3f8a800000000000, 0); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x3ffeffffffffffff, -1); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + y = vec_xfer_vui64t_2_bin128 (vf128_nsub); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + xui = CONST_VINT128_DW(0x0001ffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + y = vec_xfer_vui64t_2_bin128 (vf128_sub); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + e = vec_xfer_vui64t_2_bin128 (vf128_zero); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // y = 1.0p-16382Q; + xui = CONST_VINT128_DW(0, 1); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = 1.0pp-16382Q; + xui = CONST_VINT128_DW(0x8000000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + xui = CONST_VINT128_DW(0x0, 2); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 0.ffffffp-16382QQ; + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + // y = 0.0000001p-16382Q; + xui = CONST_VINT128_DW(0x8000000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); + + // e = 1.fffffQ odd; + xui = CONST_VINT128_DW(0x0001000000000000, 0); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 0.ffffffp-16382QQ; + x = vec_xfer_vui64t_2_bin128 (vf128_sub); + // y = -0.0000001p-16382Q; + xui = CONST_VINT128_DW(0x0000000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); + +#ifdef __DEBUG_PRINT__ + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); +#endif + t = test_xssubqpo(x, y); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f8effffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // e = 0.fffff...eQ; + xui = CONST_VINT128_DW(0x0000ffffffffffff, 0xfffffffffffffffe); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.875Q; + xui = CONST_VINT128_DW(0x3fffe00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = 1.0p-3Q; + xui = CONST_VINT128_DW(0xbffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0, 1); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); - x = vec_xfer_vui64t_2_bin128 ( vf128_sub ); - // x = 0.75Q; - xui = CONST_VINT128_DW ( 0x3f87ffffffffffff, 0xffffffffffffffff ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // e = 2.0000Q odd; + xui = CONST_VINT128_DW(0x4000000000000000, 0x0000000000000001); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.875Q; + xui = CONST_VINT128_DW(0x3fffe00000000000, 0); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.0p-3Q; + xui = CONST_VINT128_DW(0x3ffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - xui = CONST_VINT128_DW (0, 0); - e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_one ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3fffbfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.0Q; + x = vec_xfer_vui64t_2_bin128 (vf128_one); + // y = -1.0p-3Q; + xui = CONST_VINT128_DW(0x3ffc000000000000, 1); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - // x = 1.5Q; - xui = CONST_VINT128_DW ( 0x3fff800000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3ffebfffffffffff, 0xffffffffffffffff); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + // x = 1.9999Q; + xui = CONST_VINT128_DW(0x3fffffffffffffff, 0xffffffffffffffff); + x = vec_xfer_vui64t_2_bin128 (xui); + // y = -1.9998Q; + xui = CONST_VINT128_DW(0x3fffffffffffffff, 0xfffffffffffffffe); + y = vec_xfer_vui64t_2_bin128 (xui); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - // e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - // x = 2.0Q; - xui = CONST_VINT128_DW ( 0x4000000000000000, 0 ); - y = vec_xfer_vui64t_2_bin128 ( xui ); + // e = 1.7421875....Q odd; + xui = CONST_VINT128_DW(0x3f8f000000000000, 0x0000000000000000); + e = vec_xfer_vui64t_2_bin128 (xui); + rc += check_f128 ("check vec_xssubqpo", e, t, e); + + x = vec_xfer_vui64t_2_bin128 (vf128_max); + y = vec_xfer_vui64t_2_bin128 (vf128_nmax); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - // e = vec_xfer_vui64t_2_bin128 ( vf128_max ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + e = vec_xfer_vui64t_2_bin128 (vf128_max); + rc += check_f128 ("check vec_xssubqpo", e, t, e); - x = vec_xfer_vui64t_2_bin128 ( vf128_max ); - y = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); + x = vec_xfer_vui64t_2_bin128 (vf128_nmax); + y = vec_xfer_vui64t_2_bin128 (vf128_max); #ifdef __DEBUG_PRINT__ - print_vfloat128x(" x= ", x); - print_vfloat128x(" y= ", y); + print_vfloat128x (" x= ", x); + print_vfloat128x (" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - // e = vec_xfer_vui64t_2_bin128 ( vf128_nmax ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo(x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + e = vec_xfer_vui64t_2_bin128 (vf128_nmax); + rc += check_f128 ("check vec_xssubqpo", e, t, e); return (rc); } int -test_mul_qpn_xtra (void) +test_sub_qpo_xtra (void) { __binary128 x, y; __binary128 t, e; @@ -14004,7 +16970,7 @@ test_mul_qpn_xtra (void) int rc = 0; printf ("\n%s\n", __FUNCTION__); - // PowerISA 3.1 Table 84 Actions for xsmulqp[o] + // PowerISA 3.1 Table 65 Actions for xssubqp[o] // Line -infinity x = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); y = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); @@ -14013,9 +16979,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14023,9 +16989,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14033,9 +16999,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14043,9 +17009,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14053,9 +17019,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14063,9 +17029,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14073,9 +17039,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + // e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + e = y; + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14083,10 +17050,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line -NZF x = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14096,9 +17063,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14106,9 +17073,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14116,9 +17083,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14126,9 +17093,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14136,9 +17103,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_none ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ntwo ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14146,9 +17113,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14156,9 +17123,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14166,10 +17133,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line -zero x = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14179,9 +17146,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14189,9 +17156,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14199,9 +17166,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14209,9 +17176,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14219,9 +17186,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14229,9 +17196,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14239,9 +17206,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14249,10 +17216,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line +zero x = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14262,9 +17229,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14272,9 +17239,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14282,9 +17249,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14292,9 +17259,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14302,9 +17269,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_none ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14312,9 +17279,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14322,9 +17289,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14332,10 +17299,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line +NZF x = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14345,9 +17312,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14355,9 +17322,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_none ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_two ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14365,9 +17332,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14375,9 +17342,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_one ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14385,9 +17352,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_one ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_zero ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14395,9 +17362,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14405,9 +17372,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14415,10 +17382,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line +infinity x = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14428,9 +17395,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14438,9 +17405,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_ninf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14448,9 +17415,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14458,9 +17425,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14468,9 +17435,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14478,9 +17445,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); - e = vec_xfer_vui64t_2_bin128 ( vf128_inf ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + t = test_xssubqpo (x, y); + e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14488,9 +17455,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14498,10 +17465,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line QNaN x = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14511,9 +17478,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14521,9 +17488,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14531,9 +17498,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14541,9 +17508,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14551,9 +17518,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14561,9 +17528,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14571,9 +17538,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14581,9 +17548,9 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); e = vec_xfer_vui64t_2_bin128 ( vf128_nan ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); // Line SNaN x = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14593,10 +17560,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_none ); @@ -14604,10 +17571,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nzero ); @@ -14615,10 +17582,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_zero ); @@ -14626,10 +17593,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_one ); @@ -14637,10 +17604,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_inf ); @@ -14648,10 +17615,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_nan ); @@ -14659,10 +17626,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); y = vec_xfer_vui64t_2_bin128 ( vf128_snan ); @@ -14670,10 +17637,10 @@ test_mul_qpn_xtra (void) print_vfloat128x(" x= ", x); print_vfloat128x(" y= ", y); #endif - t = test_xsmulqpn (x, y); + t = test_xssubqpo (x, y); xui = CONST_VINT128_DW ( 0x7fffc00000000000, 0 ); e = vec_xfer_vui64t_2_bin128 ( xui ); - rc += check_f128 ("check vec_xsmulqpn", e, t, e); + rc += check_f128 ("check vec_xssubqpo", e, t, e); return (rc); } @@ -14717,5 +17684,11 @@ test_vec_f128 (void) rc += test_mul_qpo_xtra (); rc += test_mul_qpn (); rc += test_mul_qpn_xtra (); + + rc += test_add_qpo (); + rc += test_add_qpo_xtra (); + + rc += test_sub_qpo (); + rc += test_sub_qpo_xtra (); return (rc); } diff --git a/src/testsuite/pveclib_perf.c b/src/testsuite/pveclib_perf.c index e2aa87c..602db19 100644 --- a/src/testsuite/pveclib_perf.c +++ b/src/testsuite/pveclib_perf.c @@ -850,6 +850,62 @@ test_time_f128 (void) printf ("\n%s mulqpn_lib tb delta = %lu, sec = %10.6g\n", __FUNCTION__, t_delta, delta_sec); + printf ("\n%s addqpn_gcc start, ...\n", __FUNCTION__); + t_start = __builtin_ppc_get_timebase (); + for (i = 0; i < TIMING_ITERATIONS; i++) + { + rc += timed_gcc_addqpn_f128 (); + } + t_end = __builtin_ppc_get_timebase (); + t_delta = t_end - t_start; + delta_sec = TimeDeltaSec (t_delta); + + printf ("\n%s addqpn_gcc end", __FUNCTION__); + printf ("\n%s addqpn_gcc tb delta = %lu, sec = %10.6g\n", __FUNCTION__, + t_delta, delta_sec); + + printf ("\n%s addqpo_lib start, ...\n", __FUNCTION__); + t_start = __builtin_ppc_get_timebase (); + for (i = 0; i < TIMING_ITERATIONS; i++) + { + rc += timed_lib_addqpo_f128 (); + } + t_end = __builtin_ppc_get_timebase (); + t_delta = t_end - t_start; + delta_sec = TimeDeltaSec (t_delta); + + printf ("\n%s addqpo_lib end", __FUNCTION__); + printf ("\n%s addqpo_lib tb delta = %lu, sec = %10.6g\n", __FUNCTION__, + t_delta, delta_sec); + + printf ("\n%s subqpn_gcc start, ...\n", __FUNCTION__); + t_start = __builtin_ppc_get_timebase (); + for (i = 0; i < TIMING_ITERATIONS; i++) + { + rc += timed_gcc_subqpn_f128 (); + } + t_end = __builtin_ppc_get_timebase (); + t_delta = t_end - t_start; + delta_sec = TimeDeltaSec (t_delta); + + printf ("\n%s subqpn_gcc end", __FUNCTION__); + printf ("\n%s subqpn_gcc tb delta = %lu, sec = %10.6g\n", __FUNCTION__, + t_delta, delta_sec); + + printf ("\n%s subqpo_lib start, ...\n", __FUNCTION__); + t_start = __builtin_ppc_get_timebase (); + for (i = 0; i < TIMING_ITERATIONS; i++) + { + rc += timed_lib_subqpo_f128 (); + } + t_end = __builtin_ppc_get_timebase (); + t_delta = t_end - t_start; + delta_sec = TimeDeltaSec (t_delta); + + printf ("\n%s subqpo_lib end", __FUNCTION__); + printf ("\n%s subqpo_lib tb delta = %lu, sec = %10.6g\n", __FUNCTION__, + t_delta, delta_sec); + return (rc); } #endif diff --git a/src/testsuite/vec_f128_dummy.c b/src/testsuite/vec_f128_dummy.c index 262ca7d..ff2b262 100644 --- a/src/testsuite/vec_f128_dummy.c +++ b/src/testsuite/vec_f128_dummy.c @@ -40,6 +40,1093 @@ //#define __DEBUG_PRINT__ #include +vui64_t +force_eMin (vui64_t x_exp) +{ + vb64_t exp_mask; + const vui64_t exp_dnrm = { 0, 0 }; + const vui64_t exp_min = { 1, 1 }; + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpeq (x_exp, exp_dnrm); + return (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); +} + +vui64_t +force_eMin_V0 (vui64_t x_exp) +{ + vb64_t exp_mask; + const vui64_t exp_dnrm = { 0, 0 }; + const vui64_t exp_min = { 1, 1 }; + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + return vec_sel (x_exp, exp_min, exp_mask); +} + +__binary128 +test_vec_xsaddqpo (__binary128 vfa, __binary128 vfb) +{ + return vec_xsaddqpo (vfa, vfb); +} + +__binary128 +test_vec_xssubqpo (__binary128 vfa, __binary128 vfb) +{ + return vec_xssubqpo (vfa, vfb); +} + +__binary128 +test_genqpo_v0 (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; + vui64_t a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig; + vui32_t q_sign, a_sign, b_sign; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + +// a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); +// b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// q_exp = vec_addudm (a_exp, b_exp); + q_sig = vec_adduqm (a_sig, b_sig); + q_sign = vec_xor (a_sign, b_sign); + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, x_exp); + return result; +} + +__binary128 +test_vec_addqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vui64_t exp_min = (vui64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vb64_t exp_mask; + vui32_t diff_sign; + + q_sign = vec_xor (a_sign, b_sign); + + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); + + // Now swap operands a/b if necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero with different sign + q_sign = vec_sel (a_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_12 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_12); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, (vi64_t) exp_min)) + { + vb64_t exp_mask = vec_cmpgtud (q_exp, c_exp); + + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + q_exp = vec_subudm (q_exp, d_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + } + else + { + // Exponent is less than or equal to E_min + // so return denormal result. + q_exp = q_zero; + } + } + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_MAX__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // return maximum finite exponent and significand + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { +// a_exp = vec_splatd (a_exp, VEC_DW_H); +// b_exp = vec_splatd (b_exp, VEC_DW_H); + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_any_ne ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and opposite sign + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vfb; + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa + vfb; +#endif + return result; +} + +__binary128 +test_vec_addqpo_V1 (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vui64_t exp_min = (vui64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vb64_t exp_mask; + vui32_t diff_sign; + + q_sign = vec_xor (a_sign, b_sign); + + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + // x_exp = (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); + x_exp = (vui64_t) vec_sel (x_exp, exp_min, exp_mask); + + // Now swap operands a/b if necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero with different sign + q_sign = vec_sel (a_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_12 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_12); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, (vi64_t) exp_min)) + { + vb64_t exp_mask = vec_cmpgtud (q_exp, c_exp); + + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + q_exp = vec_subudm (q_exp, d_exp); + q_exp = (vui64_t) vec_sel (q_zero, (vui64_t) q_exp, exp_mask); + } + else + { + // Exponent is less than or equal to E_min + // so return denormal result. + q_exp = q_zero; + } + } + // Round to odd from low order GRX-bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_MAX__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // return maximum finite exponent and significand + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { +// a_exp = vec_splatd (a_exp, VEC_DW_H); +// b_exp = vec_splatd (b_exp, VEC_DW_H); + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_any_ne ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and opposite sign + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vfb; + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa + vfb; +#endif + return result; +} + +__binary128 +test_vec_addqpo_V0 (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_addf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xsaddqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vui32_t diff_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + q_sign = vec_xor (a_sign, b_sign); + diff_sign = (vui32_t) vec_cmpneuq ((vui128_t) a_sign, (vui128_t) b_sign); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + +// if (vec_cmpud_any_eq (x_exp, exp_dnrm)) + { // Involves zeros or denormals + // check for zero significands in add + if (vec_cmpuq_all_eq (a_sig, (vui128_t) q_zero)) + { + if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Return Exact-zero-difference result. + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else + { + // Add to zero, return vfb + return vfb; + } + } + else if (vec_cmpuq_all_eq (b_sig, (vui128_t) q_zero)) + { // Add to zero, return vfa + return vfa; + } + else + { + vb64_t exp_mask; + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel (x_exp, (vui64_t) exp_min, exp_mask); + } + } + + // Now swap a/b is necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp-b_exp) + + // If (b_exp < a_exp) then + // Shift right b_sig by (a_exp - b_exp) + // Collect any shift out of b_sig and or them into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Return Exact-zero-difference result. + return vec_xfer_vui64t_2_bin128 (q_zero); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + if (vec_cmpud_all_le (q_exp, c_exp)) + { + // Intermediate result == tiny, unbiased exponent == -16382 + // Check if sig is denormal range (L-bit is 0). + q_exp = q_zero; + } + else + q_exp = vec_subudm (q_exp, d_exp); + + } + else + { + // Intermediate result == tiny, unbiased exponent == -16382 + // sig is denormal range (L-bit is 0). + q_exp = q_zero; + } + } +#if 0 + // Accumulate x_bits + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); +#endif + // Round to odd from lower product bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_INF__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // Intermediate result is huge, unbiased exponent > 16383 + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { + a_exp = vec_splatd (a_exp, VEC_DW_H); + b_exp = vec_splatd (b_exp, VEC_DW_H); + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpuq_all_ne ((vui128_t) a_sign, (vui128_t) b_sign)) + { // Both operands infinity and opposite sign + // Inifinty + Infinity (opposite sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and same sign + // Or one infinity and one finite + if (vec_cmpud_all_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vfb; + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa + vfb; +#endif + return result; +} + +__binary128 +test_negqp_nan_v0 (__binary128 vfb) +{ + __binary128 result; +#if 1 + result = vec_self128 (vec_negf128 (vfb), vfb, vec_isnanf128(vfb)); +#else + if (vec_all_isnanf128 (vfb)) + result = vfb; + else + result = vec_negf128 (vfb); +#endif + return result; +} + +__binary128 +test_vec_subqpo (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_subf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xssubqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#elif defined (_ARCH_PWR8) + vui64_t q_exp, a_exp, b_exp, x_exp; + vui128_t q_sig, a_sig, b_sig, p_tmp, p_odd; + vui128_t a_mag, b_mag; + vui128_t s_sig, x_bits; + vui32_t q_sign, a_sign, b_sign; + vb128_t a_lt_b; + const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); + const vui64_t q_zero = { 0, 0 }; + const vui64_t q_ones = { -1, -1 }; + const vi64_t exp_min = (vi64_t) CONST_VINT64_DW( 1, 1 ); + const vui64_t exp_dnrm = (vui64_t) CONST_VINT64_DW( 0, 0 ); + const vui64_t q_expnaninf = (vui64_t) CONST_VINT64_DW( 0x7fff, 0x7fff ); + const vui64_t q_expmax = (vui64_t) CONST_VINT64_DW( 0x7ffe, 0x7ffe ); + const vui32_t sigov = CONST_VINT128_W(0x000fffff, -1, -1, -1); + const vui32_t sigovt = CONST_VINT128_W(0x0007ffff, -1, -1, -1); + const vui32_t xbitmask = CONST_VINT128_W(0, 0, 0, 1); + + a_exp = vec_xsxexpqp (vfa); + a_sig = vec_xsxsigqp (vfa); + a_sign = vec_and_bin128_2_vui32t (vfa, signmask); + b_exp = vec_xsxexpqp (vfb); + b_sig = vec_xsxsigqp (vfb); + b_sign = vec_and_bin128_2_vui32t (vfb, signmask); + x_exp = vec_mrgahd ((vui128_t) a_exp, (vui128_t) b_exp); + +// if (vec_all_isfinitef128 (vfa) && vec_all_isfinitef128 (vfb)) +// The above can be optimized to the following + if (__builtin_expect (vec_cmpud_all_lt (x_exp, q_expnaninf), 1)) + { + const vui64_t q_one = { 1, 1 }; + vui128_t add_sig, sub_sig; + vb64_t exp_mask; + vui32_t diff_sign; + + // Negate sign for subtract, then use add logic + b_sign = vec_xor (signmask, b_sign); + q_sign = vec_xor (a_sign, b_sign); + + // Mask off sign bits so can use integers for magnitude compare. + a_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfa, signmask); + b_mag = (vui128_t) vec_andc_bin128_2_vui32t (vfb, signmask); + // Precondition the significands before add so the GRX bits + // are in the least significant 3 bit. + a_sig = vec_slqi (a_sig, 3); + b_sig = vec_slqi (b_sig, 3); + + // If sign(vfa) != sign(vfb) will need to: + // 1) Subtract instead of add significands + // 2) Generate signed zeros + diff_sign = (vui32_t) vec_setb_sq ((vi128_t) q_sign); + // If magnitude(b) > magnitude(a) will need to swap a/b, later + a_lt_b = vec_cmpltuq (a_mag, b_mag); + + // Correct exponent for zeros or denormals to E_min + // will force 0 exponents for zero/denormal results later + exp_mask = vec_cmpequd (x_exp, exp_dnrm); + x_exp = (vui64_t) vec_sel ((vui32_t) x_exp, (vui32_t) exp_min, (vui32_t) exp_mask); + + // Now swap operands a/b if necessary so a has greater magnitude. + { + vui128_t a_tmp = a_sig; + vui128_t b_tmp = b_sig; + vui64_t x_tmp = vec_swapd (x_exp); + + q_sign = vec_sel (a_sign, b_sign, (vui32_t) a_lt_b); + + x_exp = vec_sel (x_exp, x_tmp, (vui64_t) a_lt_b); + a_exp = vec_splatd (x_exp, VEC_DW_H); + b_exp = vec_splatd (x_exp, VEC_DW_L); + q_exp = a_exp; + + a_sig = vec_seluq (a_tmp, b_tmp, (vb128_t) a_lt_b); + b_sig = vec_seluq (b_tmp, a_tmp, (vb128_t) a_lt_b); + } + // At this point we can assume that: + // The magnitude (vfa) >= magnitude (vfb) + // 1) Exponents (a_exp, b_exp) in the range E_min -> E_max + // 2) a_exp >= b_exp + // 2a) If a_exp == b_exp then a_sig >= b_sig + // 2b) If a_exp > b_exp then + // shift (b_sig) right by (a_exp - b_exp) + // any bits shifted out of b_sig are ORed into the X-bit + if (vec_cmpud_all_lt (b_exp, a_exp)) + { + vui64_t d_exp, l_exp; + vui128_t t_sig; + const vui64_t exp_128 = (vui64_t) CONST_VINT64_DW( 128, 128 ); + + d_exp = vec_subudm (a_exp, b_exp); + if (vec_cmpud_all_lt (d_exp, exp_128)) + { + l_exp = vec_subudm (exp_128, d_exp); + t_sig = vec_srq (b_sig, (vui128_t) d_exp); + x_bits = vec_slq (b_sig, (vui128_t) l_exp); + } + else + { + x_bits = b_sig; + t_sig = (vui128_t) q_zero; + } + + p_odd = vec_addcuq (x_bits, (vui128_t) q_ones); + b_sig = (vui128_t) vec_or ((vui32_t) t_sig, (vui32_t) p_odd); + } + + // If operands have the same sign then s_sig = a_sig + b_sig + // Otherwise s_sig = a_sig - b_sig + add_sig = vec_adduqm (a_sig, b_sig); + sub_sig = vec_subuqm (a_sig, b_sig); + s_sig = vec_seluq (add_sig, sub_sig, (vb128_t) diff_sign); + + if (vec_cmpuq_all_eq (s_sig, (vui128_t) q_zero)) + { // Special case of both zero with different sign + q_sign = vec_sel (b_sign, (vui32_t) q_zero, diff_sign); + return vec_xfer_vui32t_2_bin128 (q_sign); + } + else if (vec_cmpuq_all_gt (s_sig, (vui128_t) sigov)) + { // Check for carry and adjust + p_odd = (vui128_t) vec_and ((vui32_t) s_sig, xbitmask); + s_sig = vec_srqi (s_sig, 1); + s_sig = (vui128_t) vec_or ((vui32_t) s_sig, (vui32_t) p_odd); + q_exp = vec_addudm (q_exp, q_one); + } + else if (vec_cmpuq_all_le (s_sig, (vui128_t) sigovt)) + { + // Or the significand is below normal range. + // This can happen with subtraction. + const vui64_t exp_15 = { 12, 12 }; + vui64_t c_exp, d_exp; + vui128_t c_sig; + + c_sig = vec_clzq (s_sig); + c_exp = vec_splatd ((vui64_t) c_sig, VEC_DW_L); + c_exp = vec_subudm (c_exp, exp_15); + d_exp = vec_subudm (q_exp, (vui64_t) exp_min); + d_exp = vec_minud (c_exp, d_exp); + + if (vec_cmpsd_all_gt ((vi64_t) q_exp, exp_min)) + { + s_sig = vec_slq (s_sig, (vui128_t) d_exp); + if (vec_cmpud_all_le (q_exp, c_exp)) + { + // Intermediate result == tiny, unbiased exponent == -16382 + // Check if sig is denormal range (L-bit is 0). + q_exp = q_zero; + } + else + q_exp = vec_subudm (q_exp, d_exp); + + } + else + { + // Intermediate result == tiny, unbiased exponent == -16382 + // sig is denormal range (L-bit is 0). + q_exp = q_zero; + } + } + // Round to odd from lower product bits + p_tmp = vec_slqi (s_sig, 125); + p_odd = vec_addcuq (p_tmp, (vui128_t) q_ones); + q_sig = vec_srqi (s_sig, 3); + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, (vui32_t) p_odd); + + // Check for exponent overflow -> __FLT128_INF__ + if (vec_cmpud_all_gt (q_exp, q_expmax)) + { + // Intermediate result is huge, unbiased exponent > 16383 + q_exp = q_expmax; + q_sig = (vui128_t) sigov; + } + } + else + { // One or both operands are NaN or Infinity + { + // One or both operands are NaN + const vui32_t q_nan = CONST_VINT128_W(0x00008000, 0, 0, 0); + if (vec_all_isnanf128 (vfa)) + { + // vfa is NaN + q_sign = a_sign; + q_sig = (vui128_t) vec_or ((vui32_t) a_sig, q_nan); + q_exp = a_exp; + } + else if (vec_all_isnanf128 (vfb)) + { + // vfb is NaN + q_sign = b_sign; + q_sig = (vui128_t) vec_or ((vui32_t) b_sig, q_nan); + q_exp = b_exp; + } + else // Or one or both operands are Infinity + { + if (vec_cmpud_all_eq (x_exp, q_expnaninf) + && vec_cmpud_all_eq ((vui64_t) a_sign, (vui64_t) b_sign)) + { // Both operands infinity and same sign + // Inifinty - Infinity (same sign) is Default Quiet NaN + return vec_const_nanf128 (); + } + else + { // Either both operands infinity and different sign + // Or one infinity and one finite + if (vec_cmpud_any_eq (a_exp, q_expnaninf)) + { + // return infinity + return vfa; + } + else + { + // return infinity + return vec_negf128(vfb); + } + } + } + } + } + // Merge sign, significand, and exponent into final result + q_sig = (vui128_t) vec_or ((vui32_t) q_sig, q_sign); + result = vec_xsiexpqp (q_sig, q_exp); +#else // ! _ARCH_PWR8, use libgcc soft-float + result = vfa - vfb; +#endif + return result; +} + +__binary128 +test_vec_subqpo_V0 (__binary128 vfa, __binary128 vfb) +{ + __binary128 result; +#if defined (_ARCH_PWR9) && (__GNUC__ > 7) +#if defined (__FLOAT128__) && (__GNUC__ > 8) + // earlier GCC versions generate extra data moves for this. + result = __builtin_subf128_round_to_odd (vfa, vfb); +#else + // No extra data moves here. + __asm__( + "xssubqpo %0,%1,%2" + : "=v" (result) + : "v" (vfa), "v" (vfb) + : ); +#endif +#else // defined (_ARCH_PWR8) + __binary128 nvfb; +#if __USE_SELECT__ + nvfb = vec_self128 (vec_negf128 (vfb), vfb, vec_isnanf128(vfb)); +#else + if (vec_all_isnanf128 (vfb)) + nvfb = vfb; + else + nvfb = vec_negf128 (vfb); +#endif + result = test_vec_addqpo (vfa, nvfb); +#endif + return result; +} + vui128_t test_sld16 (vui128_t *vrh, vui128_t vh, vui128_t vl) { @@ -2704,7 +3791,51 @@ test_vec_max8_f128 (__binary128 vf1, __binary128 vf2, static const __float128 qpfact1 = 1.0Q; void -test_gcc_mulqpo_f128 (__binary128 * vf128, +test_gcc_addqpn_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8) +{ + __binary128 result; + +// result = qpfact1 * vf1; + + result = qpfact1 + vf1; + result = result + vf2; + result = result + vf3; + result = result + vf4; + result = result + vf5; + result = result + vf6; + result = result + vf7; + result = result + vf8; + *vf128 = result; +} + +void +test_gcc_subqpn_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8) +{ + __binary128 result; + +// result = qpfact1 * vf1; + + result = qpfact1 - vf1; + result = result - vf2; + result = result - vf3; + result = result - vf4; + result = result - vf5; + result = result - vf6; + result = result - vf7; + result = result - vf8; + *vf128 = result; +} + +void +test_gcc_mulqpn_f128 (__binary128 * vf128, __binary128 vf1, __binary128 vf2, __binary128 vf3, __binary128 vf4, __binary128 vf5, __binary128 vf6, @@ -2712,9 +3843,31 @@ test_gcc_mulqpo_f128 (__binary128 * vf128, { __binary128 result; +// result = qpfact1 * vf1; + result = qpfact1 * vf1; + result = result * vf2; + result = result * vf3; + result = result * vf4; + result = result * vf5; + result = result * vf6; + result = result * vf7; + result = result * vf8; + *vf128 = result; +} + +void +test_gcc_mulqpo_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8) +{ + __binary128 result; + +// result = qpfact1 * vf1; - result = result * vf1; + result = qpfact1 * vf1; result = result * vf2; result = result * vf3; result = result * vf4; @@ -3458,4 +4611,3 @@ test_glibc_f128_classify (__Float128 value) #endif #endif #endif - diff --git a/src/testsuite/vec_perf_f128.c b/src/testsuite/vec_perf_f128.c index c689b71..f6f210f 100644 --- a/src/testsuite/vec_perf_f128.c +++ b/src/testsuite/vec_perf_f128.c @@ -211,6 +211,20 @@ test_gcc_mulqpo_f128 (__binary128 * vf128, __binary128 vf5, __binary128 vf6, __binary128 vf7, __binary128 vf8); +extern void +test_gcc_addqpn_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8); + +extern void +test_gcc_subqpn_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8); + extern vb128_t test_vec_cmpgtuqp (__binary128 vfa, __binary128 vfb); @@ -346,6 +360,50 @@ test_lib_uqqp_f128 (__binary128 * vf128, vf128[7] = test_vec_xscvuqqp (vf8); } +extern __binary128 test_vec_addqpo (__binary128 vfa, __binary128 vfb); + + +void +test_lib_addqpo_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8) +{ + __binary128 result; + result = test_vec_addqpo (qpfact1, vf1); + result = test_vec_addqpo (result, vf2); + result = test_vec_addqpo (result, vf3); + result = test_vec_addqpo (result, vf4); + result = test_vec_addqpo (result, vf5); + result = test_vec_addqpo (result, vf6); + result = test_vec_addqpo (result, vf7); + result = test_vec_addqpo (result, vf8); + *vf128 = result; +} + +extern __binary128 test_vec_subqpo (__binary128 vfa, __binary128 vfb); + + +void +test_lib_subqpo_f128 (__binary128 * vf128, + __binary128 vf1, __binary128 vf2, + __binary128 vf3, __binary128 vf4, + __binary128 vf5, __binary128 vf6, + __binary128 vf7, __binary128 vf8) +{ + __binary128 result; + result = test_vec_subqpo (qpfact1, vf1); + result = test_vec_subqpo (result, vf2); + result = test_vec_subqpo (result, vf3); + result = test_vec_subqpo (result, vf4); + result = test_vec_subqpo (result, vf5); + result = test_vec_subqpo (result, vf6); + result = test_vec_subqpo (result, vf7); + result = test_vec_subqpo (result, vf8); + *vf128 = result; +} + extern __binary128 test_vec_mulqpo (__binary128 vfa, __binary128 vfb); @@ -390,6 +448,42 @@ test_lib_mulqpn_f128 (__binary128 * vf128, *vf128 = result; } +int timed_lib_addqpo_f128 (void) +{ +#ifndef PVECLIB_DISABLE_F128MATH + __binary128 tbl[10]; + int i; + + for (i=0; i #if defined (_ARCH_PWR10) && (__GNUC__ > 11) \ - || ((__GNUC__ == 11) && (__GNUC_MINOR__ >= 2)) + || ((__GNUC__ == 11) && (__GNUC_MINOR__ > 2)) // New support defined in Power Vector Intrinsic Programming Reference. -// Waiting for GCC 11.2? +// Waiting for GCC 11.3? int test_gcc_cmpsq_all_gt_PWR10 (vi128_t a, vi128_t b) { diff --git a/src/testsuite/vec_pwr9_dummy.c b/src/testsuite/vec_pwr9_dummy.c index 1160990..607ab27 100644 --- a/src/testsuite/vec_pwr9_dummy.c +++ b/src/testsuite/vec_pwr9_dummy.c @@ -40,6 +40,12 @@ #include #include +__binary128 +test_negqp_PWR9 (__binary128 vfa) +{ + return vec_negf128 (vfa); +} + __binary128 test_mulqpo_PWR9 (__binary128 vfa, __binary128 vfb) { @@ -247,7 +253,9 @@ test_convert_dpqp_PWR9 (vf64_t f64) : ); #endif #else // likely call to libgcc concert. +#ifndef __clang__ result = f64[VEC_DW_H]; +#endif #endif return result; } @@ -276,8 +284,8 @@ test_convert_qpdpo_PWR9 (__binary128 f128) vui128_t q_sig; vui32_t q_sign; const vui128_t q_zero = { 0 }; - const vui128_t q_ones = (vui128_t) vec_splat_s32 (-1); - const vui64_t exp_low = (vui64_t) CONST_VINT64_DW( (0x3fff), 0 ); +// const vui128_t q_ones = (vui128_t) vec_splat_s32 (-1); +// const vui64_t exp_low = (vui64_t) CONST_VINT64_DW( (0x3fff), 0 ); const vui64_t exp_delta = (vui64_t) CONST_VINT64_DW( (0x3fff - 0x3ff), 0 ); const vui64_t exp_tiny = (vui64_t) CONST_VINT64_DW( (0x3fff-1022), 0 ); const vui64_t exp_high = (vui64_t) CONST_VINT64_DW( (0x3fff+1023), 0 ); @@ -290,11 +298,13 @@ test_convert_qpdpo_PWR9 (__binary128 f128) q_sign = vec_and_bin128_2_vui32t (f128, signmask); if (__builtin_expect (!vec_cmpuq_all_eq ((vui128_t) q_exp, (vui128_t) q_naninf), 1)) { + vui64_t d_X; + if (vec_cmpuq_all_ge ((vui128_t) q_exp, (vui128_t) exp_tiny)) { // Greater than or equal to 2**-1022 if (vec_cmpuq_all_lt ((vui128_t) q_exp, (vui128_t) exp_high)) { // Less than or equal to 2**+1023 - vui64_t d_X; + // vui64_t d_X; // Convert the significand to double with left shift 4 q_sig = vec_slqi ((vui128_t) q_sig, 4); // The GRX round bits are now in bits 64-127 (DW element 1) @@ -313,7 +323,6 @@ test_convert_qpdpo_PWR9 (__binary128 f128) } else { // tiny - vui64_t d_X; q_delta = vec_subudm (exp_tiny, q_exp); // Convert the significand to double with left shift 4 // The GRX round bits are now in bits 64-127 (DW element 1) @@ -427,11 +436,11 @@ test_convert_uqqp_PWR9 (vui128_t int128) lo64 = int64[VEC_DW_L]; result = (hi64 * two64) + lo64; #elif defined (_ARCH_PWR8) - vui64_t d_exp, d_sig, q_exp; + vui64_t q_exp; vui128_t q_sig; - vui32_t q_sign; +// vui32_t q_sign; const vui128_t q_zero = (vui128_t) { 0 }; - const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); +// const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); // int64[VEC_DW_L] = 0UL; // clear the right most element to zero. q_sig = int128; @@ -450,7 +459,7 @@ test_convert_uqqp_PWR9 (vui128_t int128) q_sig = vec_slq (q_sig, (vui128_t) i64_clz); q_exp = vec_subudm (q_expm, i64_clz); // This is the part that might require rounding. As is we truncate. - q_sig = vec_srqi ((vui128_t) d_sig, 15); + q_sig = vec_srqi ((vui128_t) q_sig, 15); result = vec_xsiexpqp (q_sig, q_exp); } #else @@ -477,7 +486,9 @@ test_convert_sdqp_PWR9 (vi64_t i64) : ); #endif #else // likely call to libgcc concert. +#ifndef __clang__ result = i64[VEC_DW_H]; +#endif #endif return result; } @@ -500,7 +511,9 @@ test_convert_udqp_PWR9 (vui64_t i64) : ); #endif #else // likely call to libgcc concert. +#ifndef __clang__ result = i64[VEC_DW_H]; +#endif #endif return result; } @@ -513,7 +526,7 @@ test_scalar_cmpto_exp_gt_PWR9 (__binary128 vfa, __binary128 vfb) return scalar_cmp_exp_gt (vfa, vfb); #else vui32_t vra, vrb; - const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); +// const vui32_t signmask = CONST_VINT128_W(0x80000000, 0, 0, 0); const vui32_t expmask = CONST_VINT128_W(0x7fff0000, 0, 0, 0); vra = vec_and_bin128_2_vui32t (vfa, expmask); @@ -1952,7 +1965,7 @@ __test_scalar_test_data_class_f32 (float val) #ifdef scalar_test_neg #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) int -__test_scalar_test_neg (__ieee128 val) +__test_scalar_test_neg (__binary128 val) { return scalar_test_neg (val); } @@ -1962,7 +1975,7 @@ __test_scalar_test_neg (__ieee128 val) #ifdef scalar_extract_exp #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) long long int -__test_scalar_extract_exp_f128 (__ieee128 val) +__test_scalar_extract_exp_f128 (__binary128 val) { return scalar_extract_exp (val); } @@ -1977,7 +1990,7 @@ __test_scalar_extract_exp_f64 (double val) #ifdef scalar_extract_sig #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) __int128 -__test_scalar_extract_sig_f128 (__ieee128 val) +__test_scalar_extract_sig_f128 (__binary128 val) { return scalar_extract_sig (val); } @@ -1991,8 +2004,8 @@ __test_scalar_extract_sig_f64 (double val) #ifdef scalar_insert_exp #if defined (_ARCH_PWR9) && defined (__FLOAT128__) && (__GNUC__ > 7) -__ieee128 -__test_scalar_insert_exp_f128 (__ieee128 sig, unsigned long long int exp) +__binary128 +__test_scalar_insert_exp_f128 (__binary128 sig, unsigned long long int exp) { return scalar_insert_exp (sig, exp); } @@ -2009,7 +2022,7 @@ __test_scalar_insert_exp_f64 (double sig, unsigned long long int exp) /* there is an instruction for this, but is not supported in GCC (8.2) yet. */ int -__test_scalar_cmp_exp_eq_f128 (__ieee128 vra, __ieee128 vrb) +__test_scalar_cmp_exp_eq_f128 (__binary128 vra, __binary128 vrb) { return scalar_cmp_exp_eq (vra, vrb); }