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
d600cbed
Commit
d600cbed
authored
Aug 01, 2011
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc: Use hweight64() in popc emulation.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
ef7c4d46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
arch/sparc/kernel/unaligned_64.c
arch/sparc/kernel/unaligned_64.c
+4
-11
No files found.
arch/sparc/kernel/unaligned_64.c
View file @
d600cbed
...
...
@@ -22,6 +22,7 @@
#include <linux/bitops.h>
#include <linux/perf_event.h>
#include <linux/ratelimit.h>
#include <linux/bitops.h>
#include <asm/fpumacro.h>
enum
direction
{
...
...
@@ -373,16 +374,11 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
}
}
static
char
popc_helper
[]
=
{
0
,
1
,
1
,
2
,
1
,
2
,
2
,
3
,
1
,
2
,
2
,
3
,
2
,
3
,
3
,
4
,
};
int
handle_popc
(
u32
insn
,
struct
pt_regs
*
regs
)
{
u64
value
;
int
ret
,
i
,
rd
=
((
insn
>>
25
)
&
0x1f
);
int
from_kernel
=
(
regs
->
tstate
&
TSTATE_PRIV
)
!=
0
;
int
ret
,
rd
=
((
insn
>>
25
)
&
0x1f
);
u64
value
;
perf_sw_event
(
PERF_COUNT_SW_EMULATION_FAULTS
,
1
,
regs
,
0
);
if
(
insn
&
0x2000
)
{
...
...
@@ -392,10 +388,7 @@ int handle_popc(u32 insn, struct pt_regs *regs)
maybe_flush_windows
(
0
,
insn
&
0x1f
,
rd
,
from_kernel
);
value
=
fetch_reg
(
insn
&
0x1f
,
regs
);
}
for
(
ret
=
0
,
i
=
0
;
i
<
16
;
i
++
)
{
ret
+=
popc_helper
[
value
&
0xf
];
value
>>=
4
;
}
ret
=
hweight64
(
value
);
if
(
rd
<
16
)
{
if
(
rd
)
regs
->
u_regs
[
rd
]
=
ret
;
...
...
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