2010-08-12 20:28:09 +04:00
/ *
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e a s p u b l i s h e d b y
* the F r e e S o f t w a r e F o u n d a t i o n ; either version 2 of the License, or
* ( at y o u r o p t i o n ) a n y l a t e r v e r s i o n .
*
* This p r o g r a m i s d i s t r i b u t e d i n t h e h o p e t h a t i t w i l l b e u s e f u l ,
* but W I T H O U T A N Y W A R R A N T Y ; without even the implied warranty of
* MERCHANTABILITY o r F I T N E S S F O R A P A R T I C U L A R P U R P O S E . S e e t h e
* GNU G e n e r a l P u b l i c L i c e n s e f o r m o r e d e t a i l s .
*
* You s h o u l d h a v e r e c e i v e d a c o p y o f t h e G N U G e n e r a l P u b l i c L i c e n s e
* along w i t h t h i s p r o g r a m ; if not, write to the Free Software
* Foundation, I n c . , 5 9 T e m p l e P l a c e - S u i t e 3 3 0 , B o s t o n , M A 0 2 1 1 1 - 1 3 0 7 , U S A .
*
* 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 )