Home
last modified time | relevance | path

Searched full:mantissa (Results 1 – 25 of 1785) sorted by relevance

12345678910>>...72

/aosp_15_r20/external/deqp/framework/delibs/debase/
H A DdeFloat16.c32 uint32_t mantissa; in deFloat32To16() local
42 mantissa = x.u & 0x007fffffu; in deFloat32To16()
53 mantissa = mantissa | 0x00800000u; in deFloat32To16()
55 /* Round mantissa to nearest (10+e) */ in deFloat32To16()
59 uint32_t b = (mantissa >> t) & 1u; in deFloat32To16()
61 mantissa = (mantissa + a + b) >> t; in deFloat32To16()
64 return (deFloat16)(sign | mantissa); in deFloat32To16()
68 if (mantissa == 0u) in deFloat32To16()
76 mantissa >>= 13u; in deFloat32To16()
77 return (deFloat16)(sign | 0x7c00u | mantissa | (mantissa == 0u)); in deFloat32To16()
[all …]
H A DdeFloat16Test.c29 static float getFloat32(uint32_t sign, uint32_t biased_exponent, uint32_t mantissa) in getFloat32() argument
37 x.u = (sign << 31) | (biased_exponent << 23) | mantissa; in getFloat32()
42 static deFloat16 getFloat16(uint16_t sign, uint16_t biased_exponent, uint16_t mantissa) in getFloat16() argument
44 return (deFloat16)((sign << 15) | (biased_exponent << 10) | mantissa); in getFloat16()
100 uint32_t mantissa = deRandom_getUint32(&rnd); in deFloat16_selfTest() local
102 mantissa &= 0x7fffffu; /* Take the last 23 bits */ in deFloat16_selfTest()
103 mantissa |= (mantissa == 0); /* Make sure it is not zero */ in deFloat16_selfTest()
105 DE_TEST_ASSERT(deFloat32To16RTZ(getFloat32(0, 0, mantissa)) == getFloat16(0, 0, 0)); in deFloat16_selfTest()
106 DE_TEST_ASSERT(deFloat32To16RTZ(getFloat32(1, 0, mantissa)) == getFloat16(1, 0, 0)); in deFloat16_selfTest()
119 uint32_t mantissa = deRandom_getUint32(&rnd); in deFloat16_selfTest() local
[all …]
/aosp_15_r20/external/deqp/external/openglcts/modules/common/
H A DglcMisc.cpp50 unsigned int mantissa; in floatToHalfFloat() local
54 /* get mantissa */ in floatToHalfFloat()
55 mantissa = x & ((1 << 23) - 1); in floatToHalfFloat()
61 if (mantissa && (exp == FLOAT_MAX_BIASED_EXP)) in floatToHalfFloat()
64 mantissa = (1 << 23) - 1; in floatToHalfFloat()
69 mantissa = 0; in floatToHalfFloat()
71 … hf = (((GLhalf)sign) << 15) | (GLhalf)(HALF_FLOAT_MAX_BIASED_EXP) | (GLhalf)(mantissa >> 13); in floatToHalfFloat()
78 mantissa |= (1 << 23); in floatToHalfFloat()
81 mantissa >>= (14 + exp); in floatToHalfFloat()
83 mantissa = 0; in floatToHalfFloat()
[all …]
/aosp_15_r20/libcore/ojluni/src/main/java/jdk/internal/math/
H A DFormattedFloatingDecimal.java42 private char[] mantissa; field in FormattedFloatingDecimal
59 this.mantissa = fdConverter.toJavaFormatString().toCharArray(); in FormattedFloatingDecimal()
110 * Returns the mantissa as a {@code char[]}. Note that the returned value
111 * is a reference to the internal {@code char[]} containing the mantissa,
116 * mantissa.
119 return mantissa; in getMantissa()
179 * Fills mantissa and exponent char arrays for compatible format.
187 mantissa = create(isNegative, nDigits + extraZeros + 2); in fillCompatible()
188 System.arraycopy(digits, 0, mantissa, startIndex, nDigits); in fillCompatible()
189 Arrays.fill(mantissa, startIndex + nDigits, startIndex + nDigits + extraZeros, '0'); in fillCompatible()
[all …]
/aosp_15_r20/cts/tests/tests/renderscript/src/android/renderscript/cts/
H A DFloat16Utils.java28 // 16-bit masks for extracting sign, exponent and mantissa bits
41 // NaN has all exponent bits set to 1 and a non-zero mantissa
47 // Infinity has all exponent bits set to 1 and zeroes in mantissa
53 // Subnormal numbers have exponent bits set to 0 and a non-zero mantissa
74 // Extract sign, exponent and mantissa in convertFloat16ToFloat()
77 int mantissa = val & MANTISSA_MASK; in convertFloat16ToFloat() local
79 // 0.<mantissa> = <mantissa> * 2^-10 in convertFloat16ToFloat()
80 float mantissaAsFloat = Math.scalb(mantissa, -10); in convertFloat16ToFloat()
94 // value is 2^(exponent - 15) * 1.<mantissa> in convertFloat16ToFloat()
107 /* This utility function accepts the mantissa, exponent and an isNegative flag and constructs a
[all …]
/aosp_15_r20/external/llvm-libc/src/__support/FPUtil/
H A Ddyadic_float.h32 // exponent: the exponent value of the least significant bit of the mantissa.
33 // mantissa: unsigned integer of length `Bits`.
35 // real value = (-1)^sign * 2^exponent * (mantissa as unsigned integer)
36 // The stored data is normal if for non-zero mantissa, the leading bit is 1.
45 MantissaType mantissa = MantissaType(0); member
55 mantissa = MantissaType(x_bits.get_explicit_mantissa()); in DyadicFloat()
60 : sign(s), exponent(e), mantissa(m) { in DyadicFloat()
64 // Normalizing the mantissa, bringing the leading 1 bit to the most
67 if (!mantissa.is_zero()) { in normalize()
68 int shift_length = cpp::countl_zero(mantissa); in normalize()
[all …]
H A DNormalFloat.h28 // (-1)*sign * 2^exponent * <mantissa>
29 // where <mantissa> is of the form 1.<...>.
42 StorageType mantissa; member
43 // We want |StorageType| to have atleast one bit more than the actual mantissa
46 "Bad type for mantissa in NormalFloat.");
51 : exponent(e), mantissa(m), sign(s) { in NormalFloat()
52 if (mantissa >= ONE) in NormalFloat()
55 unsigned normalization_shift = evaluate_normalization_shift(mantissa); in NormalFloat()
56 mantissa <<= normalization_shift; in NormalFloat()
75 if (mantissa > other.mantissa) in cmp()
[all …]
/aosp_15_r20/prebuilts/go/linux-x86/src/strconv/
Datof.go11 // 3) Multiply by 2^precision and round to get mantissa.
171 // readFloat reads a decimal or hexadecimal mantissa and exponent from a float
175 func readFloat(s string) (mantissa uint64, exp int, neg, trunc, hex bool, i int, ok bool) {
229 mantissa *= base
230 mantissa += uint64(c - '0')
241 mantissa *= 16
242 mantissa += uint64(lower(c) - 'a' + 10)
299 if mantissa != 0 {
429 func atof64exact(mantissa uint64, exp int, neg bool) (f float64, ok bool) {
430 if mantissa>>float64info.mantbits != 0 {
[all …]
/aosp_15_r20/external/mesa3d/src/util/
H A Dformat_r11g11b10f.h68 int mantissa = f32.ui & 0x007fffff; in f32_to_uf11() local
78 if (mantissa) { in f32_to_uf11()
96 * Multiplying by 2^6=64 gives us our mantissa, plus an extra 1 which in f32_to_uf11()
99 mantissa = _mesa_lroundevenf(ldexp(val, 6 - exponent)); in f32_to_uf11()
100 if (mantissa >= 2 << UF11_EXPONENT_SHIFT) { in f32_to_uf11()
104 assert(mantissa == 2 << UF11_EXPONENT_SHIFT); in f32_to_uf11()
105 mantissa >>= 1; in f32_to_uf11()
108 assert((mantissa >> UF11_EXPONENT_SHIFT) == 1); in f32_to_uf11()
109 mantissa &= UF11_MANTISSA_BITS; in f32_to_uf11()
111 uf11 = UF11(exponent, mantissa); in f32_to_uf11()
[all …]
/aosp_15_r20/external/llvm-libc/src/__support/
H A Dstr_to_float.h47 typename fputil::FPBits<T>::StorageType mantissa; member
96 StorageType mantissa = init_num.mantissa; variable
111 uint32_t clz = cpp::countl_zero<StorageType>(mantissa);
112 mantissa <<= clz;
122 static_cast<UInt128>(mantissa) * static_cast<UInt128>(power_of_ten[1]);
128 // mantissa size) - 3 (we shift away the last two bits separately for
134 low64(first_approx) + mantissa < mantissa) {
136 static_cast<UInt128>(mantissa) * static_cast<UInt128>(power_of_ten[0]);
142 low64(low_bits) + mantissa < mantissa) {
193 output.mantissa = final_mantissa;
[all …]
/aosp_15_r20/external/mesa3d/src/amd/vpelib/src/utils/
H A Dcustom_fp16.c39 double mantissa; in build_custom_float() local
40 unsigned int Mantissa; in build_custom_float() local
86 mantissa = value - mantissaConstant; in build_custom_float()
88 if (mantissa < 0.0 || mantissa > 1.0) in build_custom_float()
89 mantissa = 0; in build_custom_float()
91 mantissa *= pow(2.0, fmt->mantissaBits); in build_custom_float()
93 Mantissa = (unsigned int)mantissa; in build_custom_float()
96 *pmantissa = Mantissa; in build_custom_float()
106 unsigned int exponent, unsigned int mantissa, uint16_t *pvalue) in setup_custom_float() argument
116 if (mantissa & ~(unsigned int)0xFFF) in setup_custom_float()
[all …]
/aosp_15_r20/external/vixl/src/
H A Dutils-vixl.cc150 uint16_t mantissa) { in Float16Pack() argument
151 uint16_t bits = (sign << 15) | (exp << 10) | mantissa; in Float16Pack()
156 float FloatPack(uint32_t sign, uint32_t exp, uint32_t mantissa) { in FloatPack() argument
157 uint32_t bits = (sign << 31) | (exp << 23) | mantissa; in FloatPack()
162 double DoublePack(uint64_t sign, uint64_t exp, uint64_t mantissa) { in DoublePack() argument
163 uint64_t bits = (sign << 63) | (exp << 52) | mantissa; in DoublePack()
175 uint16_t mantissa = bits & mantissa_mask; in Float16Classify() local
177 if (mantissa == 0) { in Float16Classify()
182 if (mantissa == 0) { in Float16Classify()
275 uint32_t mantissa = in FPToFloat() local
[all …]
/aosp_15_r20/external/OpenCL-CTS/test_conformance/conversions/
H A Dfplib.cpp51 uint32_t mantissa; in qcom_s64_2_f32() local
53 mantissa = (uint32_t)((uint64_t)data >> mantShift); in qcom_s64_2_f32()
55 mantissa = (uint32_t)((uint64_t)data << -mantShift); in qcom_s64_2_f32()
56 mantissa &= 0x7fffff;//mask off the leading 1 in qcom_s64_2_f32()
58 uint32_t result = exponent | mantissa; in qcom_s64_2_f32()
79 uint32_t mantissa; in qcom_s64_2_f32() local
84 mantissa = (uint32_t)temp; in qcom_s64_2_f32()
88 mantissa = (uint32_t)((uint64_t)data << -mantShift); in qcom_s64_2_f32()
90 mantissa &= 0x7fffff;//mask off the leading 1 in qcom_s64_2_f32()
92 uint32_t result = exponent | mantissa; in qcom_s64_2_f32()
[all …]
/aosp_15_r20/prebuilts/go/linux-x86/src/math/big/
Drat.go42 mantissa := bits & (1<<52 - 1)
50 mantissa |= 1 << 52
57 for mantissa&1 == 0 && shift > 0 {
58 mantissa >>= 1
62 z.a.SetUint64(mantissa)
82 // mantissa
106 // This is 2 or 3 more than the float32 mantissa field width of Msize:
125 mantissa := low32(q)
126 haveRem := len(r) > 0 // mantissa&1 && !haveRem => remainder is exactly half
130 if mantissa>>Msize2 == 1 {
[all …]
/aosp_15_r20/external/nanopb-c/examples/using_double_on_avr/
H A Ddouble_conversion.c22 uint64_t mantissa; in float_to_double() local
27 mantissa = in.i & 0x7FFFFF; in float_to_double()
36 if (!mantissa) in float_to_double()
44 mantissa <<= 1; in float_to_double()
45 while (!(mantissa & 0x800000)) in float_to_double()
47 mantissa <<= 1; in float_to_double()
50 mantissa &= 0x7FFFFF; in float_to_double()
55 mantissa <<= 29; in float_to_double()
56 mantissa |= (uint64_t)(exponent + 1023) << 52; in float_to_double()
57 mantissa |= (uint64_t)sign << 63; in float_to_double()
[all …]
/aosp_15_r20/external/openscreen/third_party/abseil/src/absl/strings/
H A Dcharconv.cc43 // has a fixed-width mantissa and power of two exponent. For example, a normal
44 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
53 // is represented as a subnormal with an all-bits-zero mantissa.)
55 // The code below, in calculations, represents the mantissa as a uint64_t. The
68 // The number of mantissa bits in the given float type. This includes the
72 // The largest supported IEEE exponent, in our integral mantissa
79 // The smallest supported IEEE normal exponent, in our integral mantissa
95 // This is intended to do the same operation as ldexp(mantissa, exponent),
102 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
106 static double Make(uint64_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/FP16/include/fp16/
H A Dfp16.h34 * S - sign bit, E - bits of the biased exponent, M - bits of the mantissa, 0 - zero bits. in fp16_ieee_to_fp32_bits()
47 * Extract mantissa and biased exponent of the input number into the bits 0-30 of the 32-bit word: in fp16_ieee_to_fp32_bits()
56 …* Renorm shift is the number of bits to shift mantissa left to make the half-precision number norm… in fp16_ieee_to_fp32_bits()
59 …* denormalized nonsign by renorm_shift, the unit bit of mantissa will shift into exponent, turning… in fp16_ieee_to_fp32_bits()
60 * biased exponent into 1, and making mantissa normalized (i.e. without leading 1). in fp16_ieee_to_fp32_bits()
88 …t nonsign right by 3 so the exponent (5 bits originally) becomes an 8-bit field and 10-bit mantissa in fp16_ieee_to_fp32_bits()
89 * shifts into the 10 high bits of the 23-bit mantissa of IEEE single-precision number. in fp16_ieee_to_fp32_bits()
95 …* 6. Binary ANDNOT with zero_mask to turn the mantissa and exponent into zero if the input was zer… in fp16_ieee_to_fp32_bits()
116 * S - sign bit, E - bits of the biased exponent, M - bits of the mantissa, 0 - zero bits. in fp16_ieee_to_fp32_value()
129 * Extract mantissa and biased exponent of the input number into the high bits of the 32-bit word: in fp16_ieee_to_fp32_value()
[all …]
/aosp_15_r20/external/rust/android-crates-io/crates/minimal-lexical/src/
Dlemire.rs18 // only if `mantissa + 1` produces a different result. We also avoid in lemire()
21 let mut fp = compute_float::<F>(num.exponent, num.mantissa); in lemire()
22 if num.many_digits && fp.exp >= 0 && fp != compute_float::<F>(num.exponent, num.mantissa + 1) { in lemire()
25 fp = compute_error::<F>(num.exponent, num.mantissa); in lemire()
90 let mut mantissa = hi >> (upperbit + 64 - F::MANTISSA_SIZE - 3); in compute_float() localVariable
98 mantissa >>= -power2 + 1; in compute_float()
99 mantissa += mantissa & 1; in compute_float()
100 mantissa >>= 1; in compute_float()
101 power2 = (mantissa >= (1_u64 << F::MANTISSA_SIZE)) as i32; in compute_float()
103 mant: mantissa, in compute_float()
[all …]
/aosp_15_r20/external/private-join-and-compute/third_party/abseil-cpp-20230125.2/absl/strings/
H A Dcharconv.cc44 // has a fixed-width mantissa and power of two exponent. For example, a normal
45 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
54 // is represented as a subnormal with an all-bits-zero mantissa.)
56 // The code below, in calculations, represents the mantissa as a uint64_t. The
77 // The number of mantissa bits in the given float type. This includes the
81 // The largest supported IEEE exponent, in our integral mantissa
88 // The smallest supported IEEE normal exponent, in our integral mantissa
129 // This is intended to do the same operation as ldexp(mantissa, exponent),
136 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
140 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/abseil-cpp/absl/strings/
H A Dcharconv.cc47 // has a fixed-width mantissa and power of two exponent. For example, a normal
48 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
57 // is represented as a subnormal with an all-bits-zero mantissa.)
59 // The code below, in calculations, represents the mantissa as a uint64_t. The
80 // The number of mantissa bits in the given float type. This includes the
84 // The largest supported IEEE exponent, in our integral mantissa
91 // The smallest supported IEEE normal exponent, in our integral mantissa
139 // This is intended to do the same operation as ldexp(mantissa, exponent),
146 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
150 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/angle/third_party/abseil-cpp/absl/strings/
H A Dcharconv.cc47 // has a fixed-width mantissa and power of two exponent. For example, a normal
48 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
57 // is represented as a subnormal with an all-bits-zero mantissa.)
59 // The code below, in calculations, represents the mantissa as a uint64_t. The
80 // The number of mantissa bits in the given float type. This includes the
84 // The largest supported IEEE exponent, in our integral mantissa
91 // The smallest supported IEEE normal exponent, in our integral mantissa
139 // This is intended to do the same operation as ldexp(mantissa, exponent),
146 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
150 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/webrtc/third_party/abseil-cpp/absl/strings/
H A Dcharconv.cc44 // has a fixed-width mantissa and power of two exponent. For example, a normal
45 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
54 // is represented as a subnormal with an all-bits-zero mantissa.)
56 // The code below, in calculations, represents the mantissa as a uint64_t. The
77 // The number of mantissa bits in the given float type. This includes the
81 // The largest supported IEEE exponent, in our integral mantissa
88 // The smallest supported IEEE normal exponent, in our integral mantissa
129 // This is intended to do the same operation as ldexp(mantissa, exponent),
136 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
140 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/cronet/third_party/abseil-cpp/absl/strings/
H A Dcharconv.cc47 // has a fixed-width mantissa and power of two exponent. For example, a normal
48 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
57 // is represented as a subnormal with an all-bits-zero mantissa.)
59 // The code below, in calculations, represents the mantissa as a uint64_t. The
80 // The number of mantissa bits in the given float type. This includes the
84 // The largest supported IEEE exponent, in our integral mantissa
91 // The smallest supported IEEE normal exponent, in our integral mantissa
139 // This is intended to do the same operation as ldexp(mantissa, exponent),
146 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
150 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/rust/android-crates-io/crates/grpcio-sys/grpc/third_party/abseil-cpp/absl/strings/
Dcharconv.cc44 // has a fixed-width mantissa and power of two exponent. For example, a normal
45 // `double` has a 53-bit mantissa. Because the high bit is always 1, it is not
54 // is represented as a subnormal with an all-bits-zero mantissa.)
56 // The code below, in calculations, represents the mantissa as a uint64_t. The
77 // The number of mantissa bits in the given float type. This includes the
81 // The largest supported IEEE exponent, in our integral mantissa
88 // The smallest supported IEEE normal exponent, in our integral mantissa
129 // This is intended to do the same operation as ldexp(mantissa, exponent),
136 // `mantissa` must either be exactly kTargetMantissaBits wide, in which case
140 static double Make(mantissa_t mantissa, int exponent, bool sign) { in Make()
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/tests/
H A Dreduce_precision_test.cc56 // - ty_{exponent,mantissa}_sizes tell us the different ways we will reduce the
62 // doing a reduce-precision with parameters ty_{exponent,mantissa}_sizes[j].
65 // operation_index == 0. This implies that ty_{exponent,mantissa}_sizes[0] must
66 // be equal to `ty`'s exponent/mantissa size, making the reduce-precision op
70 // mantissa/exponent, and a case that reduces both.
82 // more readable manner, separating out the exponent and mantissa.
83 #define F16VAL(EXPONENT, MANTISSA) ((EXPONENT << 10) + (MANTISSA)) argument
108 // Smallest value that doesn't underflow to zero, due to mantissa rounding
119 // mantissa/exponent, and a case that reduces both.
127 // more readable manner, separating out the exponent and mantissa.
[all …]

12345678910>>...72