1/* 2 * Written by J.T. Conklin <jtc@NetBSD.org>. 3 * Public domain. 4 */ 5 6/* 7 * XXXfvdl might as well split this file. 8 */ 9 10#include <machine/asm.h> 11 12RCSID("$NetBSD: s_copysign.S,v 1.7 2011/06/18 20:49:26 joerg Exp $") 13 14#ifdef __x86_64__ 15.Lpos: 16 .quad 0x8000000000000000 17.Lneg: 18 .quad 0x7fffffffffffffff 19#endif 20 21 22ENTRY(copysign) 23#ifdef __i386__ 24 movl 16(%esp),%edx 25 andl $0x80000000,%edx 26 movl 8(%esp),%eax 27 andl $0x7fffffff,%eax 28 orl %edx,%eax 29 movl %eax,8(%esp) 30 fldl 4(%esp) 31#else 32 movq .Lpos(%rip),%xmm2 33 movq .Lneg(%rip),%xmm3 34 pand %xmm2,%xmm1 35 pand %xmm3,%xmm0 36 por %xmm1,%xmm0 37#endif 38 ret 39