clarify the purpose of this project
[nyanglibc.git] / sunrpc / compat-xdr_mem.shared.s
blob604cf1a25d2947ad28af148620533546e9c743c7
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 xdrmem_destroy, @function
9 xdrmem_destroy:
10 rep ret
11 .size xdrmem_destroy, .-xdrmem_destroy
12 .p2align 4,,15
13 .type xdrmem_getpos, @function
14 xdrmem_getpos:
15 movq 24(%rdi), %rax
16 subq 32(%rdi), %rax
17 ret
18 .size xdrmem_getpos, .-xdrmem_getpos
19 .p2align 4,,15
20 .type xdrmem_setpos, @function
21 xdrmem_setpos:
22 movl 40(%rdi), %eax
23 movq 32(%rdi), %rdx
24 movl %esi, %esi
25 addq 24(%rdi), %rax
26 addq %rdx, %rsi
27 cmpq %rax, %rsi
28 ja .L6
29 cmpq %rsi, %rdx
30 jbe .L8
31 .L6:
32 xorl %eax, %eax
33 .L4:
34 rep ret
35 .p2align 4,,10
36 .p2align 3
37 .L8:
38 subq %rsi, %rax
39 movq %rax, %rdx
40 movl %eax, %ecx
41 xorl %eax, %eax
42 cmpq %rcx, %rdx
43 jne .L4
44 movq %rsi, 24(%rdi)
45 movl %edx, 40(%rdi)
46 movl $1, %eax
47 ret
48 .size xdrmem_setpos, .-xdrmem_setpos
49 .p2align 4,,15
50 .type xdrmem_inline, @function
51 xdrmem_inline:
52 movl 40(%rdi), %eax
53 cmpl %esi, %eax
54 jb .L11
55 subl %esi, %eax
56 movl %esi, %esi
57 movl %eax, 40(%rdi)
58 movq 24(%rdi), %rax
59 addq %rax, %rsi
60 movq %rsi, 24(%rdi)
61 ret
62 .p2align 4,,10
63 .p2align 3
64 .L11:
65 xorl %eax, %eax
66 ret
67 .size xdrmem_inline, .-xdrmem_inline
68 .p2align 4,,15
69 .type xdrmem_putint32, @function
70 xdrmem_putint32:
71 movl 40(%rdi), %edx
72 xorl %eax, %eax
73 cmpl $3, %edx
74 jbe .L12
75 subl $4, %edx
76 movq 24(%rdi), %rax
77 movl %edx, 40(%rdi)
78 movl (%rsi), %edx
79 addq $4, %rax
80 bswap %edx
81 movl %edx, -4(%rax)
82 movq %rax, 24(%rdi)
83 movl $1, %eax
84 .L12:
85 rep ret
86 .size xdrmem_putint32, .-xdrmem_putint32
87 .p2align 4,,15
88 .type xdrmem_getint32, @function
89 xdrmem_getint32:
90 movl 40(%rdi), %edx
91 xorl %eax, %eax
92 cmpl $3, %edx
93 jbe .L15
94 movq 24(%rdi), %rax
95 subl $4, %edx
96 movl %edx, 40(%rdi)
97 movl (%rax), %edx
98 addq $4, %rax
99 bswap %edx
100 movl %edx, (%rsi)
101 movq %rax, 24(%rdi)
102 movl $1, %eax
103 .L15:
104 rep ret
105 .size xdrmem_getint32, .-xdrmem_getint32
106 .p2align 4,,15
107 .type xdrmem_putlong, @function
108 xdrmem_putlong:
109 movl 40(%rdi), %edx
110 xorl %eax, %eax
111 cmpl $3, %edx
112 jbe .L18
113 subl $4, %edx
114 movq 24(%rdi), %rax
115 movl %edx, 40(%rdi)
116 movq (%rsi), %rdx
117 addq $4, %rax
118 bswap %edx
119 movl %edx, -4(%rax)
120 movq %rax, 24(%rdi)
121 movl $1, %eax
122 .L18:
123 rep ret
124 .size xdrmem_putlong, .-xdrmem_putlong
125 .p2align 4,,15
126 .type xdrmem_getlong, @function
127 xdrmem_getlong:
128 movl 40(%rdi), %edx
129 xorl %eax, %eax
130 cmpl $3, %edx
131 jbe .L21
132 subl $4, %edx
133 movl %edx, 40(%rdi)
134 movq 24(%rdi), %rdx
135 movl (%rdx), %eax
136 addq $4, %rdx
137 bswap %eax
138 cltq
139 movq %rax, (%rsi)
140 movq %rdx, 24(%rdi)
141 movl $1, %eax
142 .L21:
143 rep ret
144 .size xdrmem_getlong, .-xdrmem_getlong
145 .p2align 4,,15
146 .type xdrmem_putbytes, @function
147 xdrmem_putbytes:
148 movl 40(%rdi), %ecx
149 cmpl %edx, %ecx
150 jnb .L32
151 xorl %eax, %eax
153 .p2align 4,,10
154 .p2align 3
155 .L32:
156 pushq %rbp
157 pushq %rbx
158 subl %edx, %ecx
159 movq %rdi, %rbp
160 movl %edx, %ebx
161 subq $8, %rsp
162 movl %ecx, 40(%rdi)
163 movq 24(%rdi), %rdi
164 movq %rbx, %rdx
165 call __GI_memcpy@PLT
166 addq %rbx, 24(%rbp)
167 addq $8, %rsp
168 movl $1, %eax
169 popq %rbx
170 popq %rbp
172 .size xdrmem_putbytes, .-xdrmem_putbytes
173 .p2align 4,,15
174 .type xdrmem_getbytes, @function
175 xdrmem_getbytes:
176 movl 40(%rdi), %ecx
177 cmpl %edx, %ecx
178 jnb .L41
179 xorl %eax, %eax
181 .p2align 4,,10
182 .p2align 3
183 .L41:
184 pushq %rbp
185 pushq %rbx
186 movq %rsi, %rax
187 subl %edx, %ecx
188 movl %edx, %ebx
189 movq %rdi, %rbp
190 subq $8, %rsp
191 movq 24(%rdi), %rsi
192 movl %ecx, 40(%rdi)
193 movq %rbx, %rdx
194 movq %rax, %rdi
195 call __GI_memcpy@PLT
196 addq %rbx, 24(%rbp)
197 addq $8, %rsp
198 movl $1, %eax
199 popq %rbx
200 popq %rbp
202 .size xdrmem_getbytes, .-xdrmem_getbytes
203 .p2align 4,,15
204 .globl __GI_xdrmem_create
205 .hidden __GI_xdrmem_create
206 .type __GI_xdrmem_create, @function
207 __GI_xdrmem_create:
208 leaq xdrmem_ops(%rip), %rax
209 movl %ecx, (%rdi)
210 movq %rsi, 32(%rdi)
211 movq %rsi, 24(%rdi)
212 movl %edx, 40(%rdi)
213 movq %rax, 8(%rdi)
215 .size __GI_xdrmem_create, .-__GI_xdrmem_create
216 .globl xdrmem_create
217 .set xdrmem_create,__GI_xdrmem_create
218 .section .data.rel.ro.local,"aw",@progbits
219 .align 32
220 .type xdrmem_ops, @object
221 .size xdrmem_ops, 80
222 xdrmem_ops:
223 .quad xdrmem_getlong
224 .quad xdrmem_putlong
225 .quad xdrmem_getbytes
226 .quad xdrmem_putbytes
227 .quad xdrmem_getpos
228 .quad xdrmem_setpos
229 .quad xdrmem_inline
230 .quad xdrmem_destroy
231 .quad xdrmem_getint32
232 .quad xdrmem_putint32