clarify the purpose of this project
[nyanglibc.git] / io / file_change_detection.s
blob6b35a8319398553d75a7811e1e08608fa4b04289
1 .text
2 .p2align 4,,15
3 .globl __file_is_unchanged
4 .hidden __file_is_unchanged
5 .type __file_is_unchanged, @function
6 __file_is_unchanged:
7 movq (%rdi), %rdx
8 xorl %eax, %eax
9 testq %rdx, %rdx
10 js .L1
11 movq (%rsi), %rcx
12 testq %rcx, %rcx
13 js .L1
14 testq %rdx, %rdx
15 jne .L3
16 testq %rcx, %rcx
17 sete %al
18 ret
19 .p2align 4,,10
20 .p2align 3
21 .L3:
22 cmpq %rcx, %rdx
23 jne .L1
24 movq 8(%rsi), %rcx
25 cmpq %rcx, 8(%rdi)
26 jne .L1
27 movq 16(%rsi), %rcx
28 cmpq %rcx, 16(%rdi)
29 jne .L1
30 movq 24(%rsi), %rcx
31 cmpq %rcx, 24(%rdi)
32 jne .L1
33 movq 32(%rsi), %rcx
34 cmpq %rcx, 32(%rdi)
35 jne .L1
36 movq 40(%rsi), %rax
37 cmpq %rax, 40(%rdi)
38 sete %al
39 .L1:
40 rep ret
41 .size __file_is_unchanged, .-__file_is_unchanged
42 .p2align 4,,15
43 .globl __file_change_detection_for_stat
44 .hidden __file_change_detection_for_stat
45 .type __file_change_detection_for_stat, @function
46 __file_change_detection_for_stat:
47 movl 24(%rsi), %eax
48 andl $61440, %eax
49 cmpl $16384, %eax
50 je .L18
51 cmpl $32768, %eax
52 je .L17
53 movq $-1, (%rdi)
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L17:
58 movq 48(%rsi), %rax
59 movdqu 88(%rsi), %xmm0
60 movq %rax, (%rdi)
61 movq 8(%rsi), %rax
62 movups %xmm0, 16(%rdi)
63 movdqu 104(%rsi), %xmm0
64 movq %rax, 8(%rdi)
65 movups %xmm0, 32(%rdi)
66 ret
67 .p2align 4,,10
68 .p2align 3
69 .L18:
70 movq $0, (%rdi)
71 ret
72 .size __file_change_detection_for_stat, .-__file_change_detection_for_stat
73 .p2align 4,,15
74 .globl __file_change_detection_for_path
75 .hidden __file_change_detection_for_path
76 .type __file_change_detection_for_path, @function
77 __file_change_detection_for_path:
78 pushq %rbx
79 movq %rdi, %rbx
80 movq %rsi, %rdi
81 subq $144, %rsp
82 movq %rsp, %rsi
83 call __stat64
84 testl %eax, %eax
85 je .L20
86 movq __libc_errno@gottpoff(%rip), %rax
87 movl %fs:(%rax), %edx
88 xorl %eax, %eax
89 cmpl $40, %edx
90 ja .L19
91 movabsq $1099514781702, %rcx
92 btq %rdx, %rcx
93 jc .L28
94 .L19:
95 addq $144, %rsp
96 popq %rbx
97 ret
98 .p2align 4,,10
99 .p2align 3
100 .L20:
101 movl 24(%rsp), %eax
102 andl $61440, %eax
103 cmpl $16384, %eax
104 je .L28
105 cmpl $32768, %eax
106 je .L23
107 movq $-1, (%rbx)
108 addq $144, %rsp
109 movl $1, %eax
110 popq %rbx
112 .p2align 4,,10
113 .p2align 3
114 .L28:
115 movq $0, (%rbx)
116 addq $144, %rsp
117 movl $1, %eax
118 popq %rbx
120 .p2align 4,,10
121 .p2align 3
122 .L23:
123 movq 48(%rsp), %rax
124 movdqu 88(%rsp), %xmm0
125 movq %rax, (%rbx)
126 movq 8(%rsp), %rax
127 movups %xmm0, 16(%rbx)
128 movdqu 104(%rsp), %xmm0
129 movq %rax, 8(%rbx)
130 movl $1, %eax
131 movups %xmm0, 32(%rbx)
132 jmp .L19
133 .size __file_change_detection_for_path, .-__file_change_detection_for_path
134 .p2align 4,,15
135 .globl __file_change_detection_for_fp
136 .hidden __file_change_detection_for_fp
137 .type __file_change_detection_for_fp, @function
138 __file_change_detection_for_fp:
139 testq %rsi, %rsi
140 je .L39
141 pushq %rbx
142 movq %rdi, %rbx
143 movq %rsi, %rdi
144 subq $144, %rsp
145 call __fileno
146 movq %rsp, %rsi
147 movl %eax, %edi
148 call __fstat64
149 movl %eax, %edx
150 xorl %eax, %eax
151 testl %edx, %edx
152 je .L40
153 .L29:
154 addq $144, %rsp
155 popq %rbx
157 .p2align 4,,10
158 .p2align 3
159 .L40:
160 movl 24(%rsp), %eax
161 andl $61440, %eax
162 cmpl $16384, %eax
163 je .L41
164 cmpl $32768, %eax
165 je .L34
166 movq $-1, (%rbx)
167 addq $144, %rsp
168 movl $1, %eax
169 popq %rbx
171 .p2align 4,,10
172 .p2align 3
173 .L39:
174 movq $0, (%rdi)
175 movl $1, %eax
177 .p2align 4,,10
178 .p2align 3
179 .L41:
180 movq $0, (%rbx)
181 movl $1, %eax
182 jmp .L29
183 .p2align 4,,10
184 .p2align 3
185 .L34:
186 movq 48(%rsp), %rax
187 movdqu 88(%rsp), %xmm0
188 movq %rax, (%rbx)
189 movq 8(%rsp), %rax
190 movups %xmm0, 16(%rbx)
191 movdqu 104(%rsp), %xmm0
192 movq %rax, 8(%rbx)
193 movl $1, %eax
194 movups %xmm0, 32(%rbx)
195 jmp .L29
196 .size __file_change_detection_for_fp, .-__file_change_detection_for_fp
197 .hidden __fstat64
198 .hidden __fileno
199 .hidden __stat64