s_copysignf.S revision 1.7 1 1.1 jtc /*
2 1.5 salo * Written by J.T. Conklin <jtc (at) NetBSD.org>.
3 1.2 jtc * Public domain.
4 1.1 jtc */
5 1.1 jtc
6 1.1 jtc #include <machine/asm.h>
7 1.1 jtc
8 1.4 fvdl /*
9 1.4 fvdl * XXXfvdl split this file.
10 1.4 fvdl */
11 1.4 fvdl
12 1.7 joerg RCSID("$NetBSD: s_copysignf.S,v 1.7 2011/06/21 21:52:49 joerg Exp $")
13 1.4 fvdl
14 1.4 fvdl #ifdef __x86_64__
15 1.4 fvdl .Lneg:
16 1.4 fvdl .long 0x7fffffff
17 1.4 fvdl .Lpos:
18 1.4 fvdl .long 0x80000000
19 1.4 fvdl #endif
20 1.1 jtc
21 1.1 jtc ENTRY(copysignf)
22 1.4 fvdl #ifdef __i386__
23 1.1 jtc movl 8(%esp),%edx
24 1.1 jtc andl $0x80000000,%edx
25 1.1 jtc movl 4(%esp),%eax
26 1.1 jtc andl $0x7fffffff,%eax
27 1.1 jtc orl %edx,%eax
28 1.1 jtc movl %eax,4(%esp)
29 1.1 jtc flds 4(%esp)
30 1.4 fvdl #else
31 1.7 joerg movss .Lpos(%rip),%xmm2
32 1.7 joerg movss .Lneg(%rip),%xmm3
33 1.7 joerg pand %xmm2,%xmm1
34 1.7 joerg pand %xmm3,%xmm0
35 1.7 joerg por %xmm1,%xmm0
36 1.4 fvdl #endif
37 1.1 jtc ret
38