clarify the purpose of this project
[nyanglibc.git] / sunrpc / compat-xdr_stdio.shared.s
blobaa062c0c7b859aefea2c99a87206a205a6d3b87b
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .type xdrstdio_inline, @function
9 xdrstdio_inline:
10 xorl %eax, %eax
11 ret
12 .size xdrstdio_inline, .-xdrstdio_inline
13 .p2align 4,,15
14 .type xdrstdio_putint32, @function
15 xdrstdio_putint32:
16 subq $24, %rsp
17 movl (%rsi), %eax
18 movq 24(%rdi), %rcx
19 leaq 12(%rsp), %rdi
20 movl $1, %edx
21 movl $4, %esi
22 bswap %eax
23 movl %eax, 12(%rsp)
24 call __GI__IO_fwrite
25 cmpq $1, %rax
26 sete %al
27 addq $24, %rsp
28 movzbl %al, %eax
29 ret
30 .size xdrstdio_putint32, .-xdrstdio_putint32
31 .p2align 4,,15
32 .type xdrstdio_putlong, @function
33 xdrstdio_putlong:
34 subq $24, %rsp
35 movq (%rsi), %rax
36 movq 24(%rdi), %rcx
37 leaq 12(%rsp), %rdi
38 movl $1, %edx
39 movl $4, %esi
40 bswap %eax
41 movl %eax, 12(%rsp)
42 call __GI__IO_fwrite
43 cmpq $1, %rax
44 sete %al
45 addq $24, %rsp
46 movzbl %al, %eax
47 ret
48 .size xdrstdio_putlong, .-xdrstdio_putlong
49 .p2align 4,,15
50 .type xdrstdio_getint32, @function
51 xdrstdio_getint32:
52 pushq %rbx
53 movl $1, %edx
54 movq %rsi, %rbx
55 movl $4, %esi
56 subq $16, %rsp
57 movq 24(%rdi), %rcx
58 leaq 12(%rsp), %rdi
59 call __GI__IO_fread
60 xorl %edx, %edx
61 cmpq $1, %rax
62 jne .L7
63 movl 12(%rsp), %eax
64 movl $1, %edx
65 bswap %eax
66 movl %eax, (%rbx)
67 .L7:
68 addq $16, %rsp
69 movl %edx, %eax
70 popq %rbx
71 ret
72 .size xdrstdio_getint32, .-xdrstdio_getint32
73 .p2align 4,,15
74 .type xdrstdio_getlong, @function
75 xdrstdio_getlong:
76 pushq %rbx
77 movl $1, %edx
78 movq %rsi, %rbx
79 movl $4, %esi
80 subq $16, %rsp
81 movq 24(%rdi), %rcx
82 leaq 12(%rsp), %rdi
83 call __GI__IO_fread
84 xorl %edx, %edx
85 cmpq $1, %rax
86 jne .L12
87 movl 12(%rsp), %eax
88 movl $1, %edx
89 bswap %eax
90 movl %eax, %eax
91 movq %rax, (%rbx)
92 .L12:
93 addq $16, %rsp
94 movl %edx, %eax
95 popq %rbx
96 ret
97 .size xdrstdio_getlong, .-xdrstdio_getlong
98 .p2align 4,,15
99 .type xdrstdio_destroy, @function
100 xdrstdio_destroy:
101 movq 24(%rdi), %rdi
102 jmp __GI__IO_fflush
103 .size xdrstdio_destroy, .-xdrstdio_destroy
104 .p2align 4,,15
105 .type xdrstdio_setpos, @function
106 xdrstdio_setpos:
107 subq $8, %rsp
108 movq 24(%rdi), %rdi
109 movl %esi, %esi
110 xorl %edx, %edx
111 call __GI_fseek
112 notl %eax
113 addq $8, %rsp
114 shrl $31, %eax
116 .size xdrstdio_setpos, .-xdrstdio_setpos
117 .p2align 4,,15
118 .type xdrstdio_getpos, @function
119 xdrstdio_getpos:
120 subq $8, %rsp
121 movq 24(%rdi), %rdi
122 call __GI__IO_ftell
123 addq $8, %rsp
125 .size xdrstdio_getpos, .-xdrstdio_getpos
126 .p2align 4,,15
127 .type xdrstdio_putbytes, @function
128 xdrstdio_putbytes:
129 testl %edx, %edx
130 jne .L31
131 movl $1, %eax
133 .p2align 4,,10
134 .p2align 3
135 .L31:
136 subq $8, %rsp
137 movq 24(%rdi), %rcx
138 movq %rsi, %rax
139 movq %rax, %rdi
140 movslq %edx, %rsi
141 movl $1, %edx
142 call __GI__IO_fwrite
143 cmpq $1, %rax
144 sete %al
145 addq $8, %rsp
146 movzbl %al, %eax
148 .size xdrstdio_putbytes, .-xdrstdio_putbytes
149 .p2align 4,,15
150 .type xdrstdio_getbytes, @function
151 xdrstdio_getbytes:
152 testl %edx, %edx
153 jne .L41
154 movl $1, %eax
156 .p2align 4,,10
157 .p2align 3
158 .L41:
159 subq $8, %rsp
160 movq 24(%rdi), %rcx
161 movq %rsi, %rax
162 movq %rax, %rdi
163 movslq %edx, %rsi
164 movl $1, %edx
165 call __GI__IO_fread
166 cmpq $1, %rax
167 sete %al
168 addq $8, %rsp
169 movzbl %al, %eax
171 .size xdrstdio_getbytes, .-xdrstdio_getbytes
172 .p2align 4,,15
173 .globl __GI_xdrstdio_create
174 .hidden __GI_xdrstdio_create
175 .type __GI_xdrstdio_create, @function
176 __GI_xdrstdio_create:
177 leaq xdrstdio_ops(%rip), %rax
178 movl %edx, (%rdi)
179 movq %rsi, 24(%rdi)
180 movl $0, 40(%rdi)
181 movq $0, 32(%rdi)
182 movq %rax, 8(%rdi)
184 .size __GI_xdrstdio_create, .-__GI_xdrstdio_create
185 .globl xdrstdio_create
186 .set xdrstdio_create,__GI_xdrstdio_create
187 .section .data.rel.ro.local,"aw",@progbits
188 .align 32
189 .type xdrstdio_ops, @object
190 .size xdrstdio_ops, 80
191 xdrstdio_ops:
192 .quad xdrstdio_getlong
193 .quad xdrstdio_putlong
194 .quad xdrstdio_getbytes
195 .quad xdrstdio_putbytes
196 .quad xdrstdio_getpos
197 .quad xdrstdio_setpos
198 .quad xdrstdio_inline
199 .quad xdrstdio_destroy
200 .quad xdrstdio_getint32
201 .quad xdrstdio_putint32