2019-05-27 09:55:05 +03:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2010-08-12 20:28:09 +04:00
/ *
*
* Copyright ( C ) I B M C o r p o r a t i o n , 2 0 1 0
*
* Author : Anton B l a n c h a r d < a n t o n @au.ibm.com>
* /
# include < a s m / p r o c e s s o r . 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 >
2018-07-05 19:25:01 +03:00
# include < a s m / f e a t u r e - f i x u p s . h >
2010-08-12 20:28:09 +04:00
/* Note: This code relies on -mminimal-toc */
_ GLOBAL( _ _ a r c h _ h w e i g h t 8 )
BEGIN_ F T R _ S E C T I O N
2014-02-04 09:04:35 +04:00
b _ _ s w _ h w e i g h t 8
2010-08-12 20:28:09 +04:00
nop
nop
FTR_ S E C T I O N _ E L S E
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T B ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
clrldi r3 ,r3 ,6 4 - 8
blr
ALT_ F T R _ S E C T I O N _ E N D _ I F C L R ( C P U _ F T R _ P O P C N T B )
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( _ _ a r c h _ h w e i g h t 8 )
2010-08-12 20:28:09 +04:00
_ GLOBAL( _ _ a r c h _ h w e i g h t 1 6 )
BEGIN_ F T R _ S E C T I O N
2014-02-04 09:04:35 +04:00
b _ _ s w _ h w e i g h t 1 6
2010-08-12 20:28:09 +04:00
nop
nop
nop
nop
FTR_ S E C T I O N _ E L S E
BEGIN_ F T R _ S E C T I O N _ N E S T E D ( 5 0 )
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T B ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
srdi r4 ,r3 ,8
add r3 ,r4 ,r3
clrldi r3 ,r3 ,6 4 - 8
blr
FTR_ S E C T I O N _ E L S E _ N E S T E D ( 5 0 )
clrlwi r3 ,r3 ,1 6
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T W ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
clrldi r3 ,r3 ,6 4 - 8
blr
ALT_ F T R _ S E C T I O N _ E N D _ N E S T E D _ I F C L R ( C P U _ F T R _ P O P C N T D , 5 0 )
ALT_ F T R _ S E C T I O N _ E N D _ I F C L R ( C P U _ F T R _ P O P C N T B )
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( _ _ a r c h _ h w e i g h t 1 6 )
2010-08-12 20:28:09 +04:00
_ GLOBAL( _ _ a r c h _ h w e i g h t 3 2 )
BEGIN_ F T R _ S E C T I O N
2014-02-04 09:04:35 +04:00
b _ _ s w _ h w e i g h t 3 2
2010-08-12 20:28:09 +04:00
nop
nop
nop
nop
nop
nop
FTR_ S E C T I O N _ E L S E
BEGIN_ F T R _ S E C T I O N _ N E S T E D ( 5 1 )
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T B ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
srdi r4 ,r3 ,1 6
add r3 ,r4 ,r3
srdi r4 ,r3 ,8
add r3 ,r4 ,r3
clrldi r3 ,r3 ,6 4 - 8
blr
FTR_ S E C T I O N _ E L S E _ N E S T E D ( 5 1 )
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T W ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
clrldi r3 ,r3 ,6 4 - 8
blr
ALT_ F T R _ S E C T I O N _ E N D _ N E S T E D _ I F C L R ( C P U _ F T R _ P O P C N T D , 5 1 )
ALT_ F T R _ S E C T I O N _ E N D _ I F C L R ( C P U _ F T R _ P O P C N T B )
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( _ _ a r c h _ h w e i g h t 3 2 )
2010-08-12 20:28:09 +04:00
_ GLOBAL( _ _ a r c h _ h w e i g h t 6 4 )
BEGIN_ F T R _ S E C T I O N
2014-02-04 09:04:35 +04:00
b _ _ s w _ h w e i g h t 6 4
2010-08-12 20:28:09 +04:00
nop
nop
nop
nop
nop
nop
nop
nop
FTR_ S E C T I O N _ E L S E
BEGIN_ F T R _ S E C T I O N _ N E S T E D ( 5 2 )
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T B ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
srdi r4 ,r3 ,3 2
add r3 ,r4 ,r3
srdi r4 ,r3 ,1 6
add r3 ,r4 ,r3
srdi r4 ,r3 ,8
add r3 ,r4 ,r3
clrldi r3 ,r3 ,6 4 - 8
blr
FTR_ S E C T I O N _ E L S E _ N E S T E D ( 5 2 )
2012-06-25 17:33:10 +04:00
PPC_ P O P C N T D ( R 3 ,R 3 )
2010-08-12 20:28:09 +04:00
clrldi r3 ,r3 ,6 4 - 8
blr
ALT_ F T R _ S E C T I O N _ E N D _ N E S T E D _ I F C L R ( C P U _ F T R _ P O P C N T D , 5 2 )
ALT_ F T R _ S E C T I O N _ E N D _ I F C L R ( C P U _ F T R _ P O P C N T B )
2016-01-14 07:33:46 +03:00
EXPORT_ S Y M B O L ( _ _ a r c h _ h w e i g h t 6 4 )