Home | History | Annotate | Line # | Download | only in i387
s_copysignf.S revision 1.6
      1 /*
      2  * Written by J.T. Conklin <jtc (at) NetBSD.org>.
      3  * Public domain.
      4  */
      5 
      6 #include <machine/asm.h>
      7 
      8 /*
      9  * XXXfvdl split this file.
     10  */
     11 
     12 RCSID("$NetBSD: s_copysignf.S,v 1.6 2011/06/18 20:49:26 joerg Exp $")
     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
     31 	movss	%xmm0,-4(%rsp)
     32 	movss	%xmm1,-8(%rsp)
     33 	movl	-8(%rsp),%edx
     34 	andl	$0x80000000,%edx
     35 	movl	-4(%rsp),%eax
     36 	andl	$0x7fffffff,%eax
     37 	orl	%edx,%eax
     38 	movl	%eax,-4(%rsp)
     39 	movss	-4(%rsp),%xmm0
     40 #endif
     41 	ret
     42