Lines Matching refs:p

603 static void QEMU_FLATTEN float16_unpack_raw(FloatParts64 *p, float16 f)  in float16_unpack_raw()  argument
605 unpack_raw64(p, &float16_params, f); in float16_unpack_raw()
608 static void QEMU_FLATTEN bfloat16_unpack_raw(FloatParts64 *p, bfloat16 f) in bfloat16_unpack_raw() argument
610 unpack_raw64(p, &bfloat16_params, f); in bfloat16_unpack_raw()
613 static void QEMU_FLATTEN float32_unpack_raw(FloatParts64 *p, float32 f) in float32_unpack_raw() argument
615 unpack_raw64(p, &float32_params, f); in float32_unpack_raw()
618 static void QEMU_FLATTEN float64_unpack_raw(FloatParts64 *p, float64 f) in float64_unpack_raw() argument
620 unpack_raw64(p, &float64_params, f); in float64_unpack_raw()
623 static void QEMU_FLATTEN floatx80_unpack_raw(FloatParts128 *p, floatx80 f) in floatx80_unpack_raw() argument
625 *p = (FloatParts128) { in floatx80_unpack_raw()
633 static void QEMU_FLATTEN float128_unpack_raw(FloatParts128 *p, float128 f) in float128_unpack_raw() argument
638 *p = (FloatParts128) { in float128_unpack_raw()
648 static uint64_t pack_raw64(const FloatParts64 *p, const FloatFmt *fmt) in pack_raw64() argument
654 ret = (uint64_t)p->sign << (f_size + e_size); in pack_raw64()
655 ret = deposit64(ret, f_size, e_size, p->exp); in pack_raw64()
656 ret = deposit64(ret, 0, f_size, p->frac); in pack_raw64()
660 static float16 QEMU_FLATTEN float16_pack_raw(const FloatParts64 *p) in float16_pack_raw() argument
662 return make_float16(pack_raw64(p, &float16_params)); in float16_pack_raw()
665 static bfloat16 QEMU_FLATTEN bfloat16_pack_raw(const FloatParts64 *p) in bfloat16_pack_raw() argument
667 return pack_raw64(p, &bfloat16_params); in bfloat16_pack_raw()
670 static float32 QEMU_FLATTEN float32_pack_raw(const FloatParts64 *p) in float32_pack_raw() argument
672 return make_float32(pack_raw64(p, &float32_params)); in float32_pack_raw()
675 static float64 QEMU_FLATTEN float64_pack_raw(const FloatParts64 *p) in float64_pack_raw() argument
677 return make_float64(pack_raw64(p, &float64_params)); in float64_pack_raw()
680 static float128 QEMU_FLATTEN float128_pack_raw(const FloatParts128 *p) in float128_pack_raw() argument
686 hi = (uint64_t)p->sign << (f_size + e_size); in float128_pack_raw()
687 hi = deposit64(hi, f_size, e_size, p->exp); in float128_pack_raw()
688 hi = deposit64(hi, 0, f_size, p->frac_hi); in float128_pack_raw()
689 return make_float128(hi, p->frac_lo); in float128_pack_raw()
738 static void parts64_canonicalize(FloatParts64 *p, float_status *status,
740 static void parts128_canonicalize(FloatParts128 *p, float_status *status,
746 static void parts64_uncanon_normal(FloatParts64 *p, float_status *status,
748 static void parts128_uncanon_normal(FloatParts128 *p, float_status *status,
754 static void parts64_uncanon(FloatParts64 *p, float_status *status,
756 static void parts128_uncanon(FloatParts128 *p, float_status *status,
842 static int64_t parts64_float_to_sint(FloatParts64 *p, FloatRoundMode rmode,
845 static int64_t parts128_float_to_sint(FloatParts128 *p, FloatRoundMode rmode,
852 static uint64_t parts64_float_to_uint(FloatParts64 *p, FloatRoundMode rmode,
855 static uint64_t parts128_float_to_uint(FloatParts128 *p, FloatRoundMode rmode,
862 static int64_t parts64_float_to_sint_modulo(FloatParts64 *p,
865 static int64_t parts128_float_to_sint_modulo(FloatParts128 *p,
872 static void parts64_sint_to_float(FloatParts64 *p, int64_t a,
874 static void parts128_sint_to_float(FloatParts128 *p, int64_t a,
883 static void parts64_uint_to_float(FloatParts64 *p, uint64_t a,
885 static void parts128_uint_to_float(FloatParts128 *p, uint64_t a,
1651 static void float16a_unpack_canonical(FloatParts64 *p, float16 f, in float16a_unpack_canonical() argument
1654 float16_unpack_raw(p, f); in float16a_unpack_canonical()
1655 parts_canonicalize(p, s, params); in float16a_unpack_canonical()
1658 static void float16_unpack_canonical(FloatParts64 *p, float16 f, in float16_unpack_canonical() argument
1661 float16a_unpack_canonical(p, f, s, &float16_params); in float16_unpack_canonical()
1664 static void bfloat16_unpack_canonical(FloatParts64 *p, bfloat16 f, in bfloat16_unpack_canonical() argument
1667 bfloat16_unpack_raw(p, f); in bfloat16_unpack_canonical()
1668 parts_canonicalize(p, s, &bfloat16_params); in bfloat16_unpack_canonical()
1671 static float16 float16a_round_pack_canonical(FloatParts64 *p, in float16a_round_pack_canonical() argument
1675 parts_uncanon(p, s, params); in float16a_round_pack_canonical()
1676 return float16_pack_raw(p); in float16a_round_pack_canonical()
1679 static float16 float16_round_pack_canonical(FloatParts64 *p, in float16_round_pack_canonical() argument
1682 return float16a_round_pack_canonical(p, s, &float16_params); in float16_round_pack_canonical()
1685 static bfloat16 bfloat16_round_pack_canonical(FloatParts64 *p, in bfloat16_round_pack_canonical() argument
1688 parts_uncanon(p, s, &bfloat16_params); in bfloat16_round_pack_canonical()
1689 return bfloat16_pack_raw(p); in bfloat16_round_pack_canonical()
1692 static void float32_unpack_canonical(FloatParts64 *p, float32 f, in float32_unpack_canonical() argument
1695 float32_unpack_raw(p, f); in float32_unpack_canonical()
1696 parts_canonicalize(p, s, &float32_params); in float32_unpack_canonical()
1699 static float32 float32_round_pack_canonical(FloatParts64 *p, in float32_round_pack_canonical() argument
1702 parts_uncanon(p, s, &float32_params); in float32_round_pack_canonical()
1703 return float32_pack_raw(p); in float32_round_pack_canonical()
1706 static void float64_unpack_canonical(FloatParts64 *p, float64 f, in float64_unpack_canonical() argument
1709 float64_unpack_raw(p, f); in float64_unpack_canonical()
1710 parts_canonicalize(p, s, &float64_params); in float64_unpack_canonical()
1713 static float64 float64_round_pack_canonical(FloatParts64 *p, in float64_round_pack_canonical() argument
1716 parts_uncanon(p, s, &float64_params); in float64_round_pack_canonical()
1717 return float64_pack_raw(p); in float64_round_pack_canonical()
1720 static float64 float64r32_round_pack_canonical(FloatParts64 *p, in float64r32_round_pack_canonical() argument
1723 parts_uncanon(p, s, &float32_params); in float64r32_round_pack_canonical()
1730 switch (p->cls) { in float64r32_round_pack_canonical()
1732 if (unlikely(p->exp == 0)) { in float64r32_round_pack_canonical()
1737 int shift = frac_normalize(p); in float64r32_round_pack_canonical()
1738 p->exp = (float32_params.frac_shift - in float64r32_round_pack_canonical()
1741 frac_shr(p, float64_params.frac_shift); in float64r32_round_pack_canonical()
1743 frac_shl(p, float32_params.frac_shift - float64_params.frac_shift); in float64r32_round_pack_canonical()
1744 p->exp += float64_params.exp_bias - float32_params.exp_bias; in float64r32_round_pack_canonical()
1749 frac_shl(p, float32_params.frac_shift - float64_params.frac_shift); in float64r32_round_pack_canonical()
1750 p->exp = float64_params.exp_max; in float64r32_round_pack_canonical()
1753 p->exp = float64_params.exp_max; in float64r32_round_pack_canonical()
1761 return float64_pack_raw(p); in float64r32_round_pack_canonical()
1764 static void float128_unpack_canonical(FloatParts128 *p, float128 f, in float128_unpack_canonical() argument
1767 float128_unpack_raw(p, f); in float128_unpack_canonical()
1768 parts_canonicalize(p, s, &float128_params); in float128_unpack_canonical()
1771 static float128 float128_round_pack_canonical(FloatParts128 *p, in float128_round_pack_canonical() argument
1774 parts_uncanon(p, s, &float128_params); in float128_round_pack_canonical()
1775 return float128_pack_raw(p); in float128_round_pack_canonical()
1779 static bool floatx80_unpack_canonical(FloatParts128 *p, floatx80 f, in floatx80_unpack_canonical() argument
1797 floatx80_unpack_raw(p, f); in floatx80_unpack_canonical()
1799 if (likely(p->exp != floatx80_params[floatx80_precision_x].exp_max)) { in floatx80_unpack_canonical()
1800 parts_canonicalize(p, s, &floatx80_params[floatx80_precision_x]); in floatx80_unpack_canonical()
1803 p->frac_hi &= MAKE_64BIT_MASK(0, 63); in floatx80_unpack_canonical()
1804 p->cls = (p->frac_hi == 0 ? float_class_inf in floatx80_unpack_canonical()
1805 : parts_is_snan_frac(p->frac_hi, s) in floatx80_unpack_canonical()
1811 static floatx80 floatx80_round_pack_canonical(FloatParts128 *p, in floatx80_round_pack_canonical() argument
1818 switch (p->cls) { in floatx80_round_pack_canonical()
1821 parts_uncanon_normal(p, s, fmt); in floatx80_round_pack_canonical()
1822 frac = p->frac_hi; in floatx80_round_pack_canonical()
1823 exp = p->exp; in floatx80_round_pack_canonical()
1827 p64.sign = p->sign; in floatx80_round_pack_canonical()
1828 p64.exp = p->exp; in floatx80_round_pack_canonical()
1829 frac_truncjam(&p64, p); in floatx80_round_pack_canonical()
1853 frac = p->frac_hi | (1ull << 63); in floatx80_round_pack_canonical()
1861 return packFloatx80(p->sign, exp, frac); in floatx80_round_pack_canonical()
2753 FloatParts64 p; in float16_to_float32() local
2755 float16a_unpack_canonical(&p, a, s, fmt16); in float16_to_float32()
2756 parts_float_to_float(&p, s); in float16_to_float32()
2757 return float32_round_pack_canonical(&p, s); in float16_to_float32()
2763 FloatParts64 p; in float16_to_float64() local
2765 float16a_unpack_canonical(&p, a, s, fmt16); in float16_to_float64()
2766 parts_float_to_float(&p, s); in float16_to_float64()
2767 return float64_round_pack_canonical(&p, s); in float16_to_float64()
2772 FloatParts64 p; in float32_to_float16() local
2775 float32_unpack_canonical(&p, a, s); in float32_to_float16()
2777 parts_float_to_float(&p, s); in float32_to_float16()
2780 parts_float_to_ahp(&p, s); in float32_to_float16()
2783 return float16a_round_pack_canonical(&p, s, fmt); in float32_to_float16()
2789 FloatParts64 p; in soft_float32_to_float64() local
2791 float32_unpack_canonical(&p, a, s); in soft_float32_to_float64()
2792 parts_float_to_float(&p, s); in soft_float32_to_float64()
2793 return float64_round_pack_canonical(&p, s); in soft_float32_to_float64()
2814 FloatParts64 p; in float64_to_float16() local
2817 float64_unpack_canonical(&p, a, s); in float64_to_float16()
2819 parts_float_to_float(&p, s); in float64_to_float16()
2822 parts_float_to_ahp(&p, s); in float64_to_float16()
2825 return float16a_round_pack_canonical(&p, s, fmt); in float64_to_float16()
2830 FloatParts64 p; in float64_to_float32() local
2832 float64_unpack_canonical(&p, a, s); in float64_to_float32()
2833 parts_float_to_float(&p, s); in float64_to_float32()
2834 return float32_round_pack_canonical(&p, s); in float64_to_float32()
2839 FloatParts64 p; in bfloat16_to_float32() local
2841 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_float32()
2842 parts_float_to_float(&p, s); in bfloat16_to_float32()
2843 return float32_round_pack_canonical(&p, s); in bfloat16_to_float32()
2848 FloatParts64 p; in bfloat16_to_float64() local
2850 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_float64()
2851 parts_float_to_float(&p, s); in bfloat16_to_float64()
2852 return float64_round_pack_canonical(&p, s); in bfloat16_to_float64()
2857 FloatParts64 p; in float32_to_bfloat16() local
2859 float32_unpack_canonical(&p, a, s); in float32_to_bfloat16()
2860 parts_float_to_float(&p, s); in float32_to_bfloat16()
2861 return bfloat16_round_pack_canonical(&p, s); in float32_to_bfloat16()
2866 FloatParts64 p; in float64_to_bfloat16() local
2868 float64_unpack_canonical(&p, a, s); in float64_to_bfloat16()
2869 parts_float_to_float(&p, s); in float64_to_bfloat16()
2870 return bfloat16_round_pack_canonical(&p, s); in float64_to_bfloat16()
2941 FloatParts128 p; in floatx80_to_float128() local
2943 if (floatx80_unpack_canonical(&p, a, s)) { in floatx80_to_float128()
2944 parts_float_to_float(&p, s); in floatx80_to_float128()
2946 parts_default_nan(&p, s); in floatx80_to_float128()
2948 return float128_round_pack_canonical(&p, s); in floatx80_to_float128()
2973 FloatParts128 p; in float128_to_floatx80() local
2975 float128_unpack_canonical(&p, a, s); in float128_to_floatx80()
2976 parts_float_to_float(&p, s); in float128_to_floatx80()
2977 return floatx80_round_pack_canonical(&p, s); in float128_to_floatx80()
2986 FloatParts64 p; in float16_round_to_int() local
2988 float16_unpack_canonical(&p, a, s); in float16_round_to_int()
2989 parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float16_params); in float16_round_to_int()
2990 return float16_round_pack_canonical(&p, s); in float16_round_to_int()
2995 FloatParts64 p; in float32_round_to_int() local
2997 float32_unpack_canonical(&p, a, s); in float32_round_to_int()
2998 parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float32_params); in float32_round_to_int()
2999 return float32_round_pack_canonical(&p, s); in float32_round_to_int()
3004 FloatParts64 p; in float64_round_to_int() local
3006 float64_unpack_canonical(&p, a, s); in float64_round_to_int()
3007 parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float64_params); in float64_round_to_int()
3008 return float64_round_pack_canonical(&p, s); in float64_round_to_int()
3013 FloatParts64 p; in bfloat16_round_to_int() local
3015 bfloat16_unpack_canonical(&p, a, s); in bfloat16_round_to_int()
3016 parts_round_to_int(&p, s->float_rounding_mode, 0, s, &bfloat16_params); in bfloat16_round_to_int()
3017 return bfloat16_round_pack_canonical(&p, s); in bfloat16_round_to_int()
3022 FloatParts128 p; in float128_round_to_int() local
3024 float128_unpack_canonical(&p, a, s); in float128_round_to_int()
3025 parts_round_to_int(&p, s->float_rounding_mode, 0, s, &float128_params); in float128_round_to_int()
3026 return float128_round_pack_canonical(&p, s); in float128_round_to_int()
3031 FloatParts128 p; in floatx80_round_to_int() local
3033 if (!floatx80_unpack_canonical(&p, a, status)) { in floatx80_round_to_int()
3037 parts_round_to_int(&p, status->float_rounding_mode, 0, status, in floatx80_round_to_int()
3039 return floatx80_round_pack_canonical(&p, status); in floatx80_round_to_int()
3049 FloatParts64 p; in float16_to_int8_scalbn() local
3051 float16_unpack_canonical(&p, a, s); in float16_to_int8_scalbn()
3052 return parts_float_to_sint(&p, rmode, scale, INT8_MIN, INT8_MAX, s); in float16_to_int8_scalbn()
3058 FloatParts64 p; in float16_to_int16_scalbn() local
3060 float16_unpack_canonical(&p, a, s); in float16_to_int16_scalbn()
3061 return parts_float_to_sint(&p, rmode, scale, INT16_MIN, INT16_MAX, s); in float16_to_int16_scalbn()
3067 FloatParts64 p; in float16_to_int32_scalbn() local
3069 float16_unpack_canonical(&p, a, s); in float16_to_int32_scalbn()
3070 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in float16_to_int32_scalbn()
3076 FloatParts64 p; in float16_to_int64_scalbn() local
3078 float16_unpack_canonical(&p, a, s); in float16_to_int64_scalbn()
3079 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in float16_to_int64_scalbn()
3085 FloatParts64 p; in float32_to_int16_scalbn() local
3087 float32_unpack_canonical(&p, a, s); in float32_to_int16_scalbn()
3088 return parts_float_to_sint(&p, rmode, scale, INT16_MIN, INT16_MAX, s); in float32_to_int16_scalbn()
3094 FloatParts64 p; in float32_to_int32_scalbn() local
3096 float32_unpack_canonical(&p, a, s); in float32_to_int32_scalbn()
3097 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in float32_to_int32_scalbn()
3103 FloatParts64 p; in float32_to_int64_scalbn() local
3105 float32_unpack_canonical(&p, a, s); in float32_to_int64_scalbn()
3106 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in float32_to_int64_scalbn()
3112 FloatParts64 p; in float64_to_int16_scalbn() local
3114 float64_unpack_canonical(&p, a, s); in float64_to_int16_scalbn()
3115 return parts_float_to_sint(&p, rmode, scale, INT16_MIN, INT16_MAX, s); in float64_to_int16_scalbn()
3121 FloatParts64 p; in float64_to_int32_scalbn() local
3123 float64_unpack_canonical(&p, a, s); in float64_to_int32_scalbn()
3124 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in float64_to_int32_scalbn()
3130 FloatParts64 p; in float64_to_int64_scalbn() local
3132 float64_unpack_canonical(&p, a, s); in float64_to_int64_scalbn()
3133 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in float64_to_int64_scalbn()
3139 FloatParts64 p; in bfloat16_to_int8_scalbn() local
3141 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_int8_scalbn()
3142 return parts_float_to_sint(&p, rmode, scale, INT8_MIN, INT8_MAX, s); in bfloat16_to_int8_scalbn()
3148 FloatParts64 p; in bfloat16_to_int16_scalbn() local
3150 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_int16_scalbn()
3151 return parts_float_to_sint(&p, rmode, scale, INT16_MIN, INT16_MAX, s); in bfloat16_to_int16_scalbn()
3157 FloatParts64 p; in bfloat16_to_int32_scalbn() local
3159 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_int32_scalbn()
3160 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in bfloat16_to_int32_scalbn()
3166 FloatParts64 p; in bfloat16_to_int64_scalbn() local
3168 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_int64_scalbn()
3169 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in bfloat16_to_int64_scalbn()
3175 FloatParts128 p; in float128_to_int32_scalbn() local
3177 float128_unpack_canonical(&p, a, s); in float128_to_int32_scalbn()
3178 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in float128_to_int32_scalbn()
3184 FloatParts128 p; in float128_to_int64_scalbn() local
3186 float128_unpack_canonical(&p, a, s); in float128_to_int64_scalbn()
3187 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in float128_to_int64_scalbn()
3195 FloatParts128 p; in float128_to_int128_scalbn() local
3197 float128_unpack_canonical(&p, a, s); in float128_to_int128_scalbn()
3199 switch (p.cls) { in float128_to_int128_scalbn()
3210 r = p.sign ? INT128_MIN : INT128_MAX; in float128_to_int128_scalbn()
3217 if (parts_round_to_int_normal(&p, rmode, scale, 128 - 2)) { in float128_to_int128_scalbn()
3221 if (p.exp < 127) { in float128_to_int128_scalbn()
3222 int shift = 127 - p.exp; in float128_to_int128_scalbn()
3223 r = int128_urshift(int128_make128(p.frac_lo, p.frac_hi), shift); in float128_to_int128_scalbn()
3224 if (p.sign) { in float128_to_int128_scalbn()
3227 } else if (p.exp == 127 && p.sign && p.frac_lo == 0 && in float128_to_int128_scalbn()
3228 p.frac_hi == DECOMPOSED_IMPLICIT_BIT) { in float128_to_int128_scalbn()
3232 r = p.sign ? INT128_MIN : INT128_MAX; in float128_to_int128_scalbn()
3247 FloatParts128 p; in floatx80_to_int32_scalbn() local
3249 if (!floatx80_unpack_canonical(&p, a, s)) { in floatx80_to_int32_scalbn()
3250 parts_default_nan(&p, s); in floatx80_to_int32_scalbn()
3252 return parts_float_to_sint(&p, rmode, scale, INT32_MIN, INT32_MAX, s); in floatx80_to_int32_scalbn()
3258 FloatParts128 p; in floatx80_to_int64_scalbn() local
3260 if (!floatx80_unpack_canonical(&p, a, s)) { in floatx80_to_int64_scalbn()
3261 parts_default_nan(&p, s); in floatx80_to_int64_scalbn()
3263 return parts_float_to_sint(&p, rmode, scale, INT64_MIN, INT64_MAX, s); in floatx80_to_int64_scalbn()
3454 FloatParts64 p; in float64_to_int32_modulo() local
3456 float64_unpack_canonical(&p, a, s); in float64_to_int32_modulo()
3457 return parts_float_to_sint_modulo(&p, rmode, 31, s); in float64_to_int32_modulo()
3463 FloatParts64 p; in float64_to_int64_modulo() local
3465 float64_unpack_canonical(&p, a, s); in float64_to_int64_modulo()
3466 return parts_float_to_sint_modulo(&p, rmode, 63, s); in float64_to_int64_modulo()
3476 FloatParts64 p; in float16_to_uint8_scalbn() local
3478 float16_unpack_canonical(&p, a, s); in float16_to_uint8_scalbn()
3479 return parts_float_to_uint(&p, rmode, scale, UINT8_MAX, s); in float16_to_uint8_scalbn()
3485 FloatParts64 p; in float16_to_uint16_scalbn() local
3487 float16_unpack_canonical(&p, a, s); in float16_to_uint16_scalbn()
3488 return parts_float_to_uint(&p, rmode, scale, UINT16_MAX, s); in float16_to_uint16_scalbn()
3494 FloatParts64 p; in float16_to_uint32_scalbn() local
3496 float16_unpack_canonical(&p, a, s); in float16_to_uint32_scalbn()
3497 return parts_float_to_uint(&p, rmode, scale, UINT32_MAX, s); in float16_to_uint32_scalbn()
3503 FloatParts64 p; in float16_to_uint64_scalbn() local
3505 float16_unpack_canonical(&p, a, s); in float16_to_uint64_scalbn()
3506 return parts_float_to_uint(&p, rmode, scale, UINT64_MAX, s); in float16_to_uint64_scalbn()
3512 FloatParts64 p; in float32_to_uint16_scalbn() local
3514 float32_unpack_canonical(&p, a, s); in float32_to_uint16_scalbn()
3515 return parts_float_to_uint(&p, rmode, scale, UINT16_MAX, s); in float32_to_uint16_scalbn()
3521 FloatParts64 p; in float32_to_uint32_scalbn() local
3523 float32_unpack_canonical(&p, a, s); in float32_to_uint32_scalbn()
3524 return parts_float_to_uint(&p, rmode, scale, UINT32_MAX, s); in float32_to_uint32_scalbn()
3530 FloatParts64 p; in float32_to_uint64_scalbn() local
3532 float32_unpack_canonical(&p, a, s); in float32_to_uint64_scalbn()
3533 return parts_float_to_uint(&p, rmode, scale, UINT64_MAX, s); in float32_to_uint64_scalbn()
3539 FloatParts64 p; in float64_to_uint16_scalbn() local
3541 float64_unpack_canonical(&p, a, s); in float64_to_uint16_scalbn()
3542 return parts_float_to_uint(&p, rmode, scale, UINT16_MAX, s); in float64_to_uint16_scalbn()
3548 FloatParts64 p; in float64_to_uint32_scalbn() local
3550 float64_unpack_canonical(&p, a, s); in float64_to_uint32_scalbn()
3551 return parts_float_to_uint(&p, rmode, scale, UINT32_MAX, s); in float64_to_uint32_scalbn()
3557 FloatParts64 p; in float64_to_uint64_scalbn() local
3559 float64_unpack_canonical(&p, a, s); in float64_to_uint64_scalbn()
3560 return parts_float_to_uint(&p, rmode, scale, UINT64_MAX, s); in float64_to_uint64_scalbn()
3566 FloatParts64 p; in bfloat16_to_uint8_scalbn() local
3568 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_uint8_scalbn()
3569 return parts_float_to_uint(&p, rmode, scale, UINT8_MAX, s); in bfloat16_to_uint8_scalbn()
3575 FloatParts64 p; in bfloat16_to_uint16_scalbn() local
3577 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_uint16_scalbn()
3578 return parts_float_to_uint(&p, rmode, scale, UINT16_MAX, s); in bfloat16_to_uint16_scalbn()
3584 FloatParts64 p; in bfloat16_to_uint32_scalbn() local
3586 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_uint32_scalbn()
3587 return parts_float_to_uint(&p, rmode, scale, UINT32_MAX, s); in bfloat16_to_uint32_scalbn()
3593 FloatParts64 p; in bfloat16_to_uint64_scalbn() local
3595 bfloat16_unpack_canonical(&p, a, s); in bfloat16_to_uint64_scalbn()
3596 return parts_float_to_uint(&p, rmode, scale, UINT64_MAX, s); in bfloat16_to_uint64_scalbn()
3602 FloatParts128 p; in float128_to_uint32_scalbn() local
3604 float128_unpack_canonical(&p, a, s); in float128_to_uint32_scalbn()
3605 return parts_float_to_uint(&p, rmode, scale, UINT32_MAX, s); in float128_to_uint32_scalbn()
3611 FloatParts128 p; in float128_to_uint64_scalbn() local
3613 float128_unpack_canonical(&p, a, s); in float128_to_uint64_scalbn()
3614 return parts_float_to_uint(&p, rmode, scale, UINT64_MAX, s); in float128_to_uint64_scalbn()
3622 FloatParts128 p; in float128_to_uint128_scalbn() local
3624 float128_unpack_canonical(&p, a, s); in float128_to_uint128_scalbn()
3626 switch (p.cls) { in float128_to_uint128_scalbn()
3637 r = p.sign ? int128_zero() : UINT128_MAX; in float128_to_uint128_scalbn()
3644 if (parts_round_to_int_normal(&p, rmode, scale, 128 - 2)) { in float128_to_uint128_scalbn()
3646 if (p.cls == float_class_zero) { in float128_to_uint128_scalbn()
3652 if (p.sign) { in float128_to_uint128_scalbn()
3655 } else if (p.exp <= 127) { in float128_to_uint128_scalbn()
3656 int shift = 127 - p.exp; in float128_to_uint128_scalbn()
3657 r = int128_urshift(int128_make128(p.frac_lo, p.frac_hi), shift); in float128_to_uint128_scalbn()
3843 FloatParts64 p; in int64_to_float16_scalbn() local
3845 parts_sint_to_float(&p, a, scale, status); in int64_to_float16_scalbn()
3846 return float16_round_pack_canonical(&p, status); in int64_to_float16_scalbn()
3881 FloatParts64 p; in int64_to_float32_scalbn() local
3890 parts64_sint_to_float(&p, a, scale, status); in int64_to_float32_scalbn()
3891 return float32_round_pack_canonical(&p, status); in int64_to_float32_scalbn()
3921 FloatParts64 p; in int64_to_float64_scalbn() local
3930 parts_sint_to_float(&p, a, scale, status); in int64_to_float64_scalbn()
3931 return float64_round_pack_canonical(&p, status); in int64_to_float64_scalbn()
3961 FloatParts64 p; in int64_to_bfloat16_scalbn() local
3963 parts_sint_to_float(&p, a, scale, status); in int64_to_bfloat16_scalbn()
3964 return bfloat16_round_pack_canonical(&p, status); in int64_to_bfloat16_scalbn()
4004 FloatParts128 p = { }; in int128_to_float128() local
4008 p.cls = float_class_normal; in int128_to_float128()
4010 p.sign = true; in int128_to_float128()
4019 p.exp = 127 - shift; in int128_to_float128()
4022 p.frac_hi = int128_gethi(a); in int128_to_float128()
4023 p.frac_lo = int128_getlo(a); in int128_to_float128()
4025 p.cls = float_class_zero; in int128_to_float128()
4028 return float128_round_pack_canonical(&p, status); in int128_to_float128()
4033 FloatParts128 p; in int64_to_float128() local
4035 parts_sint_to_float(&p, a, 0, status); in int64_to_float128()
4036 return float128_round_pack_canonical(&p, status); in int64_to_float128()
4046 FloatParts128 p; in int64_to_floatx80() local
4048 parts_sint_to_float(&p, a, 0, status); in int64_to_floatx80()
4049 return floatx80_round_pack_canonical(&p, status); in int64_to_floatx80()
4063 FloatParts64 p; in uint64_to_float16_scalbn() local
4065 parts_uint_to_float(&p, a, scale, status); in uint64_to_float16_scalbn()
4066 return float16_round_pack_canonical(&p, status); in uint64_to_float16_scalbn()
4101 FloatParts64 p; in uint64_to_float32_scalbn() local
4110 parts_uint_to_float(&p, a, scale, status); in uint64_to_float32_scalbn()
4111 return float32_round_pack_canonical(&p, status); in uint64_to_float32_scalbn()
4141 FloatParts64 p; in uint64_to_float64_scalbn() local
4150 parts_uint_to_float(&p, a, scale, status); in uint64_to_float64_scalbn()
4151 return float64_round_pack_canonical(&p, status); in uint64_to_float64_scalbn()
4181 FloatParts64 p; in uint64_to_bfloat16_scalbn() local
4183 parts_uint_to_float(&p, a, scale, status); in uint64_to_bfloat16_scalbn()
4184 return bfloat16_round_pack_canonical(&p, status); in uint64_to_bfloat16_scalbn()
4224 FloatParts128 p; in uint64_to_float128() local
4226 parts_uint_to_float(&p, a, 0, status); in uint64_to_float128()
4227 return float128_round_pack_canonical(&p, status); in uint64_to_float128()
4232 FloatParts128 p = { }; in uint128_to_float128() local
4236 p.cls = float_class_normal; in uint128_to_float128()
4243 p.exp = 127 - shift; in uint128_to_float128()
4246 p.frac_hi = int128_gethi(a); in uint128_to_float128()
4247 p.frac_lo = int128_getlo(a); in uint128_to_float128()
4249 p.cls = float_class_zero; in uint128_to_float128()
4252 return float128_round_pack_canonical(&p, status); in uint128_to_float128()
4531 FloatParts64 p; in float16_scalbn() local
4533 float16_unpack_canonical(&p, a, status); in float16_scalbn()
4534 parts_scalbn(&p, n, status); in float16_scalbn()
4535 return float16_round_pack_canonical(&p, status); in float16_scalbn()
4540 FloatParts64 p; in float32_scalbn() local
4542 float32_unpack_canonical(&p, a, status); in float32_scalbn()
4543 parts_scalbn(&p, n, status); in float32_scalbn()
4544 return float32_round_pack_canonical(&p, status); in float32_scalbn()
4549 FloatParts64 p; in float64_scalbn() local
4551 float64_unpack_canonical(&p, a, status); in float64_scalbn()
4552 parts_scalbn(&p, n, status); in float64_scalbn()
4553 return float64_round_pack_canonical(&p, status); in float64_scalbn()
4558 FloatParts64 p; in bfloat16_scalbn() local
4560 bfloat16_unpack_canonical(&p, a, status); in bfloat16_scalbn()
4561 parts_scalbn(&p, n, status); in bfloat16_scalbn()
4562 return bfloat16_round_pack_canonical(&p, status); in bfloat16_scalbn()
4567 FloatParts128 p; in float128_scalbn() local
4569 float128_unpack_canonical(&p, a, status); in float128_scalbn()
4570 parts_scalbn(&p, n, status); in float128_scalbn()
4571 return float128_round_pack_canonical(&p, status); in float128_scalbn()
4576 FloatParts128 p; in floatx80_scalbn() local
4578 if (!floatx80_unpack_canonical(&p, a, status)) { in floatx80_scalbn()
4581 parts_scalbn(&p, n, status); in floatx80_scalbn()
4582 return floatx80_round_pack_canonical(&p, status); in floatx80_scalbn()
4591 FloatParts64 p; in float16_sqrt() local
4593 float16_unpack_canonical(&p, a, status); in float16_sqrt()
4594 parts_sqrt(&p, status, &float16_params); in float16_sqrt()
4595 return float16_round_pack_canonical(&p, status); in float16_sqrt()
4601 FloatParts64 p; in soft_f32_sqrt() local
4603 float32_unpack_canonical(&p, a, status); in soft_f32_sqrt()
4604 parts_sqrt(&p, status, &float32_params); in soft_f32_sqrt()
4605 return float32_round_pack_canonical(&p, status); in soft_f32_sqrt()
4611 FloatParts64 p; in soft_f64_sqrt() local
4613 float64_unpack_canonical(&p, a, status); in soft_f64_sqrt()
4614 parts_sqrt(&p, status, &float64_params); in soft_f64_sqrt()
4615 return float64_round_pack_canonical(&p, status); in soft_f64_sqrt()
4674 FloatParts64 p; in float64r32_sqrt() local
4676 float64_unpack_canonical(&p, a, status); in float64r32_sqrt()
4677 parts_sqrt(&p, status, &float64_params); in float64r32_sqrt()
4678 return float64r32_round_pack_canonical(&p, status); in float64r32_sqrt()
4683 FloatParts64 p; in bfloat16_sqrt() local
4685 bfloat16_unpack_canonical(&p, a, status); in bfloat16_sqrt()
4686 parts_sqrt(&p, status, &bfloat16_params); in bfloat16_sqrt()
4687 return bfloat16_round_pack_canonical(&p, status); in bfloat16_sqrt()
4692 FloatParts128 p; in float128_sqrt() local
4694 float128_unpack_canonical(&p, a, status); in float128_sqrt()
4695 parts_sqrt(&p, status, &float128_params); in float128_sqrt()
4696 return float128_round_pack_canonical(&p, status); in float128_sqrt()
4701 FloatParts128 p; in floatx80_sqrt() local
4703 if (!floatx80_unpack_canonical(&p, a, s)) { in floatx80_sqrt()
4706 parts_sqrt(&p, s, &floatx80_params[s->floatx80_rounding_precision]); in floatx80_sqrt()
4707 return floatx80_round_pack_canonical(&p, s); in floatx80_sqrt()
4715 FloatParts64 p; in float32_log2() local
4717 float32_unpack_canonical(&p, a, status); in float32_log2()
4718 parts_log2(&p, status, &float32_params); in float32_log2()
4719 return float32_round_pack_canonical(&p, status); in float32_log2()
4724 FloatParts64 p; in float64_log2() local
4726 float64_unpack_canonical(&p, a, status); in float64_log2()
4727 parts_log2(&p, status, &float64_params); in float64_log2()
4728 return float64_round_pack_canonical(&p, status); in float64_log2()
4737 FloatParts64 p; in float16_default_nan() local
4739 parts_default_nan(&p, status); in float16_default_nan()
4740 p.frac >>= float16_params.frac_shift; in float16_default_nan()
4741 return float16_pack_raw(&p); in float16_default_nan()
4746 FloatParts64 p; in float32_default_nan() local
4748 parts_default_nan(&p, status); in float32_default_nan()
4749 p.frac >>= float32_params.frac_shift; in float32_default_nan()
4750 return float32_pack_raw(&p); in float32_default_nan()
4755 FloatParts64 p; in float64_default_nan() local
4757 parts_default_nan(&p, status); in float64_default_nan()
4758 p.frac >>= float64_params.frac_shift; in float64_default_nan()
4759 return float64_pack_raw(&p); in float64_default_nan()
4764 FloatParts128 p; in float128_default_nan() local
4766 parts_default_nan(&p, status); in float128_default_nan()
4767 frac_shr(&p, float128_params.frac_shift); in float128_default_nan()
4768 return float128_pack_raw(&p); in float128_default_nan()
4773 FloatParts64 p; in bfloat16_default_nan() local
4775 parts_default_nan(&p, status); in bfloat16_default_nan()
4776 p.frac >>= bfloat16_params.frac_shift; in bfloat16_default_nan()
4777 return bfloat16_pack_raw(&p); in bfloat16_default_nan()
4786 FloatParts64 p; in float16_silence_nan() local
4788 float16_unpack_raw(&p, a); in float16_silence_nan()
4789 p.frac <<= float16_params.frac_shift; in float16_silence_nan()
4790 parts_silence_nan(&p, status); in float16_silence_nan()
4791 p.frac >>= float16_params.frac_shift; in float16_silence_nan()
4792 return float16_pack_raw(&p); in float16_silence_nan()
4797 FloatParts64 p; in float32_silence_nan() local
4799 float32_unpack_raw(&p, a); in float32_silence_nan()
4800 p.frac <<= float32_params.frac_shift; in float32_silence_nan()
4801 parts_silence_nan(&p, status); in float32_silence_nan()
4802 p.frac >>= float32_params.frac_shift; in float32_silence_nan()
4803 return float32_pack_raw(&p); in float32_silence_nan()
4808 FloatParts64 p; in float64_silence_nan() local
4810 float64_unpack_raw(&p, a); in float64_silence_nan()
4811 p.frac <<= float64_params.frac_shift; in float64_silence_nan()
4812 parts_silence_nan(&p, status); in float64_silence_nan()
4813 p.frac >>= float64_params.frac_shift; in float64_silence_nan()
4814 return float64_pack_raw(&p); in float64_silence_nan()
4819 FloatParts64 p; in bfloat16_silence_nan() local
4821 bfloat16_unpack_raw(&p, a); in bfloat16_silence_nan()
4822 p.frac <<= bfloat16_params.frac_shift; in bfloat16_silence_nan()
4823 parts_silence_nan(&p, status); in bfloat16_silence_nan()
4824 p.frac >>= bfloat16_params.frac_shift; in bfloat16_silence_nan()
4825 return bfloat16_pack_raw(&p); in bfloat16_silence_nan()
4830 FloatParts128 p; in float128_silence_nan() local
4832 float128_unpack_raw(&p, a); in float128_silence_nan()
4833 frac_shl(&p, float128_params.frac_shift); in float128_silence_nan()
4834 parts_silence_nan(&p, status); in float128_silence_nan()
4835 frac_shr(&p, float128_params.frac_shift); in float128_silence_nan()
4836 return float128_pack_raw(&p); in float128_silence_nan()
4844 static bool parts_squash_denormal(FloatParts64 p, float_status *status) in parts_squash_denormal() argument
4846 if (p.exp == 0 && p.frac != 0) { in parts_squash_denormal()
4857 FloatParts64 p; in float16_squash_input_denormal() local
4859 float16_unpack_raw(&p, a); in float16_squash_input_denormal()
4860 if (parts_squash_denormal(p, status)) { in float16_squash_input_denormal()
4861 return float16_set_sign(float16_zero, p.sign); in float16_squash_input_denormal()
4870 FloatParts64 p; in float32_squash_input_denormal() local
4872 float32_unpack_raw(&p, a); in float32_squash_input_denormal()
4873 if (parts_squash_denormal(p, status)) { in float32_squash_input_denormal()
4874 return float32_set_sign(float32_zero, p.sign); in float32_squash_input_denormal()
4883 FloatParts64 p; in float64_squash_input_denormal() local
4885 float64_unpack_raw(&p, a); in float64_squash_input_denormal()
4886 if (parts_squash_denormal(p, status)) { in float64_squash_input_denormal()
4887 return float64_set_sign(float64_zero, p.sign); in float64_squash_input_denormal()
4896 FloatParts64 p; in bfloat16_squash_input_denormal() local
4898 bfloat16_unpack_raw(&p, a); in bfloat16_squash_input_denormal()
4899 if (parts_squash_denormal(p, status)) { in bfloat16_squash_input_denormal()
4900 return bfloat16_set_sign(bfloat16_zero, p.sign); in bfloat16_squash_input_denormal()
5251 FloatParts128 p; in floatx80_round() local
5253 if (!floatx80_unpack_canonical(&p, a, status)) { in floatx80_round()
5256 return floatx80_round_pack_canonical(&p, status); in floatx80_round()