aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/switch32.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arm/switch32.S')
-rw-r--r--lib/arm/switch32.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/arm/switch32.S b/lib/arm/switch32.S
index 7008fccb18ee..3152dfa1d0be 100644
--- a/lib/arm/switch32.S
+++ b/lib/arm/switch32.S
@@ -34,9 +34,10 @@ DEFINE_COMPILERRT_PRIVATE_FUNCTION(__switch32)
ldr ip, [lr, #-1] // get first 32-bit word in table
cmp r0, ip // compare with index
add r0, lr, r0, lsl #2 // compute address of element in table
- ldrcc r0, [r0, #3] // load 32-bit element if r0 is in range
add ip, lr, ip, lsl #2 // compute address of last element in table
- ldrcs r0, [ip, #3] // load 32-bit element if r0 out of range
+ ite lo
+ ldrlo r0, [r0, #3] // load 32-bit element if r0 is in range
+ ldrhs r0, [ip, #3] // load 32-bit element if r0 out of range
add ip, lr, r0 // compute label = lr + element
bx ip // jump to computed label