Home
last modified time | relevance | path

Searched refs:FPBits (Results 1 – 25 of 32) sorted by relevance

12

/freebsd/contrib/llvm-project/libc/src/__support/
H A Dstr_to_float.h47 typename fputil::FPBits<T>::StorageType mantissa;
69 template <class T> LIBC_INLINE void set_implicit_bit(fputil::FPBits<T> &) { in set_implicit_bit()
76 set_implicit_bit<long double>(fputil::FPBits<long double> &result) {
93 using FPBits = typename fputil::FPBits<T>; variable
94 using StorageType = typename FPBits::StorageType;
114 int32_t exp2 = exp10_to_exp2(exp10) + FPBits::STORAGE_LEN + FPBits::EXP_BIAS -
132 (uint64_t(1) << (FPBits::STORAGE_LEN - (FPBits::FRACTION_LEN + 3))) - 1;
152 (FPBits::STORAGE_LEN - 1));
155 (msb + FPBits::STORAGE_LEN - (FPBits::FRACTION_LEN + 3)));
181 if ((final_mantissa >> (FPBits::FRACTION_LEN + 1)) > 0) {
[all …]
H A Dfloat_to_string.h117 using FPBits = fputil::FPBits<long double>; variable
376 LIBC_INLINE uint32_t mul_shift_mod_1e9(const FPBits::StorageType mantissa, in mul_shift_mod_1e9()
380 UInt<internal::div_ceil(MID_INT_SIZE + FPBits::STORAGE_LEN, 64) * 64> val( in mul_shift_mod_1e9()
407 fputil::FPBits<T> float_bits;
409 FPBits::StorageType mantissa;
411 static constexpr int FRACTION_LEN = fputil::FPBits<T>::FRACTION_LEN;
412 static constexpr int EXP_BIAS = fputil::FPBits<T>::EXP_BIAS;
619 fputil::FPBits<long double> float_bits;
622 FPBits::StorageType mantissa = 0;
624 static constexpr int FRACTION_LEN = fputil::FPBits<long double>::FRACTION_LEN;
[all …]
H A Dcomplex_basic_ops.h27 if (fputil::FPBits<real_t>(c_c.real).is_inf() || in project()
28 fputil::FPBits<real_t>(c_c.imag).is_inf()) in project()
30 Complex<real_t>{(fputil::FPBits<real_t>::inf(Sign::POS).get_val()), in project()
/freebsd/contrib/llvm-project/libc/src/__support/FPUtil/
H A DBasicOperations.h30 return FPBits<T>(x).abs().get_val(); in abs()
37 FPBits<T> x_bits(x); in max()
38 FPBits<T> y_bits(y); in max()
55 FPBits<float16> x_bits(x); in max()
56 FPBits<float16> y_bits(y); in max()
77 FPBits<T> x_bits(x); in min()
78 FPBits<T> y_bits(y); in min()
95 FPBits<float16> x_bits(x); in min()
96 FPBits<float16> y_bits(y); in min()
119 const FPBits<T> bitx(x), bity(y); in fmin()
[all …]
H A DManipulationFunctions.h33 FPBits<T> bits(x); in frexp()
57 FPBits<T> bits(x); in modf()
63 return FPBits<T>::zero(bits.sign()).get_val(); in modf()
69 return FPBits<T>::zero(bits.sign()).get_val(); in modf()
78 FPBits<T> xbits(x); in copysign()
79 xbits.set_sign(FPBits<T>(y).sign()); in copysign()
102 FPBits<U> bits(x);
115 DyadicFloat<FPBits<U>::STORAGE_LEN> normal(bits.get_val());
136 FPBits<T> bits(x);
145 return FPBits<T>::inf(Sign::NEG).get_val();
[all …]
H A DNearestIntegerOperations.h26 using StorageType = typename FPBits<T>::StorageType; in trunc()
27 FPBits<T> bits(x); in trunc()
40 if (exponent >= static_cast<int>(FPBits<T>::FRACTION_LEN)) in trunc()
45 return FPBits<T>::zero(bits.sign()).get_val(); in trunc()
47 int trim_size = FPBits<T>::FRACTION_LEN - exponent; in trunc()
56 using StorageType = typename FPBits<T>::StorageType; in ceil()
57 FPBits<T> bits(x); in ceil()
68 if (exponent >= static_cast<int>(FPBits<T>::FRACTION_LEN)) in ceil()
78 uint32_t trim_size = FPBits<T>::FRACTION_LEN - exponent; in ceil()
99 FPBits<T> bits(x); in floor()
[all …]
H A Ddyadic_float.h99 static_assert(FPBits<T>::FRACTION_LEN < Bits); in DyadicFloat()
100 FPBits<T> x_bits(x); in DyadicFloat()
102 exponent = x_bits.get_explicit_exponent() - FPBits<T>::FRACTION_LEN; in DyadicFloat()
175 cpp::is_floating_point_v<T> && (FPBits<T>::FRACTION_LEN < Bits), T>
177 using FPBits = FPBits<T>; in generic_as() local
178 using StorageType = typename FPBits::StorageType; in generic_as()
180 constexpr int EXTRA_FRACTION_LEN = Bits - 1 - FPBits::FRACTION_LEN; in generic_as()
183 return FPBits::zero(sign).get_val(); in generic_as()
187 if (unbiased_exp + FPBits::EXP_BIAS >= FPBits::MAX_BIASED_EXPONENT) { in generic_as()
195 return FPBits::inf(sign).get_val(); in generic_as()
[all …]
H A DNormalFloat.h35 using StorageType = typename FPBits<T>::StorageType;
37 (StorageType(1) << FPBits<T>::FRACTION_LEN);
45 static_assert(sizeof(StorageType) * 8 >= FPBits<T>::FRACTION_LEN + 1,
60 LIBC_INLINE explicit NormalFloat(T x) { init_from_bits(FPBits<T>(x)); } in NormalFloat()
62 LIBC_INLINE explicit NormalFloat(FPBits<T> bits) { init_from_bits(bits); } in NormalFloat()
96 int biased_exponent = exponent + FPBits<T>::EXP_BIAS; in T()
98 constexpr int MAX_EXPONENT_VALUE = (1 << FPBits<T>::EXP_LEN) - 2; in T()
100 return FPBits<T>::inf(sign).get_val(); in T()
103 FPBits<T> result(T(0.0)); in T()
106 constexpr int SUBNORMAL_EXPONENT = -FPBits<T>::EXP_BIAS + 1; in T()
[all …]
H A Dexcept_value_utils.h44 using StorageType = typename FPBits<T>::StorageType;
71 return FPBits<T>(out_bits).get_val(); in lookup()
102 T result = FPBits<T>(out_bits).get_val(); in lookup_odd()
116 tmp -= FPBits<T>::min_normal().get_val(); in round_result_slightly_down()
122 tmp += FPBits<T>::min_normal().get_val(); in round_result_slightly_up()
130 tmp -= FPBits<float16>::min_normal().get_val(); in round_result_slightly_down()
136 tmp += FPBits<float16>::min_normal().get_val(); in round_result_slightly_up()
H A Dfpbits_str.h37 template <typename T> LIBC_INLINE cpp::string str(fputil::FPBits<T> x) { in str()
38 using StorageType = typename fputil::FPBits<T>::StorageType; in str()
H A Dcast.h41 using InFPBits = FPBits<InType>; in cast()
43 using OutFPBits = FPBits<OutType>; in cast()
H A DDivisionAndRemainderOperations.h29 FPBits<T> xbits(x), ybits(y); in remquo()
35 return FPBits<T>::quiet_nan().get_val(); in remquo()
H A DHypot.h108 using FPBits_t = FPBits<T>;
109 using StorageType = typename FPBits<T>::StorageType;
/freebsd/contrib/llvm-project/libc/src/__support/FPUtil/x86_64/
H A DNextAfterLongDouble.h29 using FPBits = FPBits<long double>; in nextafter() local
30 FPBits from_bits(from); in nextafter()
34 FPBits to_bits(to); in nextafter()
46 using StorageType = FPBits::StorageType; in nextafter()
48 constexpr StorageType FRACTION_MASK = FPBits::FRACTION_MASK; in nextafter()
51 from_bits = FPBits::min_subnormal(from > to ? Sign::NEG : Sign::POS); in nextafter()
54 if (from_bits == FPBits::max_subnormal(Sign::NEG)) { in nextafter()
57 from_bits = FPBits::min_normal(Sign::NEG); in nextafter()
68 from_bits = FPBits(StorageType(from_bits.uintval() + 1)); in nextafter()
71 if (from_bits == FPBits::min_normal(Sign::NEG)) { in nextafter()
[all …]
/freebsd/contrib/llvm-project/libc/src/__support/math/
H A Dexpf16.h55 using FPBits = fputil::FPBits<float16>; in expf16() local
56 FPBits x_bits(x); in expf16()
67 return FPBits::quiet_nan().get_val(); in expf16()
77 return FPBits::inf().get_val(); in expf16()
84 return FPBits::inf().get_val(); in expf16()
86 return FPBits::max_normal().get_val(); in expf16()
94 return FPBits::zero().get_val(); in expf16()
101 return FPBits::min_subnormal().get_val(); in expf16()
103 return FPBits::zero().get_val(); in expf16()
H A Dexpf.h28 using FPBits = typename fputil::FPBits<float>; in expf() local
29 FPBits xbits(x); in expf()
/freebsd/contrib/llvm-project/libc/src/__support/FPUtil/generic/
H A Dsqrt_80_bit_long_double.h25 FPBits<long double>::StorageType &mantissa) { in normalize()
28 (8 * sizeof(uint64_t) - 1 - FPBits<long double>::FRACTION_LEN)); in normalize()
41 using LDBits = FPBits<long double>; in sqrt()
127 FPBits<long double> out(0.0L); in sqrt()
H A Dsqrt.h42 typename FPBits<T>::StorageType &mantissa) {
45 (8 * static_cast<int>(sizeof(mantissa)) - 1 - FPBits<T>::FRACTION_LEN);
83 using OutFPBits = FPBits<OutType>;
84 using InFPBits = FPBits<InType>;
H A DFMod.h161 template <typename T, typename U = typename FPBits<T>::StorageType,
166 (sizeof(U) * CHAR_BIT > FPBits<T>::FRACTION_LEN),
170 using FPB = FPBits<T>;
174 using FPB = fputil::FPBits<T>; in pre_check()
H A DFMA.h46 fputil::FPBits<double> bit_prod(prod), bitz(z_d), bit_sum(sum);
70 fputil::FPBits<double> t(
H A Dmul.h33 using OutFPBits = FPBits<OutType>; in mul()
35 using InFPBits = FPBits<InType>; in mul()
H A Ddiv.h33 using OutFPBits = FPBits<OutType>; in div()
35 using InFPBits = FPBits<InType>; in div()
H A Dadd_sub.h35 using OutFPBits = FPBits<OutType>; in add_or_sub()
37 using InFPBits = FPBits<InType>; in add_or_sub()
/freebsd/contrib/llvm-project/libcxx/src/include/
H A Dfrom_chars_floating_point.h231 auto __r = LIBC_NAMESPACE::shared::FPBits<_Fp>(); in __calculate_result()
291 …__fractional.__exponent, __parsed_exponent.__value, LIBC_NAMESPACE::shared::FPBits<_Fp>::MAX_BIASE… in __from_chars_floating_point_hex()
375 …std::__merge_exponents(__fractional.__exponent, 0, LIBC_NAMESPACE::shared::FPBits<_Fp>::MAX_BIASED… in __from_chars_floating_point_decimal()
386 …__fractional.__exponent, __parsed_exponent.__value, LIBC_NAMESPACE::shared::FPBits<_Fp>::MAX_BIASE… in __from_chars_floating_point_decimal()
/freebsd/contrib/llvm-project/libc/shared/
H A Dfp_bits.h18 using fputil::FPBits;

12