summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/i386/cos.S
blob: f95c81ca70000ccdedbbd3a02ead37455652ac51 (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
.text

.global cosf,cos,cosl
.type   cosf,@function
.type   cos,@function
.type   cosl,@function

cosf:
        flds    4(%esp)
	jmp 1f
cos:
        fldl    4(%esp)
1:
        fcos
	fnstsw	%ax
	testb	$0x04, %ah
	je 3f
	fldpi
	fadd	%st
	fxch	%st(1)
2:	fprem1
	fnstsw	%ax
	testb	$0x04, %ah
	jne	2b
	fstp	%st(1)
        fcos
3:	ret
cosl:
        fldt    4(%esp)
        jmp 1b

.Lende:
.size    cos,.Lende-cos
.size    cosl,.Lende-cosl
.size    cosf,.Lende-cosf