33 if (
bits % (1 << 24) == 0) {
39 static constexpr int kTestCount = 2 * 255 * 1024 * 8;
41 for (
int i = 0;
i < kTestCount; ++
i) {
42 uint32_t
sign = (
i & 1) << 31;
43 uint32_t exp = ((
i >> 1) & 255) << 23;
44 uint32_t man = ((
i >> 9) & 1023) << 13;
45 uint32_t frac = ((
i >> 19) & 7);
46 uint64_t
bits =
sign | exp | man | ((frac == 0) ? 0 :
47 (frac == 1) ? (1 << 13) - 1
74 uint32_t s16 = s32 >> 16;
81 }
else if ((e32 | m32) < 0x38fe'0000) {
84 m16 = 0xffff & sk_bit_cast<uint32_t>(0.5f +
SkBits2Float(e32 | m32));
85 }
else if ((e32 | m32) < 0x3880'0000) {
99 m32 += 0xfff + ((m32>>13)&1);
111 uint16_t expected = s16 | e16 | m16;
140 float expected = (1.f / (1 << 14)) * (1.f / (1 << 10)) * m16;
163 uint32_t s32 = s16 << 16;
165 uint32_t m32 = m16 << 13;
static constexpr uint32_t kF16_Exp
static constexpr uint32_t kF32_Sign
static constexpr uint32_t kF32_Mant
static constexpr uint32_t kF16_Sign
static constexpr uint32_t kF32_Exp
static constexpr int kF32_Bias
static constexpr int kF16_Bias
static constexpr uint32_t kF16_Mant
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static float SkBits2Float(uint32_t bits)
static constexpr bool SkIsNaN(T x)
static constexpr uint16_t SK_HalfMax
static constexpr uint16_t SK_Half1
static constexpr uint16_t SK_HalfMin
static int sign(SkScalar x)
#define SK_ScalarInfinity
#define SK_ScalarNegativeInfinity
#define REPORTER_ASSERT(r, cond,...)
uint32_t nextBits(unsigned bitCount)
float HalfToFloat(uint16_t half)
SIN Vec< N, float > from_half(const Vec< N, uint16_t > &x)
SIN Vec< N, uint16_t > to_half(const Vec< N, float > &x)