diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/arch/amd64/gen/modf.S | 31 | ||||
-rw-r--r-- | lib/libc/arch/x86_64/gen/modf.S | 31 |
2 files changed, 28 insertions, 34 deletions
diff --git a/lib/libc/arch/amd64/gen/modf.S b/lib/libc/arch/amd64/gen/modf.S index 9e6c13b3cb4..44ef74ab668 100644 --- a/lib/libc/arch/amd64/gen/modf.S +++ b/lib/libc/arch/amd64/gen/modf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: modf.S,v 1.1 2004/01/28 01:44:45 mickey Exp $ */ +/* $OpenBSD: modf.S,v 1.2 2004/02/08 17:29:39 deraadt Exp $ */ /* $NetBSD: modf.S,v 1.1 2001/06/19 00:25:03 fvdl Exp $ */ /*- @@ -51,44 +51,41 @@ /* With CHOP mode on, frndint behaves as TRUNC does. Useful. */ ENTRY(modf) - pushq %rbp - movq %rsp,%rbp - subq $24,%rsp /* * Set chop mode. */ - fnstcw -12(%rbp) - movw -12(%rbp),%dx + fnstcw -12(%rsp) + movw -12(%rsp),%dx orw $3072,%dx - movw %dx,-16(%rbp) - fldcw -16(%rbp) + movw %dx,-16(%rsp) + fldcw -16(%rsp) /* * Get integral part. */ - movsd %xmm0,-24(%rbp) - fldl -24(%rbp) + movsd %xmm0,-24(%rsp) + fldl -24(%rsp) frndint - fstpl -8(%rbp) + fstpl -8(%rsp) /* * Restore control word. */ - fldcw -12(%rbp) + fldcw -12(%rsp) /* * Store integral part. */ - movsd -8(%rbp),%xmm0 + movsd -8(%rsp),%xmm0 movsd %xmm0,(%rdi) /* * Get fractional part and return it. */ - fldl -24(%rbp) - fsubl -8(%rbp) - movsd -8(%rbp),%xmm0 + fldl -24(%rsp) + fsubl -8(%rsp) + fstpl -8(%rsp) + movsd -8(%rsp),%xmm0 - leave ret diff --git a/lib/libc/arch/x86_64/gen/modf.S b/lib/libc/arch/x86_64/gen/modf.S index 9e6c13b3cb4..44ef74ab668 100644 --- a/lib/libc/arch/x86_64/gen/modf.S +++ b/lib/libc/arch/x86_64/gen/modf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: modf.S,v 1.1 2004/01/28 01:44:45 mickey Exp $ */ +/* $OpenBSD: modf.S,v 1.2 2004/02/08 17:29:39 deraadt Exp $ */ /* $NetBSD: modf.S,v 1.1 2001/06/19 00:25:03 fvdl Exp $ */ /*- @@ -51,44 +51,41 @@ /* With CHOP mode on, frndint behaves as TRUNC does. Useful. */ ENTRY(modf) - pushq %rbp - movq %rsp,%rbp - subq $24,%rsp /* * Set chop mode. */ - fnstcw -12(%rbp) - movw -12(%rbp),%dx + fnstcw -12(%rsp) + movw -12(%rsp),%dx orw $3072,%dx - movw %dx,-16(%rbp) - fldcw -16(%rbp) + movw %dx,-16(%rsp) + fldcw -16(%rsp) /* * Get integral part. */ - movsd %xmm0,-24(%rbp) - fldl -24(%rbp) + movsd %xmm0,-24(%rsp) + fldl -24(%rsp) frndint - fstpl -8(%rbp) + fstpl -8(%rsp) /* * Restore control word. */ - fldcw -12(%rbp) + fldcw -12(%rsp) /* * Store integral part. */ - movsd -8(%rbp),%xmm0 + movsd -8(%rsp),%xmm0 movsd %xmm0,(%rdi) /* * Get fractional part and return it. */ - fldl -24(%rbp) - fsubl -8(%rbp) - movsd -8(%rbp),%xmm0 + fldl -24(%rsp) + fsubl -8(%rsp) + fstpl -8(%rsp) + movsd -8(%rsp),%xmm0 - leave ret |