diff options
author | Michal Simek <monstr@monstr.eu> | 2011-06-10 05:08:57 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2011-10-14 06:24:25 -0400 |
commit | 782d491fc210fac03976d01071145728339b6887 (patch) | |
tree | 04350521d9f3a38b326b56cadaa81512b9b3820e /arch/microblaze | |
parent | c83858b3e6e8db9dbb17641de1a2420bb102ae31 (diff) |
microblaze: Simplify logic for unaligned byte copying
Save jump instruction for unaligned byte copying.
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/lib/uaccess_old.S | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S index 6dfd4a087263..d09f2dce648d 100644 --- a/arch/microblaze/lib/uaccess_old.S +++ b/arch/microblaze/lib/uaccess_old.S | |||
@@ -120,11 +120,10 @@ __copy_tofrom_user: | |||
120 | * r4 - tempval | 120 | * r4 - tempval |
121 | */ | 121 | */ |
122 | beqid r7, 0f /* zero size is not likely */ | 122 | beqid r7, 0f /* zero size is not likely */ |
123 | andi r3, r7, 0x3 /* filter add count */ | ||
124 | bneid r3, bu /* if is odd value then byte copying */ | ||
125 | or r3, r5, r6 /* find if is any to/from unaligned */ | 123 | or r3, r5, r6 /* find if is any to/from unaligned */ |
126 | andi r3, r3, 0x3 /* mask unaligned */ | 124 | or r3, r3, r7 /* find if count is unaligned */ |
127 | bneid r3, bu1 /* it is unaligned -> then jump */ | 125 | andi r3, r3, 0x3 /* mask last 3 bits */ |
126 | bneid r3, bu1 /* if r3 is not zero then byte copying */ | ||
128 | or r3, r0, r0 | 127 | or r3, r0, r0 |
129 | 128 | ||
130 | w1: lw r4, r6, r3 /* at least one 4 byte copy */ | 129 | w1: lw r4, r6, r3 /* at least one 4 byte copy */ |
@@ -141,7 +140,6 @@ w2: sw r4, r5, r3 | |||
141 | .word w2, 0f; | 140 | .word w2, 0f; |
142 | .text | 141 | .text |
143 | 142 | ||
144 | bu: or r3, r0, r0 | ||
145 | bu1: lbu r4,r6,r3 | 143 | bu1: lbu r4,r6,r3 |
146 | bu2: sb r4,r5,r3 | 144 | bu2: sb r4,r5,r3 |
147 | addik r7,r7,-1 | 145 | addik r7,r7,-1 |