Merge pull request #7074 from lioncash/paired

Interpreter_LoadStorePaired: Simplify type aliases in QuantizeAndStore() and LoadAndDequantize()
This commit is contained in:
Léo Lam 2018-06-05 00:08:00 +02:00 committed by GitHub
commit b7a8deda96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -155,7 +155,8 @@ void WritePair<u32>(u32 val1, u32 val2, u32 addr)
template <typename T> template <typename T>
void QuantizeAndStore(double ps0, double ps1, u32 addr, u32 instW, u32 stScale) void QuantizeAndStore(double ps0, double ps1, u32 addr, u32 instW, u32 stScale)
{ {
typedef typename std::make_unsigned<T>::type U; using U = std::make_unsigned_t<T>;
U convPS0 = (U)ScaleAndClamp<T>(ps0, stScale); U convPS0 = (U)ScaleAndClamp<T>(ps0, stScale);
if (instW) if (instW)
{ {
@ -225,7 +226,8 @@ void Interpreter::Helper_Quantize(u32 addr, u32 instI, u32 instRS, u32 instW)
template <typename T> template <typename T>
std::pair<float, float> LoadAndDequantize(u32 addr, u32 instW, u32 ldScale) std::pair<float, float> LoadAndDequantize(u32 addr, u32 instW, u32 ldScale)
{ {
typedef typename std::make_unsigned<T>::type U; using U = std::make_unsigned_t<T>;
float ps0, ps1; float ps0, ps1;
if (instW) if (instW)
{ {