summaryrefslogtreecommitdiff
path: root/arch/x64/linux/math/log.S
blob: 9c5ed35d4e8e7f5b2e1c65bc83958cce05225e93 (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
	.text


// logf.
	.globl _D5tanya4math8nbtheory4logfFNaNbNiNffZf
	.type _D5tanya4math8nbtheory4logfFNaNbNiNffZf, @function

_D5tanya4math8nbtheory4logfFNaNbNiNffZf:
	movss %xmm0, -4(%rsp) // Put the argument onto the stack

	fldln2 // Put lb(e) onto the FPU stack
	flds -4(%rsp) // Put a float onto the FPU stack
	fyl2x // %st1 * lb(%st0)

	 // The result is on the FPU stack, but returned in %xmm0
	fstps -4(%rsp)
	movss -4(%rsp), %xmm0

	ret


// log.
	.globl _D5tanya4math8nbtheory3logFNaNbNiNfdZd
	.type _D5tanya4math8nbtheory3logFNaNbNiNfdZd, @function

_D5tanya4math8nbtheory3logFNaNbNiNfdZd:
	movsd %xmm0, -8(%rsp) // Put the argument onto the stack

	fldln2 // Put lb(e) onto the FPU stack
	fldl -8(%rsp) // Put a double onto the FPU stack
	fyl2x // %st1 * lb(%st0)

	 // The result is on the FPU stack, but returned in %xmm0
	fstpl -8(%rsp)
	movsd -8(%rsp), %xmm0

	ret


// logl.
	.globl _D5tanya4math8nbtheory4loglFNaNbNiNfeZe
	.type _D5tanya4math8nbtheory4loglFNaNbNiNfeZe, @function

_D5tanya4math8nbtheory4loglFNaNbNiNfeZe:
	fldln2 // Put lb(e) onto the FPU stack
	fldt 8(%rsp) // Put the argument onto the FPU stack
	fyl2x // %st1 * lb(%st0)
	ret