2019-05-29 07:12:41 -07:00
/* SPDX-License-Identifier: GPL-2.0-only */
2011-10-31 18:48:07 -05:00
/ *
2012-09-19 16:22:02 -05:00
* Copyright ( c ) 2 0 1 0 - 2 0 1 1 , T h e L i n u x F o u n d a t i o n . A l l r i g h t s r e s e r v e d .
2011-10-31 18:48:07 -05:00
* /
/ * Numerology :
* WXYZ
* W : width i n b y t e s
* X : Load=0 , S t o r e =1
* Y : Location 0 =preamble ,8 =loop ,9 =epilog
* Z : Location=0 ,h a n d l e r =9
* /
.text
.global FUNCNAME
.type FUNCNAME, @function
.p2align 5
FUNCNAME :
{
p0 = c m p . g t u ( b y t e s ,#0 )
if ( ! p0 . n e w ) j u m p : n t . L d o n e
r3 = o r ( d s t ,s r c )
r4 = x o r ( d s t ,s r c )
}
{
p1 = c m p . g t u ( b y t e s ,#15 )
p0 = b i t s c l r ( r3 ,#7 )
if ( ! p0 . n e w ) j u m p : n t . L o o p _ n o t _ a l i g n e d _ 8
src_ d s t _ s a v = c o m b i n e ( s r c ,d s t )
}
{
loopcount = l s r ( b y t e s ,#3 )
if ( ! p1 ) j u m p . L s m a l l
}
p3 =sp1loop0 ( . L o o p8 ,l o o p c o u n t )
.Loop8 :
8080 :
8180 :
{
if ( p3 ) m e m d ( d s t + + #8 ) = d _ d b u f
d_ d b u f = m e m d ( s r c + + #8 )
} : endloop0
8190 :
{
memd( d s t + + #8 ) = d _ d b u f
bytes - = a s l ( l o o p c o u n t ,#3 )
jump . L s m a l l
}
.Loop_not_aligned_8 :
{
p0 = b i t s c l r ( r4 ,#7 )
if ( p0 . n e w ) j u m p : n t . L a l i g n
}
{
p0 = b i t s c l r ( r3 ,#3 )
if ( ! p0 . n e w ) j u m p : n t . L o o p _ n o t _ a l i g n e d _ 4
p1 = c m p . g t u ( b y t e s ,#7 )
}
{
if ( ! p1 ) j u m p . L s m a l l
loopcount = l s r ( b y t e s ,#2 )
}
p3 =sp1loop0 ( . L o o p4 ,l o o p c o u n t )
.Loop4 :
4080 :
4180 :
{
if ( p3 ) m e m w ( d s t + + #4 ) = w _ d b u f
w_ d b u f = m e m w ( s r c + + #4 )
} : endloop0
4190 :
{
memw( d s t + + #4 ) = w _ d b u f
bytes - = a s l ( l o o p c o u n t ,#2 )
jump . L s m a l l
}
.Loop_not_aligned_4 :
{
p0 = b i t s c l r ( r3 ,#1 )
if ( ! p0 . n e w ) j u m p : n t . L o o p _ n o t _ a l i g n e d
p1 = c m p . g t u ( b y t e s ,#3 )
}
{
if ( ! p1 ) j u m p . L s m a l l
loopcount = l s r ( b y t e s ,#1 )
}
p3 =sp1loop0 ( . L o o p2 ,l o o p c o u n t )
.Loop2 :
2080 :
2180 :
{
if ( p3 ) m e m h ( d s t + + #2 ) = w _ d b u f
w_ d b u f = m e m u h ( s r c + + #2 )
} : endloop0
2190 :
{
memh( d s t + + #2 ) = w _ d b u f
bytes - = a s l ( l o o p c o u n t ,#1 )
jump . L s m a l l
}
.Loop_not_aligned : /* Works for as small as one byte */
p3 =sp1loop0 ( . L o o p1 ,b y t e s )
.Loop1 :
1080 :
1180 :
{
if ( p3 ) m e m b ( d s t + + #1 ) = w _ d b u f
w_ d b u f = m e m u b ( s r c + + #1 )
} : endloop0
/* Done */
1190 :
{
memb( d s t ) = w _ d b u f
jumpr r31
r0 = #0
}
.Lsmall :
{
p0 = c m p . g t u ( b y t e s ,#0 )
if ( p0 . n e w ) j u m p : n t . L o o p _ n o t _ a l i g n e d
}
.Ldone :
{
r0 = #0
jumpr r31
}
.falign
.Lalign :
1000 :
{
if ( p0 . n e w ) w _ d b u f = m e m u b ( s r c )
p0 = t s t b i t ( s r c ,#0 )
if ( ! p1 ) j u m p . L s m a l l
}
1100 :
{
if ( p0 ) m e m b ( d s t + + #1 ) = w _ d b u f
if ( p0 ) b y t e s = a d d ( b y t e s ,#- 1 )
if ( p0 ) s r c = a d d ( s r c ,#1 )
}
2000 :
{
if ( p0 . n e w ) w _ d b u f = m e m u h ( s r c )
p0 = t s t b i t ( s r c ,#1 )
if ( ! p1 ) j u m p . L s m a l l
}
2100 :
{
if ( p0 ) m e m h ( d s t + + #2 ) = w _ d b u f
if ( p0 ) b y t e s = a d d ( b y t e s ,#- 2 )
if ( p0 ) s r c = a d d ( s r c ,#2 )
}
4000 :
{
if ( p0 . n e w ) w _ d b u f = m e m w ( s r c )
p0 = t s t b i t ( s r c ,#2 )
if ( ! p1 ) j u m p . L s m a l l
}
4100 :
{
if ( p0 ) m e m w ( d s t + + #4 ) = w _ d b u f
if ( p0 ) b y t e s = a d d ( b y t e s ,#- 4 )
if ( p0 ) s r c = a d d ( s r c ,#4 )
jump F U N C N A M E
}
.size FUNCNAME,. - F U N C N A M E