Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3ade2fe0
Commit
3ade2fe0
authored
Jun 20, 2005
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] ARM: Lindent GCC helper functions
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
f29481c0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
274 additions
and
313 deletions
+274
-313
arch/arm/lib/ashldi3.c
arch/arm/lib/ashldi3.c
+21
-26
arch/arm/lib/ashrdi3.c
arch/arm/lib/ashrdi3.c
+22
-26
arch/arm/lib/gcclib.h
arch/arm/lib/gcclib.h
+11
-9
arch/arm/lib/longlong.h
arch/arm/lib/longlong.h
+1
-1
arch/arm/lib/lshrdi3.c
arch/arm/lib/lshrdi3.c
+21
-26
arch/arm/lib/muldi3.c
arch/arm/lib/muldi3.c
+8
-13
arch/arm/lib/ucmpdi2.c
arch/arm/lib/ucmpdi2.c
+14
-16
arch/arm/lib/udivdi3.c
arch/arm/lib/udivdi3.c
+176
-196
No files found.
arch/arm/lib/ashldi3.c
View file @
3ade2fe0
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
#include "gcclib.h"
s64
s64
__ashldi3
(
s64
u
,
int
b
)
__ashldi3
(
s64
u
,
int
b
)
{
{
DIunion
w
;
DIunion
w
;
int
bm
;
int
bm
;
...
@@ -43,19 +42,15 @@ __ashldi3 (s64 u, int b)
...
@@ -43,19 +42,15 @@ __ashldi3 (s64 u, int b)
uu
.
ll
=
u
;
uu
.
ll
=
u
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
if
(
bm
<=
0
)
if
(
bm
<=
0
)
{
{
w
.
s
.
low
=
0
;
w
.
s
.
low
=
0
;
w
.
s
.
high
=
(
u32
)
uu
.
s
.
low
<<
-
bm
;
w
.
s
.
high
=
(
u32
)
uu
.
s
.
low
<<
-
bm
;
}
}
else
{
else
u32
carries
=
(
u32
)
uu
.
s
.
low
>>
bm
;
{
w
.
s
.
low
=
(
u32
)
uu
.
s
.
low
<<
b
;
u32
carries
=
(
u32
)
uu
.
s
.
low
>>
bm
;
w
.
s
.
high
=
((
u32
)
uu
.
s
.
high
<<
b
)
|
carries
;
w
.
s
.
low
=
(
u32
)
uu
.
s
.
low
<<
b
;
w
.
s
.
high
=
((
u32
)
uu
.
s
.
high
<<
b
)
|
carries
;
}
}
return
w
.
ll
;
return
w
.
ll
;
}
}
arch/arm/lib/ashrdi3.c
View file @
3ade2fe0
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
#include "gcclib.h"
s64
s64
__ashrdi3
(
s64
u
,
int
b
)
__ashrdi3
(
s64
u
,
int
b
)
{
{
DIunion
w
;
DIunion
w
;
int
bm
;
int
bm
;
...
@@ -43,18 +42,15 @@ __ashrdi3 (s64 u, int b)
...
@@ -43,18 +42,15 @@ __ashrdi3 (s64 u, int b)
uu
.
ll
=
u
;
uu
.
ll
=
u
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
if
(
bm
<=
0
)
if
(
bm
<=
0
)
{
{
/* w.s.high = 1..1 or 0..0 */
/* w.s.high = 1..1 or 0..0 */
w
.
s
.
high
=
uu
.
s
.
high
>>
(
sizeof
(
s32
)
*
BITS_PER_UNIT
-
1
);
w
.
s
.
high
=
uu
.
s
.
high
>>
(
sizeof
(
s32
)
*
BITS_PER_UNIT
-
1
);
w
.
s
.
low
=
uu
.
s
.
high
>>
-
bm
;
w
.
s
.
low
=
uu
.
s
.
high
>>
-
bm
;
}
}
else
{
else
u32
carries
=
(
u32
)
uu
.
s
.
high
<<
bm
;
{
u32
carries
=
(
u32
)
uu
.
s
.
high
<<
bm
;
w
.
s
.
high
=
uu
.
s
.
high
>>
b
;
w
.
s
.
high
=
uu
.
s
.
high
>>
b
;
w
.
s
.
low
=
((
u32
)
uu
.
s
.
low
>>
b
)
|
carries
;
w
.
s
.
low
=
((
u32
)
uu
.
s
.
low
>>
b
)
|
carries
;
}
}
return
w
.
ll
;
return
w
.
ll
;
...
...
arch/arm/lib/gcclib.h
View file @
3ade2fe0
...
@@ -7,14 +7,16 @@
...
@@ -7,14 +7,16 @@
#define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT)
#define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT)
#ifdef __ARMEB__
#ifdef __ARMEB__
struct
DIstruct
{
s32
high
,
low
;};
struct
DIstruct
{
s32
high
,
low
;
};
#else
#else
struct
DIstruct
{
s32
low
,
high
;};
struct
DIstruct
{
s32
low
,
high
;
};
#endif
#endif
typedef
union
typedef
union
{
{
struct
DIstruct
s
;
struct
DIstruct
s
;
s64
ll
;
s64
ll
;
}
DIunion
;
}
DIunion
;
arch/arm/lib/longlong.h
View file @
3ade2fe0
arch/arm/lib/lshrdi3.c
View file @
3ade2fe0
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
#include "gcclib.h"
s64
s64
__lshrdi3
(
s64
u
,
int
b
)
__lshrdi3
(
s64
u
,
int
b
)
{
{
DIunion
w
;
DIunion
w
;
int
bm
;
int
bm
;
...
@@ -43,19 +42,15 @@ __lshrdi3 (s64 u, int b)
...
@@ -43,19 +42,15 @@ __lshrdi3 (s64 u, int b)
uu
.
ll
=
u
;
uu
.
ll
=
u
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
bm
=
(
sizeof
(
s32
)
*
BITS_PER_UNIT
)
-
b
;
if
(
bm
<=
0
)
if
(
bm
<=
0
)
{
{
w
.
s
.
high
=
0
;
w
.
s
.
high
=
0
;
w
.
s
.
low
=
(
u32
)
uu
.
s
.
high
>>
-
bm
;
w
.
s
.
low
=
(
u32
)
uu
.
s
.
high
>>
-
bm
;
}
}
else
{
else
u32
carries
=
(
u32
)
uu
.
s
.
high
<<
bm
;
{
w
.
s
.
high
=
(
u32
)
uu
.
s
.
high
>>
b
;
u32
carries
=
(
u32
)
uu
.
s
.
high
<<
bm
;
w
.
s
.
low
=
((
u32
)
uu
.
s
.
low
>>
b
)
|
carries
;
w
.
s
.
high
=
(
u32
)
uu
.
s
.
high
>>
b
;
w
.
s
.
low
=
((
u32
)
uu
.
s
.
low
>>
b
)
|
carries
;
}
}
return
w
.
ll
;
return
w
.
ll
;
}
}
arch/arm/lib/muldi3.c
View file @
3ade2fe0
...
@@ -52,26 +52,21 @@ Boston, MA 02111-1307, USA. */
...
@@ -52,26 +52,21 @@ Boston, MA 02111-1307, USA. */
: "r" ((u32) (a)), \
: "r" ((u32) (a)), \
"r" ((u32) (b)));}
"r" ((u32) (b)));}
#define __umulsidi3(u, v) \
#define __umulsidi3(u, v) \
({DIunion __w; \
({DIunion __w; \
umul_ppmm (__w.s.high, __w.s.low, u, v); \
umul_ppmm (__w.s.high, __w.s.low, u, v); \
__w.ll; })
__w.ll; })
s64
__muldi3
(
s64
u
,
s64
v
)
s64
__muldi3
(
s64
u
,
s64
v
)
{
{
DIunion
w
;
DIunion
w
;
DIunion
uu
,
vv
;
DIunion
uu
,
vv
;
uu
.
ll
=
u
,
uu
.
ll
=
u
,
vv
.
ll
=
v
;
vv
.
ll
=
v
;
w
.
ll
=
__umulsidi3
(
uu
.
s
.
low
,
vv
.
s
.
low
);
w
.
ll
=
__umulsidi3
(
uu
.
s
.
low
,
vv
.
s
.
low
);
w
.
s
.
high
+=
((
u32
)
uu
.
s
.
low
*
(
u32
)
vv
.
s
.
high
w
.
s
.
high
+=
((
u32
)
uu
.
s
.
low
*
(
u32
)
vv
.
s
.
high
+
(
u32
)
uu
.
s
.
high
*
(
u32
)
vv
.
s
.
low
);
+
(
u32
)
uu
.
s
.
high
*
(
u32
)
vv
.
s
.
low
);
return
w
.
ll
;
return
w
.
ll
;
}
}
arch/arm/lib/ucmpdi2.c
View file @
3ade2fe0
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
#include "gcclib.h"
int
int
__ucmpdi2
(
s64
a
,
s64
b
)
__ucmpdi2
(
s64
a
,
s64
b
)
{
{
DIunion
au
,
bu
;
DIunion
au
,
bu
;
...
@@ -48,4 +47,3 @@ __ucmpdi2 (s64 a, s64 b)
...
@@ -48,4 +47,3 @@ __ucmpdi2 (s64 a, s64 b)
return
2
;
return
2
;
return
1
;
return
1
;
}
}
arch/arm/lib/udivdi3.c
View file @
3ade2fe0
...
@@ -32,20 +32,26 @@ Boston, MA 02111-1307, USA. */
...
@@ -32,20 +32,26 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
#include "gcclib.h"
#include "longlong.h"
#include "longlong.h"
static
const
u8
__clz_tab
[]
=
static
const
u8
__clz_tab
[]
=
{
{
0
,
1
,
2
,
2
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
0
,
1
,
2
,
2
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
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oddi4 (u64 n, u64 d, u64 *rp)
...
@@ -62,16 +68,13 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
n0
=
nn
.
s
.
low
;
n0
=
nn
.
s
.
low
;
n1
=
nn
.
s
.
high
;
n1
=
nn
.
s
.
high
;
if
(
d1
==
0
)
if
(
d1
==
0
)
{
{
if
(
d0
>
n1
)
{
if
(
d0
>
n1
)
{
/* 0q = nn / 0D */
/* 0q = nn / 0D */
count_leading_zeros
(
bm
,
d0
);
count_leading_zeros
(
bm
,
d0
);
if
(
bm
!=
0
)
if
(
bm
!=
0
)
{
{
/* Normalize, i.e. make the most significant bit of the
/* Normalize, i.e. make the most significant bit of the
denominator set. */
denominator set. */
...
@@ -80,22 +83,19 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -80,22 +83,19 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
n0
=
n0
<<
bm
;
n0
=
n0
<<
bm
;
}
}
udiv_qrnnd
(
q0
,
n0
,
n1
,
n0
,
d0
);
udiv_qrnnd
(
q0
,
n0
,
n1
,
n0
,
d0
);
q1
=
0
;
q1
=
0
;
/* Remainder in n0 >> bm. */
/* Remainder in n0 >> bm. */
}
}
else
{
else
{
/* qq = NN / 0d */
/* qq = NN / 0d */
if
(
d0
==
0
)
if
(
d0
==
0
)
d0
=
1
/
d0
;
/* Divide intentionally by zero. */
d0
=
1
/
d0
;
/* Divide intentionally by zero. */
count_leading_zeros
(
bm
,
d0
);
count_leading_zeros
(
bm
,
d0
);
if
(
bm
==
0
)
if
(
bm
==
0
)
{
{
/* From (n1 >= d0) /\ (the most significant bit of d0 is set),
/* From (n1 >= d0) /\ (the most significant bit of d0 is set),
conclude (the most significant bit of n1 is set) /\ (the
conclude (the most significant bit of n1 is set) /\ (the
leading quotient digit q1 = 1).
leading quotient digit q1 = 1).
...
@@ -105,9 +105,7 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -105,9 +105,7 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
n1
-=
d0
;
n1
-=
d0
;
q1
=
1
;
q1
=
1
;
}
}
else
{
else
{
/* Normalize. */
/* Normalize. */
b
=
SI_TYPE_SIZE
-
bm
;
b
=
SI_TYPE_SIZE
-
bm
;
...
@@ -117,47 +115,39 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -117,47 +115,39 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
n1
=
(
n1
<<
bm
)
|
(
n0
>>
b
);
n1
=
(
n1
<<
bm
)
|
(
n0
>>
b
);
n0
=
n0
<<
bm
;
n0
=
n0
<<
bm
;
udiv_qrnnd
(
q1
,
n1
,
n2
,
n1
,
d0
);
udiv_qrnnd
(
q1
,
n1
,
n2
,
n1
,
d0
);
}
}
/* n1 != d0... */
/* n1 != d0... */
udiv_qrnnd
(
q0
,
n0
,
n1
,
n0
,
d0
);
udiv_qrnnd
(
q0
,
n0
,
n1
,
n0
,
d0
);
/* Remainder in n0 >> bm. */
/* Remainder in n0 >> bm. */
}
}
if
(
rp
!=
0
)
if
(
rp
!=
0
)
{
{
rr
.
s
.
low
=
n0
>>
bm
;
rr
.
s
.
low
=
n0
>>
bm
;
rr
.
s
.
high
=
0
;
rr
.
s
.
high
=
0
;
*
rp
=
rr
.
ll
;
*
rp
=
rr
.
ll
;
}
}
}
}
else
{
else
if
(
d1
>
n1
)
{
{
if
(
d1
>
n1
)
{
/* 00 = nn / DD */
/* 00 = nn / DD */
q0
=
0
;
q0
=
0
;
q1
=
0
;
q1
=
0
;
/* Remainder in n1n0. */
/* Remainder in n1n0. */
if
(
rp
!=
0
)
if
(
rp
!=
0
)
{
{
rr
.
s
.
low
=
n0
;
rr
.
s
.
low
=
n0
;
rr
.
s
.
high
=
n1
;
rr
.
s
.
high
=
n1
;
*
rp
=
rr
.
ll
;
*
rp
=
rr
.
ll
;
}
}
}
}
else
{
else
{
/* 0q = NN / dd */
/* 0q = NN / dd */
count_leading_zeros
(
bm
,
d1
);
count_leading_zeros
(
bm
,
d1
);
if
(
bm
==
0
)
if
(
bm
==
0
)
{
{
/* From (n1 >= d1) /\ (the most significant bit of d1 is set),
/* From (n1 >= d1) /\ (the most significant bit of d1 is set),
conclude (the most significant bit of n1 is set) /\ (the
conclude (the most significant bit of n1 is set) /\ (the
quotient digit q0 = 0 or 1).
quotient digit q0 = 0 or 1).
...
@@ -166,25 +156,20 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -166,25 +156,20 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
/* The condition on the next line takes advantage of that
/* The condition on the next line takes advantage of that
n1 >= d1 (true due to program flow). */
n1 >= d1 (true due to program flow). */
if
(
n1
>
d1
||
n0
>=
d0
)
if
(
n1
>
d1
||
n0
>=
d0
)
{
{
q0
=
1
;
q0
=
1
;
sub_ddmmss
(
n1
,
n0
,
n1
,
n0
,
d1
,
d0
);
sub_ddmmss
(
n1
,
n0
,
n1
,
n0
,
d1
,
d0
);
}
}
else
else
q0
=
0
;
q0
=
0
;
q1
=
0
;
q1
=
0
;
if
(
rp
!=
0
)
if
(
rp
!=
0
)
{
{
rr
.
s
.
low
=
n0
;
rr
.
s
.
low
=
n0
;
rr
.
s
.
high
=
n1
;
rr
.
s
.
high
=
n1
;
*
rp
=
rr
.
ll
;
*
rp
=
rr
.
ll
;
}
}
}
}
else
{
else
{
u32
m1
,
m0
;
u32
m1
,
m0
;
/* Normalize. */
/* Normalize. */
...
@@ -196,21 +181,19 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -196,21 +181,19 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
n1
=
(
n1
<<
bm
)
|
(
n0
>>
b
);
n1
=
(
n1
<<
bm
)
|
(
n0
>>
b
);
n0
=
n0
<<
bm
;
n0
=
n0
<<
bm
;
udiv_qrnnd
(
q0
,
n1
,
n2
,
n1
,
d1
);
udiv_qrnnd
(
q0
,
n1
,
n2
,
n1
,
d1
);
umul_ppmm
(
m1
,
m0
,
q0
,
d0
);
umul_ppmm
(
m1
,
m0
,
q0
,
d0
);
if
(
m1
>
n1
||
(
m1
==
n1
&&
m0
>
n0
))
if
(
m1
>
n1
||
(
m1
==
n1
&&
m0
>
n0
))
{
{
q0
--
;
q0
--
;
sub_ddmmss
(
m1
,
m0
,
m1
,
m0
,
d1
,
d0
);
sub_ddmmss
(
m1
,
m0
,
m1
,
m0
,
d1
,
d0
);
}
}
q1
=
0
;
q1
=
0
;
/* Remainder in (n1n0 - m1m0) >> bm. */
/* Remainder in (n1n0 - m1m0) >> bm. */
if
(
rp
!=
0
)
if
(
rp
!=
0
)
{
{
sub_ddmmss
(
n1
,
n0
,
n1
,
n0
,
m1
,
m0
);
sub_ddmmss
(
n1
,
n0
,
n1
,
n0
,
m1
,
m0
);
rr
.
s
.
low
=
(
n1
<<
b
)
|
(
n0
>>
bm
);
rr
.
s
.
low
=
(
n1
<<
b
)
|
(
n0
>>
bm
);
rr
.
s
.
high
=
n1
>>
bm
;
rr
.
s
.
high
=
n1
>>
bm
;
*
rp
=
rr
.
ll
;
*
rp
=
rr
.
ll
;
...
@@ -224,19 +207,16 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
...
@@ -224,19 +207,16 @@ __udivmoddi4 (u64 n, u64 d, u64 *rp)
return
ww
.
ll
;
return
ww
.
ll
;
}
}
u64
u64
__udivdi3
(
u64
n
,
u64
d
)
__udivdi3
(
u64
n
,
u64
d
)
{
{
return
__udivmoddi4
(
n
,
d
,
(
u64
*
)
0
);
return
__udivmoddi4
(
n
,
d
,
(
u64
*
)
0
);
}
}
u64
u64
__umoddi3
(
u64
u
,
u64
v
)
__umoddi3
(
u64
u
,
u64
v
)
{
{
u64
w
;
u64
w
;
(
void
)
__udivmoddi4
(
u
,
v
,
&
w
);
(
void
)
__udivmoddi4
(
u
,
v
,
&
w
);
return
w
;
return
w
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment