Lines Matching +full:- +full:m32
4 * Use of this source code is governed by a BSD-style license that can be
37 // Check all 8-bit exponents and all 10-bit upper mantissas, with a combination of all 0s,
47 (frac == 1) ? (1 << 13) - 1 // all 1s in lost fraction
54 // We want float->half and half->float to play well with infinities and max
55 // representable values in the 16-bit precision, but NaNs should have been caught ahead
68 uint32_t m32 = (uint32_t) bits & kF32_Mant; local
70 // Half floats can represent a real exponent from -14 to 15. Anything less than that would
72 int e = (int) (e32 >> 23) - kF32_Bias; // the true signed exponent
77 if (e < -kF16_Bias-10 || (e == -kF16_Bias-10 && m32 <= 0)) {
81 } else if ((e32 | m32) < 0x38fe'0000) {
82 // A subnormal non-zero f16 value
84 m16 = 0xffff & sk_bit_cast<uint32_t>(0.5f + SkBits2Float(e32 | m32));
85 } else if ((e32 | m32) < 0x3880'0000) {
86 // Rounds up to smallest normal f16 (2^-14)
99 m32 += 0xfff + ((m32>>13)&1);
101 if (m32 > kF32_Mant) {
106 m16 = m32 >> 13;
122 REPORTER_ASSERT(r, kF16_Sign == to_half(-0.f));
124 REPORTER_ASSERT(r, (kF16_Sign | SK_Half1) == to_half(-1.f));
139 // De-normal f16 or a zero = 2^-14 * 0.[m16] = 2^-14 * 2^-10 * [m16].0
142 expected *= -1.f;
152 // +/- infinity stays infinite
164 uint32_t e32 = ((e16 >> 10) + kF32_Bias - kF16_Bias) << 23;
165 uint32_t m32 = m16 << 13; local
167 float expected = SkBits2Float(s32 | e32 | m32);