File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Core/Libraries/Source/WWVegas/WWMath Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -602,21 +602,23 @@ WWINLINE int WWMath::Float_To_Int_Floor (const float& f)
602
602
// ----------------------------------------------------------------------------
603
603
604
604
#if defined(_MSC_VER) && defined(_M_IX86)
605
- WWINLINE __declspec (naked) float __fastcall WWMath::Inv_Sqrt(float a)
605
+ WWINLINE float __fastcall WWMath::Inv_Sqrt (float a)
606
606
{
607
+ float retval;
608
+
607
609
__asm {
608
610
mov eax, 0be6eb508h
609
611
mov DWORD PTR [esp-12 ],03fc00000h ; 1.5 on the stack
610
- sub eax, DWORD PTR [esp+ 4 ]; a
611
- sub DWORD PTR [esp+ 4 ], 800000h ; a/2 a=Y0
612
+ sub eax, DWORD PTR [a ]; a
613
+ sub DWORD PTR [a ], 800000h ; a/2 a=Y0
612
614
shr eax, 1 ; firs approx in eax=R0
613
615
mov DWORD PTR [esp-8 ], eax
614
616
615
617
fld DWORD PTR [esp-8 ] ;r
616
618
fmul st, st ;r*r
617
619
fld DWORD PTR [esp-8 ] ;r
618
620
fxch st (1 )
619
- fmul DWORD PTR [esp+ 4 ];a ;r*r*y0
621
+ fmul DWORD PTR [a ];a ;r*r*y0
620
622
fld DWORD PTR [esp-12 ];load 1.5
621
623
fld st (0 )
622
624
fsub st,st (2 ) ;r1 = 1.5 - y1
@@ -644,8 +646,11 @@ WWINLINE __declspec(naked) float __fastcall WWMath::Inv_Sqrt(float a)
644
646
;x3 = st (1 )
645
647
;r3 = st (0 )
646
648
fmulp st (1 ), st
647
- ret 4
649
+
650
+ fstp retval
648
651
}
652
+
653
+ return retval;
649
654
}
650
655
#else
651
656
WWINLINE float WWMath::Inv_Sqrt (float val)
You can’t perform that action at this time.
0 commit comments