blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.
The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.
The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf
The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc
This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/
We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel
[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-06 14:50:22 -07:00
/ *
2009-09-24 14:11:24 +00:00
* Copyright 2 0 0 4 - 2 0 0 9 A n a l o g D e v i c e s I n c .
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.
The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.
The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf
The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc
This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/
We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel
[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-06 14:50:22 -07:00
*
2009-09-24 14:11:24 +00:00
* Licensed u n d e r t h e A D I B S D l i c e n s e o r t h e G P L - 2 ( o r l a t e r )
*
* 1 6 / 3 2 bit s i g n e d d i v i s i o n .
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.
The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.
The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf
The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc
This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/
We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel
[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-06 14:50:22 -07:00
* Special c a s e s :
* 1 ) If( n u m e r a t o r = = 0 )
* return 0
* 2 ) If( d e n o m i n a t o r = =0 )
* return p o s i t i v e m a x = 0 x7 f f f f f f f
* 3 ) If( n u m e r a t o r = = d e n o m i n a t o r )
* return 1
* 4 ) If( d e n o m i n a t o r = =1 )
* return n u m e r a t o r
* 5 ) If( d e n o m i n a t o r = = - 1 )
* return - n u m e r a t o r
*
* Operand : R 0 - N u m e r a t o r ( i )
* R1 - D e n o m i n a t o r ( i )
* R0 - Q u o t i e n t ( o )
* Registers U s e d : R 2 - R 7 ,P 0 - P 2
*
* /
.global _ _ _ divsi3 ;
2007-06-11 15:31:30 +08:00
.type _ _ _ divsi3 , S T T _ F U N C ;
blackfin architecture
This adds support for the Analog Devices Blackfin processor architecture, and
currently supports the BF533, BF532, BF531, BF537, BF536, BF534, and BF561
(Dual Core) devices, with a variety of development platforms including those
avaliable from Analog Devices (BF533-EZKit, BF533-STAMP, BF537-STAMP,
BF561-EZKIT), and Bluetechnix! Tinyboards.
The Blackfin architecture was jointly developed by Intel and Analog Devices
Inc. (ADI) as the Micro Signal Architecture (MSA) core and introduced it in
December of 2000. Since then ADI has put this core into its Blackfin
processor family of devices. The Blackfin core has the advantages of a clean,
orthogonal,RISC-like microprocessor instruction set. It combines a dual-MAC
(Multiply/Accumulate), state-of-the-art signal processing engine and
single-instruction, multiple-data (SIMD) multimedia capabilities into a single
instruction-set architecture.
The Blackfin architecture, including the instruction set, is described by the
ADSP-BF53x/BF56x Blackfin Processor Programming Reference
http://blackfin.uclinux.org/gf/download/frsrelease/29/2549/Blackfin_PRM.pdf
The Blackfin processor is already supported by major releases of gcc, and
there are binary and source rpms/tarballs for many architectures at:
http://blackfin.uclinux.org/gf/project/toolchain/frs There is complete
documentation, including "getting started" guides available at:
http://docs.blackfin.uclinux.org/ which provides links to the sources and
patches you will need in order to set up a cross-compiling environment for
bfin-linux-uclibc
This patch, as well as the other patches (toolchain, distribution,
uClibc) are actively supported by Analog Devices Inc, at:
http://blackfin.uclinux.org/
We have tested this on LTP, and our test plan (including pass/fails) can
be found at:
http://docs.blackfin.uclinux.org/doku.php?id=testing_the_linux_kernel
[m.kozlowski@tuxland.pl: balance parenthesis in blackfin header files]
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Aubrey Li <aubrey.li@analog.com>
Signed-off-by: Jie Zhang <jie.zhang@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-06 14:50:22 -07:00
# ifdef C O N F I G _ A R I T H M E T I C _ O P S _ L 1
.section .l1 .text
# else
.text
# endif
.align 2 ;
_ _ _ divsi3 :
R3 = R 0 ^ R 1 ;
R0 = A B S R 0 ;
CC = V ;
r3 = r o t r3 b y - 1 ;
r1 = a b s r1 ; /* now both positive, r3.30 means "negate result",
* * r3 . 3 1 m e a n s o v e r f l o w , a d d o n e t o r e s u l t
* /
cc = r0 < r1 ;
if c c j u m p . L r e t _ z e r o ;
r2 = r1 > > 1 5 ;
cc = r2 ;
if c c j u m p . L i d e n t s ;
r2 = r1 < < 1 6 ;
cc = r2 < = r0 ;
if c c j u m p . L i d e n t s ;
DIVS( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
DIVQ( R 0 , R 1 ) ;
R0 = R 0 . L ( Z ) ;
r1 = r3 > > 3 1 ; /* add overflow issue back in */
r0 = r0 + r1 ;
r1 = - r0 ;
cc = b i t t s t ( r3 , 3 0 ) ;
if c c r0 = r1 ;
RTS;
/ * Can' t u s e t h e p r i m i t i v e s . T e s t c o m m o n i d e n t i t i e s .
* * If t h e i d e n t i t y i s t r u e , r e t u r n t h e v a l u e i n R 2 .
* /
.Lidents :
CC = R 1 = = 0 ; /* check for divide by zero */
IF C C J U M P . L i d e n t _ r e t u r n ;
CC = R 0 = = 0 ; /* check for division of zero */
IF C C J U M P . L z e r o _ r e t u r n ;
CC = R 0 = = R 1 ; /* check for identical operands */
IF C C J U M P . L i d e n t _ r e t u r n ;
CC = R 1 = = 1 ; /* check for divide by 1 */
IF C C J U M P . L i d e n t _ r e t u r n ;
R2 . L = O N E S R 1 ;
R2 = R 2 . L ( Z ) ;
CC = R 2 = = 1 ;
IF C C J U M P . L p o w e r _ o f _ t w o ;
/ * Identities h a v e n ' t h e l p e d e i t h e r .
* * Perform t h e f u l l d i v i s i o n p r o c e s s .
* /
P1 = 3 1 ; /* Set loop counter */
[ - - SP] = ( R 7 : 5 ) ; /* Push registers R5-R7 */
R2 = - R 1 ;
[ - - SP] = R 2 ;
R2 = R 0 < < 1 ; /* R2 lsw of dividend */
R6 = R 0 ^ R 1 ; /* Get sign */
R5 = R 6 > > 3 1 ; /* Shift sign to LSB */
R0 = 0 ; /* Clear msw partial remainder */
R2 = R 2 | R 5 ; /* Shift quotient bit */
R6 = R 0 ^ R 1 ; /* Get new quotient bit */
LSETUP( . L l s t ,. L l e n d ) L C 0 = P 1 ; /* Setup loop */
.Llst : R7 = R 2 > > 3 1 ; /* record copy of carry from R2 */
R2 = R 2 < < 1 ; /* Shift 64 bit dividend up by 1 bit */
R0 = R 0 < < 1 | | R 5 = [ S P ] ;
R0 = R 0 | R 7 ; /* and add carry */
CC = R 6 < 0 ; /* Check quotient(AQ) */
/* we might be subtracting divisor (AQ==0) */
IF C C R 5 = R 1 ; /* or we might be adding divisor (AQ==1)*/
R0 = R 0 + R 5 ; /* do add or subtract, as indicated by AQ */
R6 = R 0 ^ R 1 ; /* Generate next quotient bit */
R5 = R 6 > > 3 1 ;
/* Assume AQ==1, shift in zero */
BITTGL( R 5 ,0 ) ; /* tweak AQ to be what we want to shift in */
.Llend : R2 = R 2 + R 5 ; /* and then set shifted-in value to
* * tweaked A Q .
* /
r1 = r3 > > 3 1 ;
r2 = r2 + r1 ;
cc = b i t t s t ( r3 ,3 0 ) ;
r0 = - r2 ;
if ! c c r0 = r2 ;
SP + = 4 ;
( R7 : 5 ) = [ SP+ + ] ; /* Pop registers R6-R7 */
RTS;
.Lident_return :
CC = R 1 = = 0 ; /* check for divide by zero => 0x7fffffff */
R2 = - 1 ( X ) ;
R2 > > = 1 ;
IF C C J U M P . L t r u e _ i d e n t _ r e t u r n ;
CC = R 0 = = R 1 ; /* check for identical operands => 1 */
R2 = 1 ( Z ) ;
IF C C J U M P . L t r u e _ i d e n t _ r e t u r n ;
R2 = R 0 ; /* assume divide by 1 => numerator */
/*FALLTHRU*/
.Ltrue_ident_return :
R0 = R 2 ; /* Return an identity value */
R2 = - R 2 ;
CC = b i t t s t ( R 3 ,3 0 ) ;
IF C C R 0 = R 2 ;
.Lzero_return :
RTS; /* ...including zero */
.Lpower_of_two :
/ * Y h a s a s i n g l e b i t s e t , w h i c h m e a n s i t ' s a p o w e r o f t w o .
* * That m e a n s w e c a n p e r f o r m t h e d i v i s i o n j u s t b y s h i f t i n g
* * X t o t h e r i g h t t h e a p p r o p r i a t e n u m b e r o f b i t s
* /
/ * signbits r e t u r n s t h e n u m b e r o f s i g n b i t s , m i n u s o n e .
* * 1 = > 3 0 , 2 = > 2 9 , . . . , 0 x4 0 0 0 0 0 0 0 = > 0 . W h i c h m e a n s w e n e e d
* * to s h i f t r i g h t n - s i g n b i t s s p a c e s . I t a l s o m e a n s 0 x80 0 0 0 0 0 0
* * is a s p e c i a l c a s e , b e c a u s e t h a t * a l s o * g i v e s a s i g n b i t s o f 0
* /
R2 = R 0 > > 3 1 ;
CC = R 1 < 0 ;
IF C C J U M P . L t r u e _ i d e n t _ r e t u r n ;
R1 . l = S I G N B I T S R 1 ;
R1 = R 1 . L ( Z ) ;
R1 + = - 3 0 ;
R0 = L S H I F T R 0 b y R 1 . L ;
r1 = r3 > > 3 1 ;
r0 = r0 + r1 ;
R2 = - R 0 ; // negate result if necessary
CC = b i t t s t ( R 3 ,3 0 ) ;
IF C C R 0 = R 2 ;
RTS;
.Lret_zero :
R0 = 0 ;
RTS;
2007-06-11 15:31:30 +08:00
.size _ _ _ divsi3 , . - _ _ _ d i v s i 3