mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
Remove unnecessary code from Power-function.
Also, improve comments.
This commit is contained in:
parent
660da68a48
commit
405ef66b31
@ -206,21 +206,19 @@ go4kENVMap:
|
|||||||
; //----------------------------------------------------------------------------------------
|
; //----------------------------------------------------------------------------------------
|
||||||
; // Power function (2^x)
|
; // Power function (2^x)
|
||||||
; //----------------------------------------------------------------------------------------
|
; //----------------------------------------------------------------------------------------
|
||||||
; // Input : st0 : base
|
; // Input : st0 : x
|
||||||
; // st1 : exponent
|
; // Output: st0 : 2^x
|
||||||
; // Output: st0 : result
|
|
||||||
; //----------------------------------------------------------------------------------------
|
; //----------------------------------------------------------------------------------------
|
||||||
EXPORT MANGLE_FUNC(Power,0) ; // base exp
|
EXPORT MANGLE_FUNC(Power,0) ; x
|
||||||
fld1
|
fld1 ; 1 x
|
||||||
fadd st0
|
fld st1 ; x 1 x
|
||||||
fyl2x ; // log2_base
|
fprem ; mod(x,1) 1 x
|
||||||
fld1 ; // 1 log2_base
|
f2xm1 ; 2^mod(x,1)-1 1 x
|
||||||
fld st1 ; // log2_base 1 log2_base
|
faddp st1,st0 ; 2^mod(x,1) x
|
||||||
fprem ; // (frac)log2_base 1 log2_base
|
fscale ; 2^mod(x,1)*2^trunc(x) x
|
||||||
f2xm1 ; // 2 ^ '' - 1 1 log2_base
|
; Equal to:
|
||||||
faddp st1, st0 ; // 2 ^ '' (int)log2_base
|
; 2^x x
|
||||||
fscale
|
fstp st1 ; 2^x
|
||||||
fstp st1
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; //----------------------------------------------------------------------------------------
|
; //----------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user