diff options
author | Mystery Man <unknown@mandriva.org> | 2003-05-06 13:11:49 +0000 |
---|---|---|
committer | Mystery Man <unknown@mandriva.org> | 2003-05-06 13:11:49 +0000 |
commit | 3f5d21d90abbd16f16ab69aec1e1a1853a93fd18 (patch) | |
tree | 3d9f5a32303a8d97b4b457949e64bb42b4850ea9 /mdk-stage1/dietlibc/i386/pow.S | |
parent | 327bd24f8e4291bd1882de1990dd7339f781a9cb (diff) | |
download | drakx-backup-do-not-use-3f5d21d90abbd16f16ab69aec1e1a1853a93fd18.tar drakx-backup-do-not-use-3f5d21d90abbd16f16ab69aec1e1a1853a93fd18.tar.gz drakx-backup-do-not-use-3f5d21d90abbd16f16ab69aec1e1a1853a93fd18.tar.bz2 drakx-backup-do-not-use-3f5d21d90abbd16f16ab69aec1e1a1853a93fd18.tar.xz drakx-backup-do-not-use-3f5d21d90abbd16f16ab69aec1e1a1853a93fd18.zip |
This commit was manufactured by cvs2svn to create tag 'R9_0-AMD64'.R9_0-AMD64
Diffstat (limited to 'mdk-stage1/dietlibc/i386/pow.S')
-rw-r--r-- | mdk-stage1/dietlibc/i386/pow.S | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/i386/pow.S b/mdk-stage1/dietlibc/i386/pow.S new file mode 100644 index 000000000..46562a299 --- /dev/null +++ b/mdk-stage1/dietlibc/i386/pow.S @@ -0,0 +1,67 @@ +.text +.global pow +.type pow,@function + +# pow(x,y) +.global powf,pow,powl + .type powf,@function + .type pow,@function + .type powl,@function +powf: + flds 4(%esp) # x + flds 8(%esp) # y + jmp .L__pow +powl: + fldt 4(%esp) + fldt 16(%esp) + jmp .L__pow +pow: + fldl 4(%esp) + fldl 12(%esp) +# x^y; st(0)=y, st(1)=x +.L__pow: + ftst # y = 0 ? + fstsw %ax + fld1 # st(0)=1, st(1)=y, st(2)=x + sahf + jz 1f # return 1 + fcomp %st(1) # y = 1 ? + fstsw %ax + fxch # st(0)=x, st(1)=y + sahf + jz 1f # return x + ftst # x = 0 ? + fstsw %ax + sahf + jz 1f + jnc .Lfinpow # x > 0 + fxch # st(0)=y, st(1)=x + fld %st(0) # st(0)=y, st(1)=y, st(2)=x + frndint # st(0)=int(y) + fcomp %st(1) # y = int(y)? + fstsw %ax + fxch + sahf + jnz .Lfinpow # fyl2x -> st(0) = NaN +# y even or odd ? + fld1 + fadd %st(0) # st(0) = 2 + fdivr %st(2),%st(0) # st(0)=st(2)/2 + frndint + fadd %st(0),%st(0) + fcomp %st(2) # st(0) = x, st(1) = y + fstsw %ax + fchs # st(0) = -x + sahf + jz .Lfinpow # y even + call .Lfinpow # y odd + fchs +1: ret +.Lfinpow: + fyl2x + jmp __finexp + +.Lende: +.size pow,.Lende-pow +.size powf,.Lende-powf +.size powl,.Lende-powl |