File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,9 @@ T align_up(T value) { return ((value + ((1ull << N) - 1)) >> N) << N; }
2626template <typename T>
2727auto mips_multiplication (T x, T y) {
2828 using T2 = doubled_t <T>;
29+ using UT2 = unsign_t <T2>;
2930 using ReturnType = std::pair<unsign_t <T>, unsign_t <T>>;
30- auto value = static_cast <T2>(x) * static_cast <T2>(y);
31+ auto value = static_cast <UT2>( static_cast < T2>(x) * static_cast <T2>(y) );
3132 return ReturnType (value, value >> bitwidth<T>);
3233}
3334
@@ -37,8 +38,7 @@ auto mips_division(T x, T y) {
3738 if ( y == 0 )
3839 return ReturnType ();
3940
40- // NOLINTNEXTLINE(misc-suspicious-semicolon)
41- if constexpr ( !std::is_same_v<T, unsign_t <T>>) // signed type
41+ if constexpr ( !std::is_same_v<T, unsign_t <T>>) // signed type NOLINTNEXTLINE(misc-suspicious-semicolon)
4242 if ( y == -1 && x == static_cast <T>(msb_set<unsign_t <T>>())) // x86 has an exception here
4343 return ReturnType ();
4444
You can’t perform that action at this time.
0 commit comments