mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-10 17:10:00 +01:00
FPRSqrtEstimate: Deduplicate array bounds
Dehardcodes a few constants in the loops.
This commit is contained in:
parent
b7bd70fd19
commit
0a64a66b26
@ -22,9 +22,11 @@ namespace Dynarmic::FP {
|
|||||||
|
|
||||||
/// Input is a u1.8 fixed point number.
|
/// Input is a u1.8 fixed point number.
|
||||||
static u8 RecipSqrtEstimate(u64 a) {
|
static u8 RecipSqrtEstimate(u64 a) {
|
||||||
static const std::array<u8, 512> lut = []{
|
using LUT = std::array<u8, 512>;
|
||||||
std::array<u8, 512> result{};
|
|
||||||
for (u64 i = 128; i < 512; i++) {
|
static const LUT lut = [] {
|
||||||
|
LUT result{};
|
||||||
|
for (u64 i = 128; i < result.size(); i++) {
|
||||||
u64 a = i;
|
u64 a = i;
|
||||||
if (a < 256) {
|
if (a < 256) {
|
||||||
a = a * 2 + 1;
|
a = a * 2 + 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user