diff options
author | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:44:09 +0000 |
---|---|---|
committer | Gwenolé Beauchesne <gbeauchesne@mandriva.org> | 2003-06-04 18:44:09 +0000 |
commit | 4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b (patch) | |
tree | acd4001a266a8713495af7f1b2102b61e67113b0 /mdk-stage1/dietlibc/i386/cbrt.S | |
parent | 71b111ec6c4671667a19c6fbe0023d33422535d7 (diff) | |
download | drakx-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar drakx-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.gz drakx-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.bz2 drakx-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.tar.xz drakx-4cd6a4a5d7e49d54d53dcf4a6f3393d50bd88e8b.zip |
Import dietlibc 0.22 + other fixes for AMD64
Diffstat (limited to 'mdk-stage1/dietlibc/i386/cbrt.S')
-rw-r--r-- | mdk-stage1/dietlibc/i386/cbrt.S | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/i386/cbrt.S b/mdk-stage1/dietlibc/i386/cbrt.S new file mode 100644 index 000000000..9d8aebd1e --- /dev/null +++ b/mdk-stage1/dietlibc/i386/cbrt.S @@ -0,0 +1,46 @@ +.text + +tab: .byte 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4 + .byte 4, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9 + .byte 10,10,11,11,12,12,12,13,13,14,14,14,15,15,15,16 + +_3: .long 0x40400000 + + +.global cbrt +cbrt: + fldl 4(%esp) + movw 10(%esp),%ax + movb %ah,%ch + andw $0x7FFF,%ax + jz zero /* cbrt(0) = 0 */ + pushl %ebx + cwd + movl $16*3,%ebx /* AX 3FE0 3FF0 4000 4010 */ + divw %bx /* AX 154 155 155 155 */ + /* DX 20 0 10 20 */ + shlw $5,%ax + addb %ch,%ch + rcrw %ax /* AX 1540 1550 1550 1550 */ + addw $0x3FF0-0x1550,%ax /* AX 3FE0 3FF0 3FF0 3FF0 */ + movw %dx,%bx + addb tab(%ebx),%al + adcb $0,%ah + popl %ebx + movw %ax,10(%esp) + fldl 4(%esp) /* y x */ + + movl $4,%ecx +lop: + fld %st(0) /* y y x */ + fmul %st(0),%st(0) /* y^2 y x */ + fdivr %st(2),%st(0) /* x/y^2 y x */ + fadd %st(1),%st(0) /* x/y^2+y y x */ + faddp /* x/y^2+2y x */ + fdivs _3 /* y' x */ + loop lop + + fstp %st(1) /* y' */ +zero: + ret + |