Lines Matching refs:rounded
1175 bool Simulator::set_fcsr_round_error(double original, double rounded) { in set_fcsr_round_error() argument
1180 if (!std::isfinite(original) || !std::isfinite(rounded)) { in set_fcsr_round_error()
1185 if (original != rounded) { in set_fcsr_round_error()
1189 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { in set_fcsr_round_error()
1194 if (rounded > max_int32 || rounded < min_int32) { in set_fcsr_round_error()
1207 bool Simulator::set_fcsr_round64_error(double original, double rounded) { in set_fcsr_round64_error() argument
1214 if (!std::isfinite(original) || !std::isfinite(rounded)) { in set_fcsr_round64_error()
1219 if (original != rounded) { in set_fcsr_round64_error()
1223 if (rounded < DBL_MIN && rounded > -DBL_MIN && rounded != 0) { in set_fcsr_round64_error()
1228 if (rounded >= max_int64 || rounded < min_int64) { in set_fcsr_round64_error()
1241 bool Simulator::set_fcsr_round_error(float original, float rounded) { in set_fcsr_round_error() argument
1246 if (!std::isfinite(original) || !std::isfinite(rounded)) { in set_fcsr_round_error()
1251 if (original != rounded) { in set_fcsr_round_error()
1255 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { in set_fcsr_round_error()
1260 if (rounded > max_int32 || rounded < min_int32) { in set_fcsr_round_error()
1271 float rounded) { in set_fpu_register_word_invalid_result() argument
1277 } else if (rounded > max_int32) { in set_fpu_register_word_invalid_result()
1279 } else if (rounded < min_int32) { in set_fpu_register_word_invalid_result()
1290 void Simulator::set_fpu_register_invalid_result(float original, float rounded) { in set_fpu_register_invalid_result() argument
1296 } else if (rounded > max_int32) { in set_fpu_register_invalid_result()
1298 } else if (rounded < min_int32) { in set_fpu_register_invalid_result()
1310 float rounded) { in set_fpu_register_invalid_result64() argument
1318 } else if (rounded >= max_int64) { in set_fpu_register_invalid_result64()
1320 } else if (rounded < min_int64) { in set_fpu_register_invalid_result64()
1332 double rounded) { in set_fpu_register_word_invalid_result() argument
1338 } else if (rounded > max_int32) { in set_fpu_register_word_invalid_result()
1340 } else if (rounded < min_int32) { in set_fpu_register_word_invalid_result()
1352 double rounded) { in set_fpu_register_invalid_result() argument
1358 } else if (rounded > max_int32) { in set_fpu_register_invalid_result()
1360 } else if (rounded < min_int32) { in set_fpu_register_invalid_result()
1372 double rounded) { in set_fpu_register_invalid_result64() argument
1380 } else if (rounded >= max_int64) { in set_fpu_register_invalid_result64()
1382 } else if (rounded < min_int64) { in set_fpu_register_invalid_result64()
1395 bool Simulator::set_fcsr_round64_error(float original, float rounded) { in set_fcsr_round64_error() argument
1402 if (!std::isfinite(original) || !std::isfinite(rounded)) { in set_fcsr_round64_error()
1407 if (original != rounded) { in set_fcsr_round64_error()
1411 if (rounded < FLT_MIN && rounded > -FLT_MIN && rounded != 0) { in set_fcsr_round64_error()
1416 if (rounded >= max_int64 || rounded < min_int64) { in set_fcsr_round64_error()
1428 void Simulator::round_according_to_fcsr(double toRound, double& rounded, in round_according_to_fcsr() argument
1445 rounded = std::floor(fs + 0.5); in round_according_to_fcsr()
1446 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1454 rounded = trunc(fs); in round_according_to_fcsr()
1455 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1458 rounded = std::ceil(fs); in round_according_to_fcsr()
1459 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1462 rounded = std::floor(fs); in round_according_to_fcsr()
1463 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1469 void Simulator::round64_according_to_fcsr(double toRound, double& rounded, in round64_according_to_fcsr() argument
1486 rounded = std::floor(fs + 0.5); in round64_according_to_fcsr()
1487 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1495 rounded = trunc(fs); in round64_according_to_fcsr()
1496 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1499 rounded = std::ceil(fs); in round64_according_to_fcsr()
1500 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1503 rounded = std::floor(fs); in round64_according_to_fcsr()
1504 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1511 void Simulator::round_according_to_fcsr(float toRound, float& rounded, in round_according_to_fcsr() argument
1528 rounded = std::floor(fs + 0.5); in round_according_to_fcsr()
1529 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1537 rounded = trunc(fs); in round_according_to_fcsr()
1538 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1541 rounded = std::ceil(fs); in round_according_to_fcsr()
1542 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1545 rounded = std::floor(fs); in round_according_to_fcsr()
1546 rounded_int = static_cast<int32_t>(rounded); in round_according_to_fcsr()
1552 void Simulator::round64_according_to_fcsr(float toRound, float& rounded, in round64_according_to_fcsr() argument
1569 rounded = std::floor(fs + 0.5); in round64_according_to_fcsr()
1570 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1578 rounded = trunc(fs); in round64_according_to_fcsr()
1579 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1582 rounded = std::ceil(fs); in round64_according_to_fcsr()
1583 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
1586 rounded = std::floor(fs); in round64_according_to_fcsr()
1587 rounded_int = static_cast<int64_t>(rounded); in round64_according_to_fcsr()
2617 float rounded; in DecodeTypeRegisterSRsType() local
2619 round64_according_to_fcsr(fs, rounded, result, fs); in DecodeTypeRegisterSRsType()
2621 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2622 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterSRsType()
2627 float rounded; in DecodeTypeRegisterSRsType() local
2629 round_according_to_fcsr(fs, rounded, result, fs); in DecodeTypeRegisterSRsType()
2631 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2632 set_fpu_register_word_invalid_result(fs, rounded); in DecodeTypeRegisterSRsType()
2637 float rounded = trunc(fs); in DecodeTypeRegisterSRsType() local
2638 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterSRsType()
2640 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2641 set_fpu_register_word_invalid_result(fs, rounded); in DecodeTypeRegisterSRsType()
2645 float rounded = trunc(fs); in DecodeTypeRegisterSRsType() local
2646 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterSRsType()
2648 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2649 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterSRsType()
2654 float rounded = std::floor(fs + 0.5); in DecodeTypeRegisterSRsType() local
2655 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterSRsType()
2662 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2663 set_fpu_register_word_invalid_result(fs, rounded); in DecodeTypeRegisterSRsType()
2668 float rounded = std::floor(fs + 0.5); in DecodeTypeRegisterSRsType() local
2669 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterSRsType()
2677 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2678 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterSRsType()
2683 float rounded = floor(fs); in DecodeTypeRegisterSRsType() local
2684 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterSRsType()
2686 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2687 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterSRsType()
2693 float rounded = std::floor(fs); in DecodeTypeRegisterSRsType() local
2694 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterSRsType()
2696 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2697 set_fpu_register_word_invalid_result(fs, rounded); in DecodeTypeRegisterSRsType()
2702 float rounded = std::ceil(fs); in DecodeTypeRegisterSRsType() local
2703 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterSRsType()
2705 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2706 set_fpu_register_invalid_result(fs, rounded); in DecodeTypeRegisterSRsType()
2710 float rounded = ceil(fs); in DecodeTypeRegisterSRsType() local
2711 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterSRsType()
2713 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterSRsType()
2714 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterSRsType()
2972 double rounded; in DecodeTypeRegisterDRsType() local
2974 round_according_to_fcsr(fs, rounded, result, fs); in DecodeTypeRegisterDRsType()
2976 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
2977 set_fpu_register_word_invalid_result(fs, rounded); in DecodeTypeRegisterDRsType()
2983 double rounded = std::floor(fs + 0.5); in DecodeTypeRegisterDRsType() local
2984 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterDRsType()
2991 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
2992 set_fpu_register_invalid_result(fs, rounded); in DecodeTypeRegisterDRsType()
2997 double rounded = trunc(fs); in DecodeTypeRegisterDRsType() local
2998 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterDRsType()
3000 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3001 set_fpu_register_invalid_result(fs, rounded); in DecodeTypeRegisterDRsType()
3006 double rounded = std::floor(fs); in DecodeTypeRegisterDRsType() local
3007 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterDRsType()
3009 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3010 set_fpu_register_invalid_result(fs, rounded); in DecodeTypeRegisterDRsType()
3015 double rounded = std::ceil(fs); in DecodeTypeRegisterDRsType() local
3016 int32_t result = static_cast<int32_t>(rounded); in DecodeTypeRegisterDRsType()
3018 if (set_fcsr_round_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3019 set_fpu_register_invalid_result(fs, rounded); in DecodeTypeRegisterDRsType()
3026 double rounded; in DecodeTypeRegisterDRsType() local
3028 round64_according_to_fcsr(fs, rounded, result, fs); in DecodeTypeRegisterDRsType()
3030 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3031 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterDRsType()
3036 double rounded = std::floor(fs + 0.5); in DecodeTypeRegisterDRsType() local
3037 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterDRsType()
3045 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3046 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterDRsType()
3051 double rounded = trunc(fs); in DecodeTypeRegisterDRsType() local
3052 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterDRsType()
3054 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3055 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterDRsType()
3060 double rounded = floor(fs); in DecodeTypeRegisterDRsType() local
3061 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterDRsType()
3063 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3064 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterDRsType()
3069 double rounded = ceil(fs); in DecodeTypeRegisterDRsType() local
3070 int64_t result = static_cast<int64_t>(rounded); in DecodeTypeRegisterDRsType()
3072 if (set_fcsr_round64_error(fs, rounded)) { in DecodeTypeRegisterDRsType()
3073 set_fpu_register_invalid_result64(fs, rounded); in DecodeTypeRegisterDRsType()