summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/i386/copysign.S
blob: 6499ce05d1b7168ec69628c0049fba6d85a3d394 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Written by J.T. Conklin <jtc@netbsd.org>.
 * Public domain.
 */

#define _ERRNO_H	1
#include <features.h>
#include <bits/errno.h>

.text
.global copysign
.type   copysign,%function
copysign:
	movl	16(%esp),%edx
	movl	8(%esp),%eax
	andl	$0x80000000,%edx
	andl	$0x7fffffff,%eax
	orl	%edx,%eax
	movl	%eax,8(%esp)
	fldl	4(%esp)
	ret
.size copysign,.-copysign

libc_hidden_def(copysign)

.global copysignf
.type   copysignf,%function
copysignf:
	movl	8(%esp),%edx
	movl	4(%esp),%eax
	andl	$0x80000000,%edx
	andl	$0x7fffffff,%eax
	orl	%edx,%eax
	movl	%eax,4(%esp)
	flds	4(%esp)
	ret
.size copysignf,.-copysignf

libc_hidden_def(copysignf)

.global copysignl
.type   copysignl,%function
copysignl:
	movl	24(%esp),%edx
	movl	12(%esp),%eax
	andl	$0x8000,%edx
	andl	$0x7fff,%eax
	orl	%edx,%eax
	movl	%eax,12(%esp)
	fldt	4(%esp)
	ret
.size copysignl,.-copysignl

libc_hidden_def(copysignl)