Skip to content

Commit 2c76397

Browse files
author
Ingo Molnar
committed
x86: Clean up csum-copy_64.S a bit
The many stray whitespaces and other uncleanlinesses made this code almost unreadable to me - so fix those. No changes to the code. Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 0d2eb44 commit 2c76397

1 file changed

Lines changed: 120 additions & 120 deletions

File tree

‎arch/x86/lib/csum-copy_64.S‎

Lines changed: 120 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright 2002,2003 Andi Kleen, SuSE Labs.
3-
*
2+
* Copyright 2002, 2003 Andi Kleen, SuSE Labs.
3+
*
44
* This file is subject to the terms and conditions of the GNU General Public
55
* License. See the file COPYING in the main directory of this archive
66
* for more details. No warranty for anything given at all.
@@ -11,239 +11,239 @@
1111

1212
/*
1313
* Checksum copy with exception handling.
14-
* On exceptions src_err_ptr or dst_err_ptr is set to -EFAULT and the
14+
* On exceptions src_err_ptr or dst_err_ptr is set to -EFAULT and the
1515
* destination is zeroed.
16-
*
16+
*
1717
* Input
1818
* rdi source
1919
* rsi destination
2020
* edx len (32bit)
21-
* ecx sum (32bit)
21+
* ecx sum (32bit)
2222
* r8 src_err_ptr (int)
2323
* r9 dst_err_ptr (int)
2424
*
2525
* Output
2626
* eax 64bit sum. undefined in case of exception.
27-
*
28-
* Wrappers need to take care of valid exception sum and zeroing.
27+
*
28+
* Wrappers need to take care of valid exception sum and zeroing.
2929
* They also should align source or destination to 8 bytes.
3030
*/
3131

3232
.macro source
3333
10:
34-
.section __ex_table,"a"
34+
.section __ex_table, "a"
3535
.align 8
36-
.quad 10b,.Lbad_source
36+
.quad 10b, .Lbad_source
3737
.previous
3838
.endm
39-
39+
4040
.macro dest
4141
20:
42-
.section __ex_table,"a"
42+
.section __ex_table, "a"
4343
.align 8
44-
.quad 20b,.Lbad_dest
44+
.quad 20b, .Lbad_dest
4545
.previous
4646
.endm
47-
47+
4848
.macro ignore L=.Lignore
4949
30:
50-
.section __ex_table,"a"
50+
.section __ex_table, "a"
5151
.align 8
52-
.quad 30b,\L
52+
.quad 30b, \L
5353
.previous
5454
.endm
55-
56-
55+
56+
5757
ENTRY(csum_partial_copy_generic)
5858
CFI_STARTPROC
59-
cmpl $3*64,%edx
60-
jle .Lignore
59+
cmpl $3*64, %edx
60+
jle .Lignore
6161

62-
.Lignore:
63-
subq $7*8,%rsp
62+
.Lignore:
63+
subq $7*8, %rsp
6464
CFI_ADJUST_CFA_OFFSET 7*8
65-
movq %rbx,2*8(%rsp)
65+
movq %rbx, 2*8(%rsp)
6666
CFI_REL_OFFSET rbx, 2*8
67-
movq %r12,3*8(%rsp)
67+
movq %r12, 3*8(%rsp)
6868
CFI_REL_OFFSET r12, 3*8
69-
movq %r14,4*8(%rsp)
69+
movq %r14, 4*8(%rsp)
7070
CFI_REL_OFFSET r14, 4*8
71-
movq %r13,5*8(%rsp)
71+
movq %r13, 5*8(%rsp)
7272
CFI_REL_OFFSET r13, 5*8
73-
movq %rbp,6*8(%rsp)
73+
movq %rbp, 6*8(%rsp)
7474
CFI_REL_OFFSET rbp, 6*8
7575

76-
movq %r8,(%rsp)
77-
movq %r9,1*8(%rsp)
78-
79-
movl %ecx,%eax
80-
movl %edx,%ecx
76+
movq %r8, (%rsp)
77+
movq %r9, 1*8(%rsp)
8178

82-
xorl %r9d,%r9d
83-
movq %rcx,%r12
79+
movl %ecx, %eax
80+
movl %edx, %ecx
8481

85-
shrq $6,%r12
86-
jz .Lhandle_tail /* < 64 */
82+
xorl %r9d, %r9d
83+
movq %rcx, %r12
84+
85+
shrq $6, %r12
86+
jz .Lhandle_tail /* < 64 */
8787

8888
clc
89-
89+
9090
/* main loop. clear in 64 byte blocks */
9191
/* r9: zero, r8: temp2, rbx: temp1, rax: sum, rcx: saved length */
9292
/* r11: temp3, rdx: temp4, r12 loopcnt */
9393
/* r10: temp5, rbp: temp6, r14 temp7, r13 temp8 */
9494
.p2align 4
9595
.Lloop:
9696
source
97-
movq (%rdi),%rbx
97+
movq (%rdi), %rbx
9898
source
99-
movq 8(%rdi),%r8
99+
movq 8(%rdi), %r8
100100
source
101-
movq 16(%rdi),%r11
101+
movq 16(%rdi), %r11
102102
source
103-
movq 24(%rdi),%rdx
103+
movq 24(%rdi), %rdx
104104

105105
source
106-
movq 32(%rdi),%r10
106+
movq 32(%rdi), %r10
107107
source
108-
movq 40(%rdi),%rbp
108+
movq 40(%rdi), %rbp
109109
source
110-
movq 48(%rdi),%r14
110+
movq 48(%rdi), %r14
111111
source
112-
movq 56(%rdi),%r13
113-
112+
movq 56(%rdi), %r13
113+
114114
ignore 2f
115115
prefetcht0 5*64(%rdi)
116-
2:
117-
adcq %rbx,%rax
118-
adcq %r8,%rax
119-
adcq %r11,%rax
120-
adcq %rdx,%rax
121-
adcq %r10,%rax
122-
adcq %rbp,%rax
123-
adcq %r14,%rax
124-
adcq %r13,%rax
116+
2:
117+
adcq %rbx, %rax
118+
adcq %r8, %rax
119+
adcq %r11, %rax
120+
adcq %rdx, %rax
121+
adcq %r10, %rax
122+
adcq %rbp, %rax
123+
adcq %r14, %rax
124+
adcq %r13, %rax
125125

126126
decl %r12d
127-
127+
128128
dest
129-
movq %rbx,(%rsi)
129+
movq %rbx, (%rsi)
130130
dest
131-
movq %r8,8(%rsi)
131+
movq %r8, 8(%rsi)
132132
dest
133-
movq %r11,16(%rsi)
133+
movq %r11, 16(%rsi)
134134
dest
135-
movq %rdx,24(%rsi)
135+
movq %rdx, 24(%rsi)
136136

137137
dest
138-
movq %r10,32(%rsi)
138+
movq %r10, 32(%rsi)
139139
dest
140-
movq %rbp,40(%rsi)
140+
movq %rbp, 40(%rsi)
141141
dest
142-
movq %r14,48(%rsi)
142+
movq %r14, 48(%rsi)
143143
dest
144-
movq %r13,56(%rsi)
145-
144+
movq %r13, 56(%rsi)
145+
146146
3:
147-
148-
leaq 64(%rdi),%rdi
149-
leaq 64(%rsi),%rsi
150147

151-
jnz .Lloop
148+
leaq 64(%rdi), %rdi
149+
leaq 64(%rsi), %rsi
152150

153-
adcq %r9,%rax
151+
jnz .Lloop
152+
153+
adcq %r9, %rax
154154

155155
/* do last up to 56 bytes */
156156
.Lhandle_tail:
157157
/* ecx: count */
158-
movl %ecx,%r10d
159-
andl $63,%ecx
160-
shrl $3,%ecx
161-
jz .Lfold
158+
movl %ecx, %r10d
159+
andl $63, %ecx
160+
shrl $3, %ecx
161+
jz .Lfold
162162
clc
163163
.p2align 4
164-
.Lloop_8:
164+
.Lloop_8:
165165
source
166-
movq (%rdi),%rbx
167-
adcq %rbx,%rax
166+
movq (%rdi), %rbx
167+
adcq %rbx, %rax
168168
decl %ecx
169169
dest
170-
movq %rbx,(%rsi)
171-
leaq 8(%rsi),%rsi /* preserve carry */
172-
leaq 8(%rdi),%rdi
170+
movq %rbx, (%rsi)
171+
leaq 8(%rsi), %rsi /* preserve carry */
172+
leaq 8(%rdi), %rdi
173173
jnz .Lloop_8
174-
adcq %r9,%rax /* add in carry */
174+
adcq %r9, %rax /* add in carry */
175175

176176
.Lfold:
177177
/* reduce checksum to 32bits */
178-
movl %eax,%ebx
179-
shrq $32,%rax
180-
addl %ebx,%eax
181-
adcl %r9d,%eax
178+
movl %eax, %ebx
179+
shrq $32, %rax
180+
addl %ebx, %eax
181+
adcl %r9d, %eax
182182

183-
/* do last up to 6 bytes */
183+
/* do last up to 6 bytes */
184184
.Lhandle_7:
185-
movl %r10d,%ecx
186-
andl $7,%ecx
187-
shrl $1,%ecx
185+
movl %r10d, %ecx
186+
andl $7, %ecx
187+
shrl $1, %ecx
188188
jz .Lhandle_1
189-
movl $2,%edx
190-
xorl %ebx,%ebx
191-
clc
189+
movl $2, %edx
190+
xorl %ebx, %ebx
191+
clc
192192
.p2align 4
193-
.Lloop_1:
193+
.Lloop_1:
194194
source
195-
movw (%rdi),%bx
196-
adcl %ebx,%eax
195+
movw (%rdi), %bx
196+
adcl %ebx, %eax
197197
decl %ecx
198198
dest
199-
movw %bx,(%rsi)
200-
leaq 2(%rdi),%rdi
201-
leaq 2(%rsi),%rsi
199+
movw %bx, (%rsi)
200+
leaq 2(%rdi), %rdi
201+
leaq 2(%rsi), %rsi
202202
jnz .Lloop_1
203-
adcl %r9d,%eax /* add in carry */
204-
203+
adcl %r9d, %eax /* add in carry */
204+
205205
/* handle last odd byte */
206206
.Lhandle_1:
207-
testl $1,%r10d
207+
testl $1, %r10d
208208
jz .Lende
209-
xorl %ebx,%ebx
209+
xorl %ebx, %ebx
210210
source
211-
movb (%rdi),%bl
211+
movb (%rdi), %bl
212212
dest
213-
movb %bl,(%rsi)
214-
addl %ebx,%eax
215-
adcl %r9d,%eax /* carry */
216-
213+
movb %bl, (%rsi)
214+
addl %ebx, %eax
215+
adcl %r9d, %eax /* carry */
216+
217217
CFI_REMEMBER_STATE
218218
.Lende:
219-
movq 2*8(%rsp),%rbx
219+
movq 2*8(%rsp), %rbx
220220
CFI_RESTORE rbx
221-
movq 3*8(%rsp),%r12
221+
movq 3*8(%rsp), %r12
222222
CFI_RESTORE r12
223-
movq 4*8(%rsp),%r14
223+
movq 4*8(%rsp), %r14
224224
CFI_RESTORE r14
225-
movq 5*8(%rsp),%r13
225+
movq 5*8(%rsp), %r13
226226
CFI_RESTORE r13
227-
movq 6*8(%rsp),%rbp
227+
movq 6*8(%rsp), %rbp
228228
CFI_RESTORE rbp
229-
addq $7*8,%rsp
229+
addq $7*8, %rsp
230230
CFI_ADJUST_CFA_OFFSET -7*8
231231
ret
232232
CFI_RESTORE_STATE
233233

234234
/* Exception handlers. Very simple, zeroing is done in the wrappers */
235235
.Lbad_source:
236-
movq (%rsp),%rax
237-
testq %rax,%rax
236+
movq (%rsp), %rax
237+
testq %rax, %rax
238238
jz .Lende
239-
movl $-EFAULT,(%rax)
239+
movl $-EFAULT, (%rax)
240240
jmp .Lende
241-
241+
242242
.Lbad_dest:
243-
movq 8(%rsp),%rax
244-
testq %rax,%rax
245-
jz .Lende
246-
movl $-EFAULT,(%rax)
243+
movq 8(%rsp), %rax
244+
testq %rax, %rax
245+
jz .Lende
246+
movl $-EFAULT, (%rax)
247247
jmp .Lende
248248
CFI_ENDPROC
249249
ENDPROC(csum_partial_copy_generic)

0 commit comments

Comments
 (0)