* @brief Validate CPU floating point meets assumptions made in the codec. * * The codec is written with the assumption that float bit patterns are valid * IEEE754 values that are stored and reloaded with round-to-nearest rounding. * This is always the case in an IEEE-754 compliant system, however not every * system or compilation mode is actually IEEE-754 compliant. This normally * fails if
| 213 | * @return Return @c ASTCENC_SUCCESS if validated, an error on failure. |
| 214 | */ |
| 215 | static astcenc_error validate_cpu_float() |
| 216 | { |
| 217 | volatile float xprec_testval = 2.51f; |
| 218 | float store = xprec_testval + 12582912.0f; |
| 219 | float q = store - 12582912.0f; |
| 220 | |
| 221 | if (q != 3.0f) |
| 222 | { |
| 223 | return ASTCENC_ERR_BAD_CPU_FLOAT; |
| 224 | } |
| 225 | |
| 226 | return ASTCENC_SUCCESS; |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * @brief Validate config profile. |
no outgoing calls
no test coverage detected