Home
last modified time | relevance | path

Searched refs:mantissa (Results 1 - 25 of 128) sorted by relevance

123456

/third_party/vk-gl-cts/external/openglcts/modules/common/
H A DglcMisc.cpp49 unsigned int mantissa; in floatToHalfFloat() local
53 /* get mantissa */ in floatToHalfFloat()
54 mantissa = x & ((1 << 23) - 1); in floatToHalfFloat()
60 if (mantissa && (exp == FLOAT_MAX_BIASED_EXP)) in floatToHalfFloat()
63 mantissa = (1 << 23) - 1; in floatToHalfFloat()
68 mantissa = 0; in floatToHalfFloat()
70 hf = (((GLhalf)sign) << 15) | (GLhalf)(HALF_FLOAT_MAX_BIASED_EXP) | (GLhalf)(mantissa >> 13); in floatToHalfFloat()
77 mantissa |= (1 << 23); in floatToHalfFloat()
80 mantissa >>= (14 + exp); in floatToHalfFloat()
82 mantissa in floatToHalfFloat()
110 unsigned int mantissa; floatToUnisgnedF11() local
191 unsigned int mantissa; floatToUnisgnedF10() local
260 unsigned int mantissa = (unsigned int)(hf & ((1 << 10) - 1)); halfFloatToFloat() local
310 unsigned int mantissa = (unsigned int)(f11 & ((1 << 6) - 1)); unsignedF11ToFloat() local
360 unsigned int mantissa = (unsigned int)(f10 & ((1 << 5) - 1)); unsignedF10ToFloat() local
[all...]
/third_party/vk-gl-cts/framework/delibs/debase/
H A DdeFloat16.c32 deUint32 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 deUint32 b = (mantissa >> t) & 1u; in deFloat32To16()
61 mantissa = (mantissa + a + b) >> t; in deFloat32To16()
64 return (deFloat16) (sign | mantissa); in deFloat32To16()
68 if (mantissa in deFloat32To16()
106 deUint64 mantissa; deFloat64To16() local
221 deUint32 mantissa; deFloat32To16Round() local
378 deUint64 mantissa; deFloat64To16Round() local
493 deUint32 mantissa; deFloat16To32() local
555 deUint64 mantissa; deFloat16To64() local
[all...]
H A DdeFloat16Test.c29 static float getFloat32 (deUint32 sign, deUint32 biased_exponent, deUint32 mantissa) in getFloat32() argument
37 x.u = (sign << 31) | (biased_exponent << 23) | mantissa; in getFloat32()
42 static deFloat16 getFloat16 (deUint16 sign, deUint16 biased_exponent, deUint16 mantissa) in getFloat16() argument
44 return (deFloat16) ((sign << 15) | (biased_exponent << 10) | mantissa); in getFloat16()
101 deUint32 mantissa = deRandom_getUint32(&rnd); in deFloat16_selfTest() local
103 mantissa &= 0x7fffffu; /* Take the last 23 bits */ in deFloat16_selfTest()
104 mantissa |= (mantissa == 0); /* Make sure it is not zero */ in deFloat16_selfTest()
106 DE_TEST_ASSERT(deFloat32To16RTZ(getFloat32(0, 0, mantissa)) == getFloat16(0, 0, 0)); in deFloat16_selfTest()
107 DE_TEST_ASSERT(deFloat32To16RTZ(getFloat32(1, 0, mantissa)) in deFloat16_selfTest()
120 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
164 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
181 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
223 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
241 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
325 deUint32 mantissa = deRandom_getUint32(&rnd); deFloat16_selfTest() local
[all...]
/third_party/mesa3d/src/util/
H A Dformat_r11g11b10f.h66 int mantissa = f32.ui & 0x007fffff; in f32_to_uf11() local
76 if (mantissa) { in f32_to_uf11()
94 mantissa >>= UF11_MANTISSA_SHIFT; in f32_to_uf11()
95 uf11 = exponent << UF11_EXPONENT_SHIFT | mantissa; in f32_to_uf11()
109 int mantissa = (val & 0x003f); in uf11_to_f32() local
114 if (mantissa != 0) { in uf11_to_f32()
116 f32.f = scale * mantissa; in uf11_to_f32()
119 f32.ui = F32_INFINITY | mantissa; in uf11_to_f32()
128 decimal = 1.0f + (float) mantissa / 64; in uf11_to_f32()
148 int mantissa in f32_to_uf10() local
191 int mantissa = (val & 0x001f); uf10_to_f32() local
[all...]
/third_party/rust/crates/minimal-lexical/src/
H A 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() variables
98 mantissa >>= -power2 + 1; in compute_float()
99 mantissa += mantissa & 1; in compute_float()
100 mantissa >>= 1; in compute_float()
101 power2 = (mantissa > in compute_float()
[all...]
H A Dnumber.rs19 /// The exponent of the float, scaled to the mantissa.
22 pub mantissa: u64,
33 && self.mantissa <= F::MAX_MANTISSA_FAST_PATH in is_fast_path()
40 /// a Decimal. This only works if both the mantissa and the exponent
59 let value = F::from_u64(self.mantissa); in try_fast_path()
72 let mantissa = self.mantissa.checked_mul(int_power)?; in try_fast_path()
73 if mantissa > F::MAX_MANTISSA_FAST_PATH { in try_fast_path()
77 F::from_u64(mantissa) * unsafe { F::pow_fast_path(max_exponent as _) } in try_fast_path()
H A Dslow.rs68 /// Generate the significant digits with a positive exponent relative to mantissa.
71 // Now, we can calculate the mantissa and the exponent from this. in positive_digit_comp()
72 // The binary exponent is the binary exponent for the mantissa in positive_digit_comp()
77 // hi64 checks **all** the remaining bits after the mantissa, in positive_digit_comp()
95 /// Generate the significant digits with a negative exponent relative to mantissa.
98 /// where `m1` is the bigint mantissa, `b` is the radix, and `N1` is the radix
100 /// is `m2 * 2^N2`, where `m2` is the bigint mantissa and `N2` is the binary
196 /// Add a temporary value to our mantissa.
261 /// Parse the full mantissa into a big integer.
263 /// Returns the parsed mantissa an
369 let mut mantissa = num.mantissa; scientific_exponent() variables
[all...]
/third_party/skia/third_party/externals/tint/src/writer/
H A Dfloat_to_string.cc59 // Some machines will modify the top bit in the mantissa of a NaN. in FloatToBitPreservingString()
100 uint32_t mantissa = float_bits & kMantissaMask; in FloatToBitPreservingString() local
105 if (mantissa == 0) { in FloatToBitPreservingString()
110 // Emit the mantissa bits as if they are left-justified after the in FloatToBitPreservingString()
113 // of the mantissa. in FloatToBitPreservingString()
114 mantissa <<= (4 - (kMantissaBits % 4)); in FloatToBitPreservingString()
116 while (0 == (0xf & mantissa)) { in FloatToBitPreservingString()
117 mantissa >>= 4; in FloatToBitPreservingString()
121 << std::setw(mantissaNibbles) << mantissa << "p+128"; in FloatToBitPreservingString()
125 TINT_ASSERT(Writer, mantissa ! in FloatToBitPreservingString()
[all...]
/third_party/mesa3d/src/asahi/compiler/
H A Dagx_minifloat.h31 * consisting of 3 bits for the exponent, 4 bits for the mantissa, and 1-bit
39 unsigned mantissa = (imm & 0xF); in agx_minifloat_decode() local
42 return ldexpf(sign * (float) (mantissa | 0x10), exp - 7); in agx_minifloat_decode()
44 return ldexpf(sign * ((float) mantissa), -6); in agx_minifloat_decode()
62 unsigned mantissa = (frac * 32.0); in agx_minifloat_encode() local
66 assert(mantissa >= 0x10 && mantissa < 0x20); in agx_minifloat_encode()
69 return sign | (exp << 4) | (mantissa & 0xF); in agx_minifloat_encode()
71 unsigned mantissa = (f * 64.0f); in agx_minifloat_encode() local
72 assert(mantissa < in agx_minifloat_encode()
[all...]
/third_party/skia/third_party/externals/dng_sdk/source/
H A Ddng_utils.h810 int32 mantissa = halfValue & 0x000003ff; in DNG_HalfToFloat() local
815 if (mantissa == 0) in DNG_HalfToFloat()
829 while (!(mantissa & 0x00000400)) in DNG_HalfToFloat()
831 mantissa <<= 1; in DNG_HalfToFloat()
836 mantissa &= ~0x00000400; in DNG_HalfToFloat()
845 if (mantissa == 0) in DNG_HalfToFloat()
868 mantissa <<= 13; in DNG_HalfToFloat()
870 // Assemble sign, exponent and mantissa. in DNG_HalfToFloat()
872 return (uint32) ((sign << 31) | (exponent << 23) | mantissa); in DNG_HalfToFloat()
883 int32 mantissa in DNG_FloatToHalf() local
981 int32 mantissa = (((int32) input [1]) << 8) | input[2]; DNG_FP24ToFloat() local
1053 int32 mantissa = input & 0x007FFFFF; DNG_FloatToFP24() local
[all...]
/third_party/vixl/src/
H A Dutils-vixl.cc150 uint16_t mantissa) { in Float16Pack()
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
148 Float16Pack(uint16_t sign, uint16_t exp, uint16_t mantissa) Float16Pack() argument
385 uint64_t mantissa = ExtractUnsignedBitfield64(51, 0, raw); FPToFloat() local
458 uint32_t mantissa = ExtractUnsignedBitfield32(22, 0, raw); FPToFloat16() local
513 uint64_t mantissa = ExtractUnsignedBitfield64(51, 0, raw); FPToFloat16() local
[all...]
/third_party/vk-gl-cts/external/amber/src/src/
H A Dfloat16_helper.cc22 // | exponent | mantissa |
26 // | exponent | mantissa |
30 // | s | exponent | mantissa |
34 // | s | exponent | mantissa |
57 // Return mantissa value of 32 bits float. Note that mantissa for 32
69 uint32_t mantissa = 0U; in HexFloat16ToFloat() local
73 mantissa = ((static_cast<uint32_t>(value[1]) & 0x3) << 8U | in HexFloat16ToFloat()
78 uint32_t hex = sign | exponent | mantissa; in HexFloat16ToFloat()
93 uint32_t mantissa in HexFloat11ToFloat() local
110 uint32_t mantissa = (static_cast<uint32_t>(value[0]) & 0x1f) << 18U; HexFloat10ToFloat() local
141 uint32_t mantissa = ((exponent == 0) ? 0U : FloatMantissa(*hex)); FloatToHexFloat16() local
[all...]
/third_party/skia/third_party/externals/abseil-cpp/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, in
239 uint64_t mantissa = 0; global() member
500 CalculatedFloatFromRawValues(uint64_t mantissa, int exponent) CalculatedFloatFromRawValues() argument
520 uint64_t mantissa = parsed_hex.mantissa; CalculateFromParsedHexadecimal() local
[all...]
/third_party/jerryscript/jerry-core/ecma/base/
H A Decma-helpers-number.c431 * Make Number of given sign from given mantissa value and binary exponent
438 uint64_t mantissa, /**< mantissa */ in ecma_number_make_from_sign_mantissa_and_exponent()
441 /* Rounding mantissa to fit into fraction field width */ in ecma_number_make_from_sign_mantissa_and_exponent()
442 if (mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) in ecma_number_make_from_sign_mantissa_and_exponent()
444 /* Rounded mantissa looks like the following: |00...0|1|fraction_width mantissa bits| */ in ecma_number_make_from_sign_mantissa_and_exponent()
445 while ((mantissa & ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH + 1)) - 1)) != 0) in ecma_number_make_from_sign_mantissa_and_exponent()
447 uint64_t rightmost_bit = (mantissa & 1); in ecma_number_make_from_sign_mantissa_and_exponent()
450 mantissa >> in ecma_number_make_from_sign_mantissa_and_exponent()
436 ecma_number_make_from_sign_mantissa_and_exponent(bool sign, uint64_t mantissa, int32_t exponent) ecma_number_make_from_sign_mantissa_and_exponent() argument
[all...]
/third_party/mesa3d/src/intel/compiler/
H A Dbrw_packed_float.c29 unsigned mantissa:23; member
44 unsigned mantissa = fu.s.mantissa >> (23 - 4); in brw_float_to_vf() local
46 unsigned vf = (fu.s.sign << 7) | (exponent << 4) | mantissa; in brw_float_to_vf()
52 /* Make sure the mantissa fits in 4-bits and the exponent in 3-bits. */ in brw_float_to_vf()
72 fu.s.mantissa = (vf & 0xf) << (23 - 4); in brw_vf_to_float()
/third_party/mesa3d/src/mesa/main/
H A Dquerymatrix.c27 * GLbitfield glQueryMatrixxOES( GLfixed mantissa[16],
29 * mantissa[16] contains the contents of the current matrix in GLfixed
32 * is close to mantissa[i] * 2^exponent[i]. The function returns a status
44 _mesa_QueryMatrixxOES(GLfixed *mantissa, GLint *exponent) in _mesa_QueryMatrixxOES() argument
110 mantissa[i] = FLOAT_TO_FIXED(normalizedFraction); in _mesa_QueryMatrixxOES()
125 mantissa[i] = INT_TO_FIXED(0); in _mesa_QueryMatrixxOES()
135 mantissa[i] = INT_TO_FIXED(1); in _mesa_QueryMatrixxOES()
138 mantissa[i] = -INT_TO_FIXED(1); in _mesa_QueryMatrixxOES()
148 mantissa[i] = INT_TO_FIXED(2); in _mesa_QueryMatrixxOES()
/third_party/rust/crates/minimal-lexical/etc/correctness/test-parse-random/
H A Druntests.py50 number has an odd mantissa (00...001) and thus half of that is rounded
54 mantissa (11...11), so that plus half an ULP is rounded up to the nearest
278 Turn a IEEE 754 binary64 into (mantissa, exponent), except 0.0 and
291 mantissa = low_bits
293 if mantissa == 0:
302 mantissa = low_bits | (1 << 52)
305 mantissa = -mantissa
306 return (mantissa, exponent)
311 Turn a IEEE 754 binary32 into (mantissa, exponen
[all...]
/third_party/node/deps/v8/src/codegen/arm64/
H A Dutils-arm64.cc44 float float_pack(uint32_t sign, uint32_t exp, uint32_t mantissa) { in float_pack() argument
46 return bit_cast<float>((bits << kFloatMantissaBits) | mantissa); in float_pack()
49 double double_pack(uint64_t sign, uint64_t exp, uint64_t mantissa) { in double_pack() argument
51 return bit_cast<double>((bits << kDoubleMantissaBits) | mantissa); in double_pack()
60 const uint16_t mantissa = value & mantissa_mask; in float16classify() local
62 if (mantissa == 0) { in float16classify()
67 if (mantissa == 0) { in float16classify()
/third_party/skia/third_party/externals/abseil-cpp/absl/strings/internal/str_format/
H A Dfloat_conversion.cc667 void FormatF(Int mantissa, int exp, const FormatState &state) { in FormatF() argument
669 const int total_bits = sizeof(Int) * 8 - LeadingZeros(mantissa) + exp; in FormatF()
674 return FormatFPositiveExpSlow(mantissa, exp, state); in FormatF()
680 return FormatFNegativeExpSlow(mantissa, -exp, state); in FormatF()
683 return FormatFFast(mantissa, exp, state); in FormatF()
733 // Given mantissa size, find optimal # of mantissa bits to put in initial digit.
736 // However, the question as to how many bits of the mantissa should be put into
738 // choose based on the size of the mantissa. E.g., for a `double`, there are 53
739 // mantissa bit
760 HexFloatNeedsRoundUp(Int mantissa, int final_nibble_displayed, uint8_t leading) HexFloatNeedsRoundUp() argument
804 FormatARound(bool precision_specified, const FormatState &state, uint8_t *leading, Int *mantissa, int *exp) FormatARound() argument
831 FormatANormalize(const HexFloatTypeParams float_traits, uint8_t *leading, Int *mantissa, int *exp) FormatANormalize() argument
856 FormatA(const HexFloatTypeParams float_traits, Int mantissa, int exp, bool uppercase, const FormatState &state) FormatA() argument
[all...]
/third_party/libsnd/tests/
H A Dulaw_test.c208 int sign, exponent, mantissa ; in ulaw_encode() local
221 mantissa = (sample >> (exponent + 3)) & 0x0F ; in ulaw_encode()
222 ulawbyte = ~ (sign | (exponent << 4) | mantissa) ; in ulaw_encode()
247 int sign, exponent, mantissa, sample ; in ulaw_decode() local
252 mantissa = ulawbyte & 0x0F ; in ulaw_decode()
253 sample = exp_lut [exponent] + (mantissa << (exponent + 3)) ; in ulaw_decode()
H A Dalaw_test.c194 int sign, exponent, mantissa ; in alaw_encode() local
207 mantissa = (sample >> (exponent + 3)) & 0x0F ; in alaw_encode()
208 Alawbyte = ((exponent << 4) | mantissa) ; in alaw_encode()
221 int sign, exponent, mantissa, sample ; in alaw_decode() local
228 mantissa = Alawbyte & 0x0F ; in alaw_decode()
229 sample = exp_lut [exponent] + (mantissa << (exponent + 3)) ; in alaw_decode()
/third_party/benchmark/src/
H A Dstring_util.cc35 std::string* mantissa, int64_t* exponent) { in ToExponentAndMantissa()
60 *mantissa = mantissa_stream.str(); in ToExponentAndMantissa()
75 *mantissa = mantissa_stream.str(); in ToExponentAndMantissa()
86 *mantissa = mantissa_stream.str(); in ToExponentAndMantissa()
103 std::string mantissa; in ToBinaryStringFullySpecified() local
106 one_k == Counter::kIs1024 ? 1024.0 : 1000.0, &mantissa, in ToBinaryStringFullySpecified()
108 return mantissa + ExponentToPrefix(exponent, one_k == Counter::kIs1024); in ToBinaryStringFullySpecified()
34 ToExponentAndMantissa(double val, int precision, double one_k, std::string* mantissa, int64_t* exponent) ToExponentAndMantissa() argument
/third_party/mesa3d/src/gallium/drivers/r300/compiler/
H A Dradeon_inline_literals.c39 * 22:0 mantissa
44 * 0:2 mantissa
51 unsigned mantissa = float_bits & 0x007fffff; in ieee_754_to_r300_float() local
66 if (mantissa & mantissa_mask) { in ieee_754_to_r300_float()
67 DBG("Failed mantissa has too many bits:\n" in ieee_754_to_r300_float()
68 "mantissa=0x%x mantissa_mask=0x%x, and=0x%x\n\n", in ieee_754_to_r300_float()
69 mantissa, mantissa_mask, in ieee_754_to_r300_float()
70 mantissa & mantissa_mask); in ieee_754_to_r300_float()
75 r300_mantissa = (mantissa & ~mantissa_mask) >> 20; in ieee_754_to_r300_float()
/third_party/rust/crates/minimal-lexical/tests/
H A Dnumber_tests.rs7 mantissa: 12345, in is_fast_path_test()
33 number.mantissa = 1 << 25; in is_fast_path_test()
38 number.mantissa = 1 << 54; in is_fast_path_test()
42 number.mantissa = 1 << 52; in is_fast_path_test()
55 mantissa: 12345, in try_fast_path_test()
/third_party/skia/third_party/externals/abseil-cpp/absl/strings/internal/
H A Dcharconv_parse.cc28 // ParseFloat<10> will read the first 19 significant digits of the mantissa.
31 // (a) First, for whatever integer type we choose to represent the mantissa, we
37 // mantissa we capture has more bits of resolution than the mantissa
48 // IEEE doubles, which we assume in Abseil, have 53 binary bits of mantissa.
53 // The lowest valued 19-digit decimal mantissa we can read still contains
54 // sufficient information to reconstruct a binary mantissa.
57 // ParseFloat<16> will read the first 15 significant digits of the mantissa.
61 // is required is to scan two more bits than the mantissa can represent, so that
96 // more consecutive significant mantissa digit
371 uint64_t mantissa = 0; ParseFloat() local
[all...]

Completed in 13 milliseconds

123456