diff --git a/src/common/fp/op/FPRecipEstimate.cpp b/src/common/fp/op/FPRecipEstimate.cpp index 991dd61e..c809a9c6 100644 --- a/src/common/fp/op/FPRecipEstimate.cpp +++ b/src/common/fp/op/FPRecipEstimate.cpp @@ -19,17 +19,18 @@ namespace Dynarmic::FP { +constexpr u64 lut_offset = 256; + /// Input is a u0.9 fixed point number. Only values in [0.5, 1.0) are valid. /// Output is a u0.8 fixed point number, with an implied 1 prefixed. /// i.e.: The output is a value in [1.0, 2.0). static u8 RecipEstimate(u64 a) { - constexpr u64 offset = 256; using LUT = std::array; static const LUT lut = [] { LUT result{}; for (u64 i = 0; i < result.size(); i++) { - u64 a = i + offset; + u64 a = i + lut_offset; a = a * 2 + 1; u64 b = (1u << 19) / a; @@ -38,7 +39,7 @@ static u8 RecipEstimate(u64 a) { return result; }(); - return lut[a - offset]; + return lut[a - lut_offset]; } template