clarify the purpose of this project
[nyanglibc.git] / time / clock.s
blobb0f71930f33965e33b873738f6a42e3d53965d74
1 .text
2 .p2align 4,,15
3 .globl clock
4 .type clock, @function
5 clock:
6 subq $24, %rsp
7 movl $2, %edi
8 movq %rsp, %rsi
9 call __clock_gettime
10 testl %eax, %eax
11 movq $-1, %rdx
12 jne .L1
13 movq 8(%rsp), %rsi
14 movabsq $2361183241434822607, %rdx
15 imulq $1000000, (%rsp), %rcx
16 movq %rsi, %rax
17 sarq $63, %rsi
18 imulq %rdx
19 sarq $7, %rdx
20 subq %rsi, %rdx
21 addq %rcx, %rdx
22 .L1:
23 movq %rdx, %rax
24 addq $24, %rsp
25 ret
26 .size clock, .-clock
27 .hidden __clock_gettime