2018-12-28 11:32:28 +03:00
/ * SPDX- L i c e n s e - I d e n t i f i e r : G P L - 2 . 0 + W I T H G C C - e x c e p t i o n - 2 . 0
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 ,
2008-11-18 11:33:48 +03:00
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 .
2018-12-28 11:32:28 +03:00
* /
2008-11-18 11:33:48 +03:00
! ! 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 */
!
! _ _ ashlsi3
!
! Entry :
!
! r4 : Value t o s h i f t
! r5 : Shifts
!
! Exit :
!
! r0 : Result
!
! Destroys :
!
! ( none)
!
2015-06-20 08:02:19 +03:00
! _ _ ashlsi3 _ r0
!
! Entry :
!
! r4 : Value t o s h i f t
! r0 : Shifts
!
! Exit :
!
! r0 : Result
!
! Destroys :
!
! ( none)
2008-11-18 11:33:48 +03:00
.global __ashlsi3
2015-06-20 08:02:19 +03:00
.global __ashlsi3_r0
2008-11-18 11:33:48 +03:00
.align 2
__ashlsi3 :
2015-06-20 08:02:19 +03:00
mov r5 ,r0
.align 2
__ashlsi3_r0 :
and #31 ,r0
mov. l r4 ,@-r15
mov r0 ,r4
2008-11-18 11:33:48 +03:00
mova a s h l s i 3 _ t a b l e ,r0
2015-06-20 08:02:19 +03:00
mov. b @(r0,r4),r4
add r4 ,r0
2008-11-18 11:33:48 +03:00
jmp @r0
2015-06-20 08:02:19 +03:00
mov. l @r15+,r0
2008-11-18 11:33:48 +03:00
.align 2
ashlsi3_table :
.byte ashlsi3 _ 0 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 3 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 4 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 5 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 6 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 7 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 8 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 9 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 0 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 1 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 2 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 3 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 4 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 5 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 6 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 7 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 8 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 1 9 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 0 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 1 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 2 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 3 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 4 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 5 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 6 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 7 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 8 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 2 9 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 3 0 - a s h l s i 3 _ t a b l e
.byte ashlsi3 _ 3 1 - a s h l s i 3 _ t a b l e
ashlsi3_6 :
shll2 r0
ashlsi3_4 :
shll2 r0
ashlsi3_2 :
rts
shll2 r0
ashlsi3_7 :
shll2 r0
ashlsi3_5 :
shll2 r0
ashlsi3_3 :
shll2 r0
ashlsi3_1 :
rts
shll r0
ashlsi3_14 :
shll2 r0
ashlsi3_12 :
shll2 r0
ashlsi3_10 :
shll2 r0
ashlsi3_8 :
rts
shll8 r0
ashlsi3_15 :
shll2 r0
ashlsi3_13 :
shll2 r0
ashlsi3_11 :
shll2 r0
ashlsi3_9 :
shll8 r0
rts
shll r0
ashlsi3_22 :
shll2 r0
ashlsi3_20 :
shll2 r0
ashlsi3_18 :
shll2 r0
ashlsi3_16 :
rts
shll1 6 r0
ashlsi3_23 :
shll2 r0
ashlsi3_21 :
shll2 r0
ashlsi3_19 :
shll2 r0
ashlsi3_17 :
shll1 6 r0
rts
shll r0
ashlsi3_30 :
shll2 r0
ashlsi3_28 :
shll2 r0
ashlsi3_26 :
shll2 r0
ashlsi3_24 :
shll1 6 r0
rts
shll8 r0
ashlsi3_31 :
shll2 r0
ashlsi3_29 :
shll2 r0
ashlsi3_27 :
shll2 r0
ashlsi3_25 :
shll1 6 r0
shll8 r0
rts
shll r0
ashlsi3_0 :
rts
nop