2019-05-27 09:55:01 +03:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2005-09-26 10:04:21 +04:00
/ *
* This f i l e c o n t a i n s a s s e m b l y - l a n g u a g e i m p l e m e n t a t i o n s
* of I P - s t y l e 1 ' s c o m p l e m e n t c h e c k s u m r o u t i n e s .
*
* Copyright ( C ) 1 9 9 5 - 1 9 9 6 G a r y T h o m a s ( g d t @linuxppc.org)
*
* Severely h a c k e d a b o u t b y P a u l M a c k e r r a s ( p a u l u s @cs.anu.edu.au).
* /
# include < l i n u x / s y s . h >
# include < a s m / p r o c e s s o r . h >
2015-09-22 17:34:27 +03:00
# include < a s m / c a c h e . h >
2005-09-26 10:04:21 +04:00
# include < a s m / e r r n o . h >
# include < a s m / p p c _ a s m . h >
2016-01-14 07:33:46 +03:00
# include < a s m / e x p o r t . h >
2005-09-26 10:04:21 +04:00
.text
/ *
* computes t h e c h e c k s u m o f a m e m o r y b l o c k a t b u f f , l e n g t h l e n ,
* and a d d s i n " s u m " ( 3 2 - b i t )
*
2016-03-07 20:44:37 +03:00
* _ _ csum_ p a r t i a l ( b u f f , l e n , s u m )
2005-09-26 10:04:21 +04:00
* /
2016-03-07 20:44:37 +03:00
_ GLOBAL( _ _ c s u m _ p a r t i a l )
2005-09-26 10:04:21 +04:00
subi r3 ,r3 ,4
2015-09-22 17:34:29 +03:00
srawi. r6 ,r4 ,2 / * D i v i d e l e n b y 4 a n d a l s o c l e a r c a r r y * /
2005-09-26 10:04:21 +04:00
beq 3 f / * i f w e ' r e d o i n g < 4 b y t e s * /
2015-09-22 17:34:29 +03:00
andi. r0 ,r3 ,2 / * A l i g n b u f f e r t o l o n g w o r d b o u n d a r y * /
2005-09-26 10:04:21 +04:00
beq+ 1 f
2015-09-22 17:34:29 +03:00
lhz r0 ,4 ( r3 ) / * d o 2 b y t e s t o g e t a l i g n e d * /
2005-09-26 10:04:21 +04:00
subi r4 ,r4 ,2
2015-09-22 17:34:29 +03:00
addi r3 ,r3 ,2
2005-09-26 10:04:21 +04:00
srwi. r6 ,r4 ,2 / * # w o r d s t o d o * /
2015-09-22 17:34:29 +03:00
adde r5 ,r5 ,r0
2005-09-26 10:04:21 +04:00
beq 3 f
2015-09-22 17:34:32 +03:00
1 : andi. r6 ,r6 ,3 / * P r e p a r e t o h a n d l e w o r d s 4 b y 4 * /
beq 2 1 f
mtctr r6
2015-09-22 17:34:29 +03:00
2 : lwzu r0 ,4 ( r3 )
adde r5 ,r5 ,r0
2005-09-26 10:04:21 +04:00
bdnz 2 b
2015-09-22 17:34:32 +03:00
21 : srwi. r6 ,r4 ,4 / * # b l o c k s o f 4 w o r d s t o d o * /
beq 3 f
2018-05-24 14:22:27 +03:00
lwz r0 ,4 ( r3 )
2015-09-22 17:34:32 +03:00
mtctr r6
lwz r6 ,8 ( r3 )
2018-05-24 14:22:27 +03:00
adde r5 ,r5 ,r0
2015-09-22 17:34:32 +03:00
lwz r7 ,1 2 ( r3 )
2018-05-24 14:22:27 +03:00
adde r5 ,r5 ,r6
2015-09-22 17:34:32 +03:00
lwzu r8 ,1 6 ( r3 )
2018-05-24 14:22:27 +03:00
adde r5 ,r5 ,r7
bdz 2 3 f
22 : lwz r0 ,4 ( r3 )
adde r5 ,r5 ,r8
lwz r6 ,8 ( r3 )
2015-09-22 17:34:32 +03:00
adde r5 ,r5 ,r0
2018-05-24 14:22:27 +03:00
lwz r7 ,1 2 ( r3 )
2015-09-22 17:34:32 +03:00
adde r5 ,r5 ,r6
2018-05-24 14:22:27 +03:00
lwzu r8 ,1 6 ( r3 )
2015-09-22 17:34:32 +03:00
adde r5 ,r5 ,r7
bdnz 2 2 b
2018-05-24 14:22:27 +03:00
23 : adde r5 ,r5 ,r8
2015-09-22 17:34:29 +03:00
3 : andi. r0 ,r4 ,2
beq+ 4 f
lhz r0 ,4 ( r3 )
2005-09-26 10:04:21 +04:00
addi r3 ,r3 ,2
2015-09-22 17:34:29 +03:00
adde r5 ,r5 ,r0
4 : andi. r0 ,r4 ,1
beq+ 5 f
lbz r0 ,4 ( r3 )
slwi r0 ,r0 ,8 / * U p p e r b y t e o f w o r d * /
adde r5 ,r5 ,r0
5 : addze r3 ,r5 / * a d d i n f i n a l c a r r y * /
2005-09-26 10:04:21 +04:00
blr
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( _ _ c s u m _ p a r t i a l )
2005-09-26 10:04:21 +04:00
/ *
* Computes t h e c h e c k s u m o f a m e m o r y b l o c k a t s r c , l e n g t h l e n ,
2020-07-20 17:09:24 +03:00
* and a d d s i n 0 x f f f f f f f f , w h i l e c o p y i n g t h e b l o c k t o d s t .
* If a n a c c e s s e x c e p t i o n o c c u r s i t r e t u r n s z e r o .
2005-09-26 10:04:21 +04:00
*
2020-07-20 17:09:24 +03:00
* csum_ p a r t i a l _ c o p y _ g e n e r i c ( s r c , d s t , l e n )
2005-09-26 10:04:21 +04:00
* /
2015-09-22 17:34:27 +03:00
# define C S U M _ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( n ) \
8 # # n ## 0 : \
lwz r7 ,4 ( r4 ) ; \
8 # # n ## 1 : \
lwz r8 ,8 ( r4 ) ; \
8 # # n ## 2 : \
lwz r9 ,1 2 ( r4 ) ; \
8 # # n ## 3 : \
lwzu r10 ,1 6 ( r4 ) ; \
8 # # n ## 4 : \
stw r7 ,4 ( r6 ) ; \
adde r12 ,r12 ,r7 ; \
8 # # n ## 5 : \
stw r8 ,8 ( r6 ) ; \
adde r12 ,r12 ,r8 ; \
8 # # n ## 6 : \
stw r9 ,1 2 ( r6 ) ; \
adde r12 ,r12 ,r9 ; \
8 # # n ## 7 : \
stwu r10 ,1 6 ( r6 ) ; \
adde r12 ,r12 ,r10
# define C S U M _ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( n ) \
2020-07-20 17:09:24 +03:00
EX_ T A B L E ( 8 ## n # # 0 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 1 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 2 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 3 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 4 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 5 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 6 b , f a u l t ) ; \
EX_ T A B L E ( 8 ## n # # 7 b , f a u l t ) ;
2015-09-22 17:34:27 +03:00
.text
.stabs " arch/ p o w e r p c / l i b / " ,N _ S O ,0 ,0 ,0 f
.stabs " checksum_ 3 2 . S " ,N _ S O ,0 ,0 ,0 f
0 :
CACHELINE_ B Y T E S = L 1 _ C A C H E _ B Y T E S
LG_ C A C H E L I N E _ B Y T E S = L 1 _ C A C H E _ S H I F T
CACHELINE_ M A S K = ( L 1 _ C A C H E _ B Y T E S - 1 )
2005-09-26 10:04:21 +04:00
_ GLOBAL( c s u m _ p a r t i a l _ c o p y _ g e n e r i c )
2020-07-20 17:09:24 +03:00
li r12 ,- 1
addic r0 ,r0 ,0 / * c l e a r c a r r y * /
2015-09-22 17:34:27 +03:00
addi r6 ,r4 ,- 4
neg r0 ,r4
addi r4 ,r3 ,- 4
andi. r0 ,r0 ,C A C H E L I N E _ M A S K / * # b y t e s t o s t a r t o f c a c h e l i n e * /
2016-08-26 17:45:13 +03:00
crset 4 * c r7 + e q
2015-09-22 17:34:27 +03:00
beq 5 8 f
cmplw 0 ,r5 ,r0 / * i s t h i s m o r e t h a n t o t a l t o d o ? * /
blt 6 3 f / * i f n o t m u c h t o d o * /
2016-08-26 17:45:13 +03:00
rlwinm r7 ,r6 ,3 ,0 x8
rlwnm r12 ,r12 ,r7 ,0 ,3 1 / * o d d d e s t i n a t i o n a d d r e s s : r o t a t e o n e b y t e * /
cmplwi c r7 ,r7 ,0 / * i s d e s t i n a t i o n a d d r e s s e v e n ? * /
2015-09-22 17:34:27 +03:00
andi. r8 ,r0 ,3 / * g e t i t w o r d - a l i g n e d f i r s t * /
mtctr r8
beq+ 6 1 f
li r3 ,0
70 : lbz r9 ,4 ( r4 ) / * d o s o m e b y t e s * /
addi r4 ,r4 ,1
slwi r3 ,r3 ,8
rlwimi r3 ,r9 ,0 ,2 4 ,3 1
71 : stb r9 ,4 ( r6 )
addi r6 ,r6 ,1
bdnz 7 0 b
adde r12 ,r12 ,r3
61 : subf r5 ,r0 ,r5
srwi. r0 ,r0 ,2
mtctr r0
beq 5 8 f
72 : lwzu r9 ,4 ( r4 ) / * d o s o m e w o r d s * /
adde r12 ,r12 ,r9
73 : stwu r9 ,4 ( r6 )
bdnz 7 2 b
58 : srwi. r0 ,r5 ,L G _ C A C H E L I N E _ B Y T E S / * # c o m p l e t e c a c h e l i n e s * /
clrlwi r5 ,r5 ,3 2 - L G _ C A C H E L I N E _ B Y T E S
li r11 ,4
beq 6 3 f
/* Here we decide how far ahead to prefetch the source */
li r3 ,4
cmpwi r0 ,1
li r7 ,0
ble 1 1 4 f
li r7 ,1
# if M A X _ C O P Y _ P R E F E T C H > 1
/ * Heuristically, f o r l a r g e t r a n s f e r s w e p r e f e t c h
MAX_ C O P Y _ P R E F E T C H c a c h e l i n e s a h e a d . F o r s m a l l t r a n s f e r s
we p r e f e t c h 1 c a c h e l i n e a h e a d . * /
cmpwi r0 ,M A X _ C O P Y _ P R E F E T C H
ble 1 1 2 f
li r7 ,M A X _ C O P Y _ P R E F E T C H
112 : mtctr r7
111 : dcbt r3 ,r4
addi r3 ,r3 ,C A C H E L I N E _ B Y T E S
bdnz 1 1 1 b
# else
dcbt r3 ,r4
addi r3 ,r3 ,C A C H E L I N E _ B Y T E S
# endif / * M A X _ C O P Y _ P R E F E T C H > 1 * /
114 : subf r8 ,r7 ,r0
mr r0 ,r7
mtctr r8
53 : dcbt r3 ,r4
54 : dcbz r11 ,r6
/* the main body of the cacheline loop */
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 0 )
# if L 1 _ C A C H E _ B Y T E S > = 3 2
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 1 )
# if L 1 _ C A C H E _ B Y T E S > = 6 4
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 2 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 3 )
# if L 1 _ C A C H E _ B Y T E S > = 1 2 8
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 4 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 5 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 6 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ W I T H E X ( 7 )
# endif
# endif
# endif
bdnz 5 3 b
cmpwi r0 ,0
li r3 ,4
li r7 ,0
bne 1 1 4 b
63 : srwi. r0 ,r5 ,2
mtctr r0
beq 6 4 f
30 : lwzu r0 ,4 ( r4 )
adde r12 ,r12 ,r0
31 : stwu r0 ,4 ( r6 )
bdnz 3 0 b
64 : andi. r0 ,r5 ,2
beq+ 6 5 f
40 : lhz r0 ,4 ( r4 )
2005-09-26 10:04:21 +04:00
addi r4 ,r4 ,2
2015-09-22 17:34:27 +03:00
41 : sth r0 ,4 ( r6 )
adde r12 ,r12 ,r0
addi r6 ,r6 ,2
65 : andi. r0 ,r5 ,1
beq+ 6 6 f
50 : lbz r0 ,4 ( r4 )
51 : stb r0 ,4 ( r6 )
slwi r0 ,r0 ,8
adde r12 ,r12 ,r0
66 : addze r3 ,r12
beqlr+ c r7
2016-08-02 11:07:05 +03:00
rlwinm r3 ,r3 ,8 ,0 ,3 1 / * o d d d e s t i n a t i o n a d d r e s s : r o t a t e o n e b y t e * /
2005-09-26 10:04:21 +04:00
blr
2020-07-20 17:09:24 +03:00
fault :
li r3 ,0
2005-09-26 10:04:21 +04:00
blr
2020-07-20 17:09:24 +03:00
EX_ T A B L E ( 7 0 b , f a u l t ) ;
EX_ T A B L E ( 7 1 b , f a u l t ) ;
EX_ T A B L E ( 7 2 b , f a u l t ) ;
EX_ T A B L E ( 7 3 b , f a u l t ) ;
EX_ T A B L E ( 5 4 b , f a u l t ) ;
2015-09-22 17:34:27 +03:00
/ *
* this s t u f f h a n d l e s f a u l t s i n t h e c a c h e l i n e l o o p a n d b r a n c h e s t o e i t h e r
2020-07-20 17:09:24 +03:00
* fault ( i f i n r e a d p a r t ) o r f a u l t ( i f i n w r i t e p a r t )
2015-09-22 17:34:27 +03:00
* /
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 0 )
# if L 1 _ C A C H E _ B Y T E S > = 3 2
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 1 )
# if L 1 _ C A C H E _ B Y T E S > = 6 4
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 2 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 3 )
# if L 1 _ C A C H E _ B Y T E S > = 1 2 8
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 4 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 5 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 6 )
CSUM_ C O P Y _ 1 6 _ B Y T E S _ E X C O D E ( 7 )
# endif
# endif
# endif
2020-07-20 17:09:24 +03:00
EX_ T A B L E ( 3 0 b , f a u l t ) ;
EX_ T A B L E ( 3 1 b , f a u l t ) ;
EX_ T A B L E ( 4 0 b , f a u l t ) ;
EX_ T A B L E ( 4 1 b , f a u l t ) ;
EX_ T A B L E ( 5 0 b , f a u l t ) ;
EX_ T A B L E ( 5 1 b , f a u l t ) ;
2016-10-13 08:42:53 +03:00
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( c s u m _ p a r t i a l _ c o p y _ g e n e r i c )
powerpc: Implement csum_ipv6_magic in assembly
The generic csum_ipv6_magic() generates a pretty bad result
00000000 <csum_ipv6_magic>: (PPC32)
0: 81 23 00 00 lwz r9,0(r3)
4: 81 03 00 04 lwz r8,4(r3)
8: 7c e7 4a 14 add r7,r7,r9
c: 7d 29 38 10 subfc r9,r9,r7
10: 7d 4a 51 10 subfe r10,r10,r10
14: 7d 27 42 14 add r9,r7,r8
18: 7d 2a 48 50 subf r9,r10,r9
1c: 80 e3 00 08 lwz r7,8(r3)
20: 7d 08 48 10 subfc r8,r8,r9
24: 7d 4a 51 10 subfe r10,r10,r10
28: 7d 29 3a 14 add r9,r9,r7
2c: 81 03 00 0c lwz r8,12(r3)
30: 7d 2a 48 50 subf r9,r10,r9
34: 7c e7 48 10 subfc r7,r7,r9
38: 7d 4a 51 10 subfe r10,r10,r10
3c: 7d 29 42 14 add r9,r9,r8
40: 7d 2a 48 50 subf r9,r10,r9
44: 80 e4 00 00 lwz r7,0(r4)
48: 7d 08 48 10 subfc r8,r8,r9
4c: 7d 4a 51 10 subfe r10,r10,r10
50: 7d 29 3a 14 add r9,r9,r7
54: 7d 2a 48 50 subf r9,r10,r9
58: 81 04 00 04 lwz r8,4(r4)
5c: 7c e7 48 10 subfc r7,r7,r9
60: 7d 4a 51 10 subfe r10,r10,r10
64: 7d 29 42 14 add r9,r9,r8
68: 7d 2a 48 50 subf r9,r10,r9
6c: 80 e4 00 08 lwz r7,8(r4)
70: 7d 08 48 10 subfc r8,r8,r9
74: 7d 4a 51 10 subfe r10,r10,r10
78: 7d 29 3a 14 add r9,r9,r7
7c: 7d 2a 48 50 subf r9,r10,r9
80: 81 04 00 0c lwz r8,12(r4)
84: 7c e7 48 10 subfc r7,r7,r9
88: 7d 4a 51 10 subfe r10,r10,r10
8c: 7d 29 42 14 add r9,r9,r8
90: 7d 2a 48 50 subf r9,r10,r9
94: 7d 08 48 10 subfc r8,r8,r9
98: 7d 4a 51 10 subfe r10,r10,r10
9c: 7d 29 2a 14 add r9,r9,r5
a0: 7d 2a 48 50 subf r9,r10,r9
a4: 7c a5 48 10 subfc r5,r5,r9
a8: 7c 63 19 10 subfe r3,r3,r3
ac: 7d 29 32 14 add r9,r9,r6
b0: 7d 23 48 50 subf r9,r3,r9
b4: 7c c6 48 10 subfc r6,r6,r9
b8: 7c 63 19 10 subfe r3,r3,r3
bc: 7c 63 48 50 subf r3,r3,r9
c0: 54 6a 80 3e rotlwi r10,r3,16
c4: 7c 63 52 14 add r3,r3,r10
c8: 7c 63 18 f8 not r3,r3
cc: 54 63 84 3e rlwinm r3,r3,16,16,31
d0: 4e 80 00 20 blr
0000000000000000 <.csum_ipv6_magic>: (PPC64)
0: 81 23 00 00 lwz r9,0(r3)
4: 80 03 00 04 lwz r0,4(r3)
8: 81 63 00 08 lwz r11,8(r3)
c: 7c e7 4a 14 add r7,r7,r9
10: 7f 89 38 40 cmplw cr7,r9,r7
14: 7d 47 02 14 add r10,r7,r0
18: 7d 30 10 26 mfocrf r9,1
1c: 55 29 f7 fe rlwinm r9,r9,30,31,31
20: 7d 4a 4a 14 add r10,r10,r9
24: 7f 80 50 40 cmplw cr7,r0,r10
28: 7d 2a 5a 14 add r9,r10,r11
2c: 80 03 00 0c lwz r0,12(r3)
30: 81 44 00 00 lwz r10,0(r4)
34: 7d 10 10 26 mfocrf r8,1
38: 55 08 f7 fe rlwinm r8,r8,30,31,31
3c: 7d 29 42 14 add r9,r9,r8
40: 81 04 00 04 lwz r8,4(r4)
44: 7f 8b 48 40 cmplw cr7,r11,r9
48: 7d 29 02 14 add r9,r9,r0
4c: 7d 70 10 26 mfocrf r11,1
50: 55 6b f7 fe rlwinm r11,r11,30,31,31
54: 7d 29 5a 14 add r9,r9,r11
58: 7f 80 48 40 cmplw cr7,r0,r9
5c: 7d 29 52 14 add r9,r9,r10
60: 7c 10 10 26 mfocrf r0,1
64: 54 00 f7 fe rlwinm r0,r0,30,31,31
68: 7d 69 02 14 add r11,r9,r0
6c: 7f 8a 58 40 cmplw cr7,r10,r11
70: 7c 0b 42 14 add r0,r11,r8
74: 81 44 00 08 lwz r10,8(r4)
78: 7c f0 10 26 mfocrf r7,1
7c: 54 e7 f7 fe rlwinm r7,r7,30,31,31
80: 7c 00 3a 14 add r0,r0,r7
84: 7f 88 00 40 cmplw cr7,r8,r0
88: 7d 20 52 14 add r9,r0,r10
8c: 80 04 00 0c lwz r0,12(r4)
90: 7d 70 10 26 mfocrf r11,1
94: 55 6b f7 fe rlwinm r11,r11,30,31,31
98: 7d 29 5a 14 add r9,r9,r11
9c: 7f 8a 48 40 cmplw cr7,r10,r9
a0: 7d 29 02 14 add r9,r9,r0
a4: 7d 70 10 26 mfocrf r11,1
a8: 55 6b f7 fe rlwinm r11,r11,30,31,31
ac: 7d 29 5a 14 add r9,r9,r11
b0: 7f 80 48 40 cmplw cr7,r0,r9
b4: 7d 29 2a 14 add r9,r9,r5
b8: 7c 10 10 26 mfocrf r0,1
bc: 54 00 f7 fe rlwinm r0,r0,30,31,31
c0: 7d 29 02 14 add r9,r9,r0
c4: 7f 85 48 40 cmplw cr7,r5,r9
c8: 7c 09 32 14 add r0,r9,r6
cc: 7d 50 10 26 mfocrf r10,1
d0: 55 4a f7 fe rlwinm r10,r10,30,31,31
d4: 7c 00 52 14 add r0,r0,r10
d8: 7f 80 30 40 cmplw cr7,r0,r6
dc: 7d 30 10 26 mfocrf r9,1
e0: 55 29 ef fe rlwinm r9,r9,29,31,31
e4: 7c 09 02 14 add r0,r9,r0
e8: 54 03 80 3e rotlwi r3,r0,16
ec: 7c 03 02 14 add r0,r3,r0
f0: 7c 03 00 f8 not r3,r0
f4: 78 63 84 22 rldicl r3,r3,48,48
f8: 4e 80 00 20 blr
This patch implements it in assembly for both PPC32 and PPC64
Link: https://github.com/linuxppc/linux/issues/9
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Reviewed-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-05-24 14:33:18 +03:00
/ *
* _ _ sum1 6 c s u m _ i p v6 _ m a g i c ( c o n s t s t r u c t i n 6 _ a d d r * s a d d r ,
* const s t r u c t i n 6 _ a d d r * d a d d r ,
* _ _ u3 2 l e n , _ _ u 8 p r o t o , _ _ w s u m s u m )
* /
_ GLOBAL( c s u m _ i p v6 _ m a g i c )
lwz r8 , 0 ( r3 )
lwz r9 , 4 ( r3 )
addc r0 , r7 , r8
lwz r10 , 8 ( r3 )
adde r0 , r0 , r9
lwz r11 , 1 2 ( r3 )
adde r0 , r0 , r10
lwz r8 , 0 ( r4 )
adde r0 , r0 , r11
lwz r9 , 4 ( r4 )
adde r0 , r0 , r8
lwz r10 , 8 ( r4 )
adde r0 , r0 , r9
lwz r11 , 1 2 ( r4 )
adde r0 , r0 , r10
add r5 , r5 , r6 / * a s s u m p t i o n : l e n + p r o t o d o e s n ' t c a r r y * /
adde r0 , r0 , r11
adde r0 , r0 , r5
addze r0 , r0
rotlwi r3 , r0 , 1 6
add r3 , r0 , r3
not r3 , r3
rlwinm r3 , r3 , 1 6 , 1 6 , 3 1
blr
EXPORT_ S Y M B O L ( c s u m _ i p v6 _ m a g i c )