* @brief Extract mantissa and exponent of a float value. * * @param a The input value. * @param[out] exp The output exponent. * * @return The mantissa. */
| 540 | * @return The mantissa. |
| 541 | */ |
| 542 | static ASTCENC_SIMD_INLINE vfloat4 frexp(vfloat4 a, vint4& exp) |
| 543 | { |
| 544 | // Interpret the bits as an integer |
| 545 | vint4 ai = float_as_int(a); |
| 546 | |
| 547 | // Extract and unbias the exponent |
| 548 | exp = (lsr<23>(ai) & 0xFF) - 126; |
| 549 | |
| 550 | // Extract and unbias the mantissa |
| 551 | vint4 manti = (ai & static_cast<int>(0x807FFFFF)) | 0x3F000000; |
| 552 | return int_as_float(manti); |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * @brief Convert float to 16-bit LNS. |
no test coverage detected