2008-11-18 17:33:48 +09:00
/ * Copyright ( C ) 1 9 9 4 , 1 9 9 5 , 1 9 9 7 , 1 9 9 8 , 1 9 9 9 , 2 0 0 0 , 2 0 0 1 , 2 0 0 2 , 2 0 0 3 ,
2 0 0 4 , 2 0 0 5 , 2 0 0 6
Free S o f t w a r e F o u n d a t i o n , I n c .
This f i l e i s f r e e s o f t w a r e ; you can redistribute it and/or modify it
under 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 t h e
Free S o f t w a r e F o u n d a t i o n ; either version 2, or (at your option) any
later v e r s i o n .
In a d d i t i o n t o t h e p e r m i s s i o n s i n 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 , t h e
Free S o f t w a r e F o u n d a t i o n g i v e s y o u u n l i m i t e d p e r m i s s i o n t o l i n k t h e
compiled v e r s i o n o f t h i s f i l e i n t o c o m b i n a t i o n s w i t h o t h e r p r o g r a m s ,
and t o d i s t r i b u t e t h o s e c o m b i n a t i o n s w i t h o u t a n y r e s t r i c t i o n c o m i n g
from t h e u s e o f t h i s f i l e . ( T h e G e n e r a l P u b l i c L i c e n s e r e s t r i c t i o n s
do a p p l y i n o t h e r r e s p e c t s ; for example, they cover modification of
the f i l e , a n d d i s t r i b u t i o n w h e n n o t l i n k e d i n t o a c o m b i n e
executable. )
This f i l e 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 , b u t
WITHOUT 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 G N U
General 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 ; see the file COPYING. If not, write to
the F r e e S o f t w a r e F o u n d a t i o n , 5 1 F r a n k l i n S t r e e t , F i f t h F l o o r ,
Boston, M A 0 2 1 1 0 - 1 3 0 1 , U S A . * /
! ! libgcc r o u t i n e s f o r t h e R e n e s a s / S u p e r H S H C P U s .
! ! Contributed b y S t e v e C h a m b e r l a i n .
! ! sac@cygnus.com
! ! ashiftrt_ r4 _ x , _ _ _ a s h r s i 3 , _ _ _ a s h l s i 3 , _ _ _ l s h r s i 3 r o u t i n e s
! ! recoded i n a s s e m b l y b y T o s h i y a s u M o r i t a
! ! tm@netcom.com
/ * SH2 o p t i m i z a t i o n s f o r _ _ _ a s h r s i 3 , _ _ _ a s h l s i 3 , _ _ _ l s h r s i 3 a n d
ELF l o c a l l a b e l p r e f i x e s b y J " o r n R e n n e c k e
amylaar@cygnus.com */
!
! _ _ lshrsi3
!
! Entry :
!
! r4 : Value t o s h i f t
! r5 : Shifts
!
! Exit :
!
! r0 : Result
!
! Destroys :
!
! ( none)
2015-06-20 14:02:19 +09:00
!
! _ _ lshrsi3 _ r0
!
! Entry :
!
! r0 : Value t o s h i f t
! r5 : Shifts
!
! Exit :
!
! r0 : Result
!
! Destroys :
!
! ( none)
2008-11-18 17:33:48 +09:00
!
.global __lshrsi3
2015-06-20 14:02:19 +09:00
.global __lshrsi3_r0
2008-11-18 17:33:48 +09:00
.align 2
__lshrsi3 :
2015-06-20 14:02:19 +09:00
mov r5 ,r0
.align 2
__lshrsi3_r0 :
and #31 ,r0
mov. l r4 ,@-r15
mov r0 ,r4
2008-11-18 17:33:48 +09:00
mova l s h r s i 3 _ t a b l e ,r0
2015-06-20 14:02:19 +09:00
mov. b @(r0,r4),r4
add r4 ,r0
2008-11-18 17:33:48 +09:00
jmp @r0
2015-06-20 14:02:19 +09:00
mov. l @r15+,r0
2008-11-18 17:33:48 +09:00
.align 2
lshrsi3_table :
.byte lshrsi3 _ 0 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 3 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 4 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 5 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 6 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 7 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 8 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 9 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 0 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 1 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 2 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 3 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 4 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 5 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 6 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 7 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 8 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 1 9 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 0 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 1 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 2 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 3 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 4 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 5 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 6 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 7 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 8 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 2 9 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 3 0 - l s h r s i 3 _ t a b l e
.byte lshrsi3 _ 3 1 - l s h r s i 3 _ t a b l e
lshrsi3_6 :
shlr2 r0
lshrsi3_4 :
shlr2 r0
lshrsi3_2 :
rts
shlr2 r0
lshrsi3_7 :
shlr2 r0
lshrsi3_5 :
shlr2 r0
lshrsi3_3 :
shlr2 r0
lshrsi3_1 :
rts
shlr r0
lshrsi3_14 :
shlr2 r0
lshrsi3_12 :
shlr2 r0
lshrsi3_10 :
shlr2 r0
lshrsi3_8 :
rts
shlr8 r0
lshrsi3_15 :
shlr2 r0
lshrsi3_13 :
shlr2 r0
lshrsi3_11 :
shlr2 r0
lshrsi3_9 :
shlr8 r0
rts
shlr r0
lshrsi3_22 :
shlr2 r0
lshrsi3_20 :
shlr2 r0
lshrsi3_18 :
shlr2 r0
lshrsi3_16 :
rts
shlr1 6 r0
lshrsi3_23 :
shlr2 r0
lshrsi3_21 :
shlr2 r0
lshrsi3_19 :
shlr2 r0
lshrsi3_17 :
shlr1 6 r0
rts
shlr r0
lshrsi3_30 :
shlr2 r0
lshrsi3_28 :
shlr2 r0
lshrsi3_26 :
shlr2 r0
lshrsi3_24 :
shlr1 6 r0
rts
shlr8 r0
lshrsi3_31 :
shlr2 r0
lshrsi3_29 :
shlr2 r0
lshrsi3_27 :
shlr2 r0
lshrsi3_25 :
shlr1 6 r0
shlr8 r0
rts
shlr r0
lshrsi3_0 :
rts
nop