diff options
author | Anton Blanchard <anton@samba.org> | 2010-12-07 14:58:17 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-12-08 23:35:30 -0500 |
commit | b5f9b6665b70b4c844bed5452f6a14743eefa57c (patch) | |
tree | 51c632149aa23af7eaa68283416dba9d8b8ee3b8 /arch/powerpc/lib | |
parent | b8c49def6d73321724bab66dd30526744b482f0a (diff) |
powerpc: Hardcode popcnt instructions for old assemblers
The popcnt instructions went into binutils relatively recently. As with a
number of other instructions, create macros and hardcode them.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/hweight_64.S | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/lib/hweight_64.S b/arch/powerpc/lib/hweight_64.S index ee2320bb5ddf..fda27868cf8c 100644 --- a/arch/powerpc/lib/hweight_64.S +++ b/arch/powerpc/lib/hweight_64.S | |||
@@ -28,7 +28,7 @@ BEGIN_FTR_SECTION | |||
28 | nop | 28 | nop |
29 | nop | 29 | nop |
30 | FTR_SECTION_ELSE | 30 | FTR_SECTION_ELSE |
31 | popcntb r3,r3 | 31 | PPC_POPCNTB(r3,r3) |
32 | clrldi r3,r3,64-8 | 32 | clrldi r3,r3,64-8 |
33 | blr | 33 | blr |
34 | ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) | 34 | ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) |
@@ -42,14 +42,14 @@ BEGIN_FTR_SECTION | |||
42 | nop | 42 | nop |
43 | FTR_SECTION_ELSE | 43 | FTR_SECTION_ELSE |
44 | BEGIN_FTR_SECTION_NESTED(50) | 44 | BEGIN_FTR_SECTION_NESTED(50) |
45 | popcntb r3,r3 | 45 | PPC_POPCNTB(r3,r3) |
46 | srdi r4,r3,8 | 46 | srdi r4,r3,8 |
47 | add r3,r4,r3 | 47 | add r3,r4,r3 |
48 | clrldi r3,r3,64-8 | 48 | clrldi r3,r3,64-8 |
49 | blr | 49 | blr |
50 | FTR_SECTION_ELSE_NESTED(50) | 50 | FTR_SECTION_ELSE_NESTED(50) |
51 | clrlwi r3,r3,16 | 51 | clrlwi r3,r3,16 |
52 | popcntw r3,r3 | 52 | PPC_POPCNTW(r3,r3) |
53 | clrldi r3,r3,64-8 | 53 | clrldi r3,r3,64-8 |
54 | blr | 54 | blr |
55 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 50) | 55 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 50) |
@@ -66,7 +66,7 @@ BEGIN_FTR_SECTION | |||
66 | nop | 66 | nop |
67 | FTR_SECTION_ELSE | 67 | FTR_SECTION_ELSE |
68 | BEGIN_FTR_SECTION_NESTED(51) | 68 | BEGIN_FTR_SECTION_NESTED(51) |
69 | popcntb r3,r3 | 69 | PPC_POPCNTB(r3,r3) |
70 | srdi r4,r3,16 | 70 | srdi r4,r3,16 |
71 | add r3,r4,r3 | 71 | add r3,r4,r3 |
72 | srdi r4,r3,8 | 72 | srdi r4,r3,8 |
@@ -74,7 +74,7 @@ FTR_SECTION_ELSE | |||
74 | clrldi r3,r3,64-8 | 74 | clrldi r3,r3,64-8 |
75 | blr | 75 | blr |
76 | FTR_SECTION_ELSE_NESTED(51) | 76 | FTR_SECTION_ELSE_NESTED(51) |
77 | popcntw r3,r3 | 77 | PPC_POPCNTW(r3,r3) |
78 | clrldi r3,r3,64-8 | 78 | clrldi r3,r3,64-8 |
79 | blr | 79 | blr |
80 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 51) | 80 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 51) |
@@ -93,7 +93,7 @@ BEGIN_FTR_SECTION | |||
93 | nop | 93 | nop |
94 | FTR_SECTION_ELSE | 94 | FTR_SECTION_ELSE |
95 | BEGIN_FTR_SECTION_NESTED(52) | 95 | BEGIN_FTR_SECTION_NESTED(52) |
96 | popcntb r3,r3 | 96 | PPC_POPCNTB(r3,r3) |
97 | srdi r4,r3,32 | 97 | srdi r4,r3,32 |
98 | add r3,r4,r3 | 98 | add r3,r4,r3 |
99 | srdi r4,r3,16 | 99 | srdi r4,r3,16 |
@@ -103,7 +103,7 @@ FTR_SECTION_ELSE | |||
103 | clrldi r3,r3,64-8 | 103 | clrldi r3,r3,64-8 |
104 | blr | 104 | blr |
105 | FTR_SECTION_ELSE_NESTED(52) | 105 | FTR_SECTION_ELSE_NESTED(52) |
106 | popcntd r3,r3 | 106 | PPC_POPCNTD(r3,r3) |
107 | clrldi r3,r3,64-8 | 107 | clrldi r3,r3,64-8 |
108 | blr | 108 | blr |
109 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 52) | 109 | ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 52) |