clarify the purpose of this project
[nyanglibc.git] / stdlib / erand48_r.s
blobe294dc284b9eda837e9bdca02b3f859bdcef05ec
1 .text
2 .p2align 4,,15
3 .globl __erand48_r
4 .hidden __erand48_r
5 .type __erand48_r, @function
6 __erand48_r:
7 pushq %rbp
8 pushq %rbx
9 movq %rdi, %rbp
10 movq %rdx, %rbx
11 subq $24, %rsp
12 call __drand48_iterate
13 testl %eax, %eax
14 js .L3
15 movzwl 2(%rbp), %edx
16 movzwl 4(%rbp), %ecx
17 movl %edx, %eax
18 sall $4, %ecx
19 sall $20, %edx
20 shrw $12, %ax
21 movzwl %ax, %eax
22 orl %eax, %ecx
23 movzwl 0(%rbp), %eax
24 salq $32, %rcx
25 sall $4, %eax
26 orl %edx, %eax
27 movabsq $4607182418800017408, %rdx
28 orq %rdx, %rcx
29 orq %rax, %rcx
30 xorl %eax, %eax
31 movq %rcx, 8(%rsp)
32 movsd 8(%rsp), %xmm0
33 subsd .LC0(%rip), %xmm0
34 movsd %xmm0, (%rbx)
35 .L1:
36 addq $24, %rsp
37 popq %rbx
38 popq %rbp
39 ret
40 .p2align 4,,10
41 .p2align 3
42 .L3:
43 movl $-1, %eax
44 jmp .L1
45 .size __erand48_r, .-__erand48_r
46 .weak erand48_r
47 .set erand48_r,__erand48_r
48 .section .rodata.cst8,"aM",@progbits,8
49 .align 8
50 .LC0:
51 .long 0
52 .long 1072693248
53 .hidden __drand48_iterate