diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-04-08 22:30:42 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2009-04-08 22:30:42 +0000 |
commit | b614770f1cfeead5d0639ceb07a51056854cbeb3 (patch) | |
tree | f696e3438802d20ab246d8e96e02f11712edc45e | |
parent | d713073343b3f1e0d3b7aa7d9528f61a8ce62dd7 (diff) |
remove i386/x86_64 ifdefs. i386 lives @ i387. miod@ agrees
object code matches so this got to be oki
-rw-r--r-- | lib/libm/arch/amd64/abi.h | 28 | ||||
-rw-r--r-- | lib/libm/arch/amd64/e_sqrt.S | 7 | ||||
-rw-r--r-- | lib/libm/arch/amd64/e_sqrtf.S | 7 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_ceil.S | 22 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_ceilf.S | 22 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_copysign.S | 15 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_copysignf.S | 14 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_floor.S | 22 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_floorf.S | 22 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_ilogb.S | 17 | ||||
-rw-r--r-- | lib/libm/arch/amd64/s_ilogbf.S | 17 |
11 files changed, 10 insertions, 183 deletions
diff --git a/lib/libm/arch/amd64/abi.h b/lib/libm/arch/amd64/abi.h index cbfbd02c5f5..fdfc0517c16 100644 --- a/lib/libm/arch/amd64/abi.h +++ b/lib/libm/arch/amd64/abi.h @@ -14,8 +14,6 @@ * xmm regs to local variables. */ -#ifdef __x86_64__ - #define ARG_DOUBLE_ONE -8(%rsp) #define ARG_DOUBLE_TWO -16(%rsp) #define ARG_FLOAT_ONE -4(%rsp) @@ -45,29 +43,3 @@ #define FLDL_VAR(x) fldl x(%rip) -#else - -#define ARG_DOUBLE_ONE 4(%esp) -#define ARG_DOUBLE_TWO 12(%esp) -#define ARG_FLOAT_ONE 4(%esp) -#define ARG_FLOAT_TWO 8(%esp) - -#define XMM_ONE_ARG_DOUBLE_PROLOGUE -#define XMM_TWO_ARG_DOUBLE_PROLOGUE -#define XMM_ONE_ARG_FLOAT_PROLOGUE -#define XMM_TWO_ARG_FLOAT_PROLOGUE - -#define XMM_DOUBLE_EPILOGUE -#define XMM_FLOAT_EPILOGUE - -#ifdef PIC -#define FLDL_VAR(x) \ - PIC_PROLOGUE ; \ - fldl PIC_GOTOFF(x) ; \ - PIC_EPILOGUE -#else -#define FLDL_VAR(x) \ - fldl x - -#endif -#endif diff --git a/lib/libm/arch/amd64/e_sqrt.S b/lib/libm/arch/amd64/e_sqrt.S index 65f26380f0e..5b014868c9f 100644 --- a/lib/libm/arch/amd64/e_sqrt.S +++ b/lib/libm/arch/amd64/e_sqrt.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrt.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sqrt.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,10 +7,5 @@ #include <machine/asm.h> ENTRY(sqrt) -#ifdef __i386__ - fldl 4(%esp) - fsqrt -#else sqrtsd %xmm0,%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/e_sqrtf.S b/lib/libm/arch/amd64/e_sqrtf.S index 599358f70f8..50fd81b84a2 100644 --- a/lib/libm/arch/amd64/e_sqrtf.S +++ b/lib/libm/arch/amd64/e_sqrtf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: e_sqrtf.S,v 1.3 2008/09/07 20:36:08 martynas Exp $ */ +/* $OpenBSD: e_sqrtf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,10 +7,5 @@ #include <machine/asm.h> ENTRY(sqrtf) -#ifdef __i386__ - flds 4(%esp) - fsqrt -#else sqrtss %xmm0,%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/s_ceil.S b/lib/libm/arch/amd64/s_ceil.S index 6ab7aa350db..0208581bf4b 100644 --- a/lib/libm/arch/amd64/s_ceil.S +++ b/lib/libm/arch/amd64/s_ceil.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceil.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ceil.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -9,25 +9,6 @@ #include "abi.h" ENTRY(ceil) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $8,%esp - - fstcw -4(%ebp) /* store fpu control word */ - movw -4(%ebp),%dx - orw $0x0800,%dx /* round towards +oo */ - andw $0xfbff,%dx - movw %dx,-8(%ebp) - fldcw -8(%ebp) /* load modfied control word */ - - fldl 8(%ebp); /* round */ - frndint - - fldcw -4(%ebp) /* restore original control word */ - - leave -#else fstcw -12(%rsp) movw -12(%rsp),%dx orw $0x0800,%dx @@ -40,5 +21,4 @@ ENTRY(ceil) fldcw -12(%rsp) fstpl -8(%rsp) movsd -8(%rsp),%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/s_ceilf.S b/lib/libm/arch/amd64/s_ceilf.S index 8d726046ecf..a02291eed29 100644 --- a/lib/libm/arch/amd64/s_ceilf.S +++ b/lib/libm/arch/amd64/s_ceilf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ceilf.S,v 1.3 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ceilf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,25 +7,6 @@ #include <machine/asm.h> ENTRY(ceilf) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $8,%esp - - fstcw -4(%ebp) /* store fpu control word */ - movw -4(%ebp),%dx - orw $0x0800,%dx /* round towards +oo */ - andw $0xfbff,%dx - movw %dx,-8(%ebp) - fldcw -8(%ebp) /* load modfied control word */ - - flds 8(%ebp); /* round */ - frndint - - fldcw -4(%ebp) /* restore original control word */ - - leave -#else fstcw -8(%rsp) movw -8(%rsp),%dx orw $0x0800,%dx @@ -38,5 +19,4 @@ ENTRY(ceilf) fldcw -8(%rsp) fstps -4(%rsp) movss -4(%rsp),%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/s_copysign.S b/lib/libm/arch/amd64/s_copysign.S index 9f5064dd9c1..92efcac557c 100644 --- a/lib/libm/arch/amd64/s_copysign.S +++ b/lib/libm/arch/amd64/s_copysign.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysign.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_copysign.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -10,24 +10,12 @@ #include <machine/asm.h> -#ifdef __x86_64__ .Lpos: .quad 0x8000000000000000 .Lneg: .quad 0x7fffffffffffffff -#endif - ENTRY(copysign) -#ifdef __i386__ - movl 16(%esp),%edx - andl $0x80000000,%edx - movl 8(%esp),%eax - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,8(%esp) - fldl 4(%esp) -#else #if 0 /* * XXXfvdl gas doesn't grok this yet. @@ -48,5 +36,4 @@ ENTRY(copysign) movl %eax,-4(%rsp) movsd -8(%rsp),%xmm0 #endif -#endif ret diff --git a/lib/libm/arch/amd64/s_copysignf.S b/lib/libm/arch/amd64/s_copysignf.S index 3351be2f119..b0e29f8718f 100644 --- a/lib/libm/arch/amd64/s_copysignf.S +++ b/lib/libm/arch/amd64/s_copysignf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_copysignf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_copysignf.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -10,23 +10,12 @@ * XXXfvdl split this file. */ -#ifdef __x86_64__ .Lneg: .long 0x7fffffff .Lpos: .long 0x80000000 -#endif ENTRY(copysignf) -#ifdef __i386__ - movl 8(%esp),%edx - andl $0x80000000,%edx - movl 4(%esp),%eax - andl $0x7fffffff,%eax - orl %edx,%eax - movl %eax,4(%esp) - flds 4(%esp) -#else #if 0 /* * XXXfvdl gas doesn't grok this. @@ -48,5 +37,4 @@ ENTRY(copysignf) movl %eax,-4(%rsp) movss -4(%rsp),%xmm0 #endif -#endif ret diff --git a/lib/libm/arch/amd64/s_floor.S b/lib/libm/arch/amd64/s_floor.S index 433f3eca9a2..aa611f76940 100644 --- a/lib/libm/arch/amd64/s_floor.S +++ b/lib/libm/arch/amd64/s_floor.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floor.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_floor.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,25 +7,6 @@ #include <machine/asm.h> ENTRY(floor) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $8,%esp - - fstcw -4(%ebp) /* store fpu control word */ - movw -4(%ebp),%dx - orw $0x0400,%dx /* round towards -oo */ - andw $0xf7ff,%dx - movw %dx,-8(%ebp) - fldcw -8(%ebp) /* load modfied control word */ - - fldl 8(%ebp); /* round */ - frndint - - fldcw -4(%ebp) /* restore original control word */ - - leave -#else movsd %xmm0, -8(%rsp) fstcw -12(%rsp) movw -12(%rsp),%dx @@ -38,5 +19,4 @@ ENTRY(floor) fldcw -12(%rsp) fstpl -8(%rsp) movsd -8(%rsp),%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/s_floorf.S b/lib/libm/arch/amd64/s_floorf.S index 4159469991f..66bef665dd0 100644 --- a/lib/libm/arch/amd64/s_floorf.S +++ b/lib/libm/arch/amd64/s_floorf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_floorf.S,v 1.3 2007/04/20 21:12:31 martynas Exp $ */ +/* $OpenBSD: s_floorf.S,v 1.4 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,25 +7,6 @@ #include <machine/asm.h> ENTRY(floorf) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $8,%esp - - fstcw -4(%ebp) /* store fpu control word */ - movw -4(%ebp),%dx - orw $0x0400,%dx /* round towards -oo */ - andw $0xf7ff,%dx - movw %dx,-8(%ebp) - fldcw -8(%ebp) /* load modfied control word */ - - flds 8(%ebp); /* round */ - frndint - - fldcw -4(%ebp) /* restore original control word */ - - leave -#else movss %xmm0, -4(%rsp) fstcw -8(%rsp) movw -8(%rsp),%dx @@ -38,5 +19,4 @@ ENTRY(floorf) fldcw -8(%rsp) fstps -4(%rsp) movss -4(%rsp),%xmm0 -#endif ret diff --git a/lib/libm/arch/amd64/s_ilogb.S b/lib/libm/arch/amd64/s_ilogb.S index 5610ff29f9a..e8a512e3604 100644 --- a/lib/libm/arch/amd64/s_ilogb.S +++ b/lib/libm/arch/amd64/s_ilogb.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ilogb.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ilogb.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,25 +7,10 @@ #include <machine/asm.h> ENTRY(ilogb) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $4,%esp - - fldl 8(%ebp) - fxtract - fstp %st - - fistpl -4(%ebp) - movl -4(%ebp),%eax - - leave -#else movsd %xmm0,-8(%rsp) fldl -8(%rsp) fxtract fstp %st fistpl -8(%rsp) movl -8(%rsp),%eax -#endif ret diff --git a/lib/libm/arch/amd64/s_ilogbf.S b/lib/libm/arch/amd64/s_ilogbf.S index 0938585cc55..be0809536b9 100644 --- a/lib/libm/arch/amd64/s_ilogbf.S +++ b/lib/libm/arch/amd64/s_ilogbf.S @@ -1,4 +1,4 @@ -/* $OpenBSD: s_ilogbf.S,v 1.2 2005/08/02 11:17:31 espie Exp $ */ +/* $OpenBSD: s_ilogbf.S,v 1.3 2009/04/08 22:30:41 martynas Exp $ */ /* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. @@ -7,25 +7,10 @@ #include <machine/asm.h> ENTRY(ilogbf) -#ifdef __i386__ - pushl %ebp - movl %esp,%ebp - subl $4,%esp - - flds 8(%ebp) - fxtract - fstp %st - - fistpl -4(%ebp) - movl -4(%ebp),%eax - - leave -#else movss %xmm0,-4(%rsp) flds -4(%rsp) fxtract fstp %st fistpl -4(%rsp) movl -4(%rsp),%eax -#endif ret |