summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/i386/cosh.S
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 16:48:04 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2003-02-18 16:48:04 +0000
commitc93f95560d3fde9eaefcc62c454c67b8b5626fa7 (patch)
tree28fc15161411de0c3693b3ac2551bb3dcef8c957 /mdk-stage1/dietlibc/i386/cosh.S
parent0e38e73d18120d339abc5f3b3faa8876d65de288 (diff)
downloaddrakx-backup-do-not-use-c93f95560d3fde9eaefcc62c454c67b8b5626fa7.tar
drakx-backup-do-not-use-c93f95560d3fde9eaefcc62c454c67b8b5626fa7.tar.gz
drakx-backup-do-not-use-c93f95560d3fde9eaefcc62c454c67b8b5626fa7.tar.bz2
drakx-backup-do-not-use-c93f95560d3fde9eaefcc62c454c67b8b5626fa7.tar.xz
drakx-backup-do-not-use-c93f95560d3fde9eaefcc62c454c67b8b5626fa7.zip
Merge in CVS dietlibc 0.21 for IA-64 and X86-64 support. However, drop the
following architectures we currently don't support: arm, mips, mipsel, parisc, s390, sparc64.
Diffstat (limited to 'mdk-stage1/dietlibc/i386/cosh.S')
-rw-r--r--mdk-stage1/dietlibc/i386/cosh.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/i386/cosh.S b/mdk-stage1/dietlibc/i386/cosh.S
new file mode 100644
index 000000000..f6a33704d
--- /dev/null
+++ b/mdk-stage1/dietlibc/i386/cosh.S
@@ -0,0 +1,29 @@
+
+.text
+.type cosh,@function
+.global cosh
+
+cosh: # note: exp(x) = 2^(x*log2(e))
+ fldl2e
+ fmull 4(%esp) # x*log2(e)
+ fld %st(0) # x*log2(e) x*log2(e)
+ frndint # int(x*log2(e)) x*log2(e)
+ fxch # x*log2(e) int(x*log2(e))
+ fsub %st(1),%st(0) # frac(x*log2(e)) int(x*log2(e))
+ f2xm1 # 2^(fract(x*log2(e)))-1 int(x*log2(e))
+ fld1 # 1 2^(fract(x*log2(e)))-1 int(x*log2(e))
+ faddp %st(0),%st(1) # 2^(fract(x*log2(e))) int(x*log2(e))
+ fscale # 2^(x*log2(e)) int(x*log2(e))
+ fstp %st(1) # 2^(x*log2(e))
+
+# now we have y = exp(x), but cosh(x) = (y + 1/y) * 0.5
+
+ fld1
+ fdiv %st(1),%st(0)
+ faddp
+ fmuls __half
+ ret
+
+.Lende:
+
+.size cosh,.ende-cosh