clarify the purpose of this project
[nyanglibc.git] / time / clock.shared.s
blobd9fbad060e65c047ef3bfdcbc332a1b156999165
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl clock
9 .type clock, @function
10 clock:
11 subq $24, %rsp
12 movl $2, %edi
13 movq %rsp, %rsi
14 call __GI___clock_gettime
15 testl %eax, %eax
16 movq $-1, %rdx
17 jne .L1
18 movq 8(%rsp), %rsi
19 movabsq $2361183241434822607, %rdx
20 imulq $1000000, (%rsp), %rcx
21 movq %rsi, %rax
22 sarq $63, %rsi
23 imulq %rdx
24 sarq $7, %rdx
25 subq %rsi, %rdx
26 addq %rcx, %rdx
27 .L1:
28 movq %rdx, %rax
29 addq $24, %rsp
30 ret
31 .size clock, .-clock