{ Subroutine to compute the inverse square root of x to single-precision (24 bits mantissa) using the 1/sqrt(x) approximation. X = isqrtsgl(Y) = 1/sqrtsgl(Y) Calling Registers F0 = Y Input Value F8 = 3.0 F1 = 0.5 Result Registers F0 = isqrtsgl(Y) Altered Registers F0, F4, F12 Computation Time 9 Cycles Version 0.02 7/6/90 Gordon A. Sterling } #include "asm_glob.h" .SEGMENT/PM Assembly_Library_Code_Space; .PRECISION=MACHINE_PRECISION; .GLOBAL isqrtsgl; isqrtsgl: F4=RSQRTS F0; {Fetch seed} F12=F4*F4; {F12=X0^2} F12=F12*F0; {F12=C*X0^2} F4=F1*F4, F12=F8-F12; {F4=.5*X0, F10=3-C*X0^2} F4=F4*F12; {F4=X1=.5*X0(3-C*X0^2)} F12=F4*F4; {F12=X1^2} RTS(DB), F12=F12*F0; {F12=C*X1^2} F4=F1*F4, F12=F8-F12; {F4=.5*X1, F10=3-C*X1^2} F0=F4*F12; {F4=X2=.5*X1(3-C*X1^2)} .ENDSEG;