Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/arm for non-of-power-2 sets, we need to round t...
details: https://anonhg.NetBSD.org/src/rev/b88fa8425ab1
branches: trunk
changeset: 326853:b88fa8425ab1
user: matt <matt%NetBSD.org@localhost>
date: Thu Feb 20 15:52:30 2014 +0000
description:
for non-of-power-2 sets, we need to round to next power of 2. (which is
simply doubling the value and then subtracting 1).
diffstat:
sys/arch/arm/arm/cpufunc_asm_armv7.S | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diffs (30 lines):
diff -r 36cbe64c1c0f -r b88fa8425ab1 sys/arch/arm/arm/cpufunc_asm_armv7.S
--- a/sys/arch/arm/arm/cpufunc_asm_armv7.S Thu Feb 20 15:45:20 2014 +0000
+++ b/sys/arch/arm/arm/cpufunc_asm_armv7.S Thu Feb 20 15:52:30 2014 +0000
@@ -243,6 +243,8 @@
ubfx r2, r0, #13, #15 @ get num sets - 1 from CCSIDR
ubfx r3, r0, #3, #10 @ get numways - 1 from CCSIDR
+ lsl r3, r3, #1 @ double
+ sub r3, r3, #1 @ subtract one (now rounded up)
clz r1, r3 @ number of bits to MSB of way
lsl r3, r3, r1 @ shift into position
mov ip, #1 @
@@ -301,6 +303,8 @@
lsl r1, r1, ip @ r1 = set decr
ubfx ip, r0, #3, #10 @ get numways - 1 from [to be discarded] CCSIDR
+ lsl ip, ip, #1 @ double
+ sub ip, ip, #1 @ subtract one (now rounded up)
clz r2, ip @ number of bits to MSB of way
lsl ip, ip, r2 @ shift by that into way position
mov r0, #1 @
@@ -364,6 +368,8 @@
lsl r1, r1, ip @ r1 = set decr
ubfx ip, r0, #3, #10 @ get numways - 1 from [to be discarded] CCSIDR
+ lsl ip, ip, #1 @ double
+ sub ip, ip, #1 @ subtract one (now rounded up)
clz r2, ip @ number of bits to MSB of way
lsl ip, ip, r2 @ shift by that into way position
mov r0, #1 @
Home |
Main Index |
Thread Index |
Old Index