| Commit | Line | Data |
|---|---|---|
| b34b60bc JS |
1 | /* |
| 2 | * Written by J.T. Conklin <jtc@NetBSD.org>. | |
| 3 | * Public domain. | |
| 4 | * | |
| 74dfd0cf | 5 | * $NetBSD: s_copysignf.S,v 1.7 2011/06/21 21:52:49 joerg Exp |
| b34b60bc JS |
6 | */ |
| 7 | ||
| 8 | #include <machine/asm.h> | |
| 9 | ||
| 10 | /* | |
| 11 | * XXXfvdl split this file. | |
| 12 | */ | |
| 13 | ||
| 14 | #ifdef __x86_64__ | |
| 15 | .Lneg: | |
| 16 | .long 0x7fffffff | |
| 17 | .Lpos: | |
| 18 | .long 0x80000000 | |
| 19 | #endif | |
| 20 | ||
| 21 | ENTRY(copysignf) | |
| 22 | #ifdef __i386__ | |
| 23 | movl 8(%esp),%edx | |
| 24 | andl $0x80000000,%edx | |
| 25 | movl 4(%esp),%eax | |
| 26 | andl $0x7fffffff,%eax | |
| 27 | orl %edx,%eax | |
| 28 | movl %eax,4(%esp) | |
| 29 | flds 4(%esp) | |
| 30 | #else | |
| 74dfd0cf JM |
31 | movss .Lpos(%rip),%xmm2 |
| 32 | movss .Lneg(%rip),%xmm3 | |
| 33 | pand %xmm2,%xmm1 | |
| 34 | pand %xmm3,%xmm0 | |
| 35 | por %xmm1,%xmm0 | |
| b34b60bc JS |
36 | #endif |
| 37 | ret | |
| d04e8698 | 38 | END(copysignf) |
| 70e34eb2 JM |
39 | |
| 40 | .section .note.GNU-stack,"",%progbits |