64-bit multiplication. \param x first factor \param y second factor \return upper 32 bit of \a x * \a y rounded to nearest
| 1364 | /// \param y second factor |
| 1365 | /// \return upper 32 bit of \a x * \a y rounded to nearest |
| 1366 | inline uint32 multiply64(uint32 x, uint32 y) |
| 1367 | { |
| 1368 | #if HALF_ENABLE_CPP11_LONG_LONG |
| 1369 | return static_cast<uint32>((static_cast<unsigned long long>(x)*static_cast<unsigned long long>(y)+0x80000000)>>32); |
| 1370 | #else |
| 1371 | return mulhi<std::round_to_nearest>(x, y); |
| 1372 | #endif |
| 1373 | } |
| 1374 | |
| 1375 | /// 64-bit division. |
| 1376 | /// \param x upper 32 bit of dividend |