mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-15 04:00:53 +00:00
engine: add klabs() back into ksqrtasm_old()
This commit is contained in:
parent
ba4eb3f906
commit
d28929c437
1 changed files with 7 additions and 4 deletions
|
@ -67,12 +67,15 @@ extern uint16_t sqrtable[4096], shlookup[4096+256],sqrtable_old[2048];
|
||||||
|
|
||||||
inline int32_t ksqrtasm_old(int32_t n)
|
inline int32_t ksqrtasm_old(int32_t n)
|
||||||
{
|
{
|
||||||
n = klabs(n);
|
uint32_t shift = 0;
|
||||||
int shift;
|
n = klabs((int32_t)n);
|
||||||
for (shift = 0; n >= 2048; n >>=2, shift++)
|
while (n >= 2048)
|
||||||
{
|
{
|
||||||
|
n >>= 2;
|
||||||
|
++shift;
|
||||||
}
|
}
|
||||||
return (sqrtable_old[n]<<shift)>>10;
|
uint32_t const s = sqrtable_old[n];
|
||||||
|
return (s << shift) >> 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int32_t clip_nsqrtasm(int32_t n)
|
inline int32_t clip_nsqrtasm(int32_t n)
|
||||||
|
|
Loading…
Reference in a new issue