Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: fusl/src/math/i386/hypot.s

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/math/i386/fmodl.s ('k') | fusl/src/math/i386/hypotf.s » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/math/i386/hypot.s
diff --git a/fusl/src/math/i386/hypot.s b/fusl/src/math/i386/hypot.s
new file mode 100644
index 0000000000000000000000000000000000000000..299c2e186cab4d9287e08e7eb79522790a35b6fc
--- /dev/null
+++ b/fusl/src/math/i386/hypot.s
@@ -0,0 +1,45 @@
+.global hypot
+.type hypot,@function
+hypot:
+ mov 8(%esp),%eax
+ mov 16(%esp),%ecx
+ add %eax,%eax
+ add %ecx,%ecx
+ and %eax,%ecx
+ cmp $0xffe00000,%ecx
+ jae 2f
+ or 4(%esp),%eax
+ jnz 1f
+ fldl 12(%esp)
+ fabs
+ ret
+1: mov 16(%esp),%eax
+ add %eax,%eax
+ or 12(%esp),%eax
+ jnz 1f
+ fldl 4(%esp)
+ fabs
+ ret
+1: fldl 4(%esp)
+ fld %st(0)
+ fmulp
+ fldl 12(%esp)
+ fld %st(0)
+ fmulp
+ faddp
+ fsqrt
+ ret
+2: sub $0xffe00000,%eax
+ or 4(%esp),%eax
+ jnz 1f
+ fldl 4(%esp)
+ fabs
+ ret
+1: mov 16(%esp),%eax
+ add %eax,%eax
+ sub $0xffe00000,%eax
+ or 12(%esp),%eax
+ fldl 12(%esp)
+ jnz 1f
+ fabs
+1: ret
« no previous file with comments | « fusl/src/math/i386/fmodl.s ('k') | fusl/src/math/i386/hypotf.s » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698