aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/umodsi3.S
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arm/umodsi3.S')
-rw-r--r--lib/arm/umodsi3.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/arm/umodsi3.S b/lib/arm/umodsi3.S
index 328e7054b857..092a4f1a2062 100644
--- a/lib/arm/umodsi3.S
+++ b/lib/arm/umodsi3.S
@@ -23,7 +23,7 @@
.syntax unified
.align 3
DEFINE_COMPILERRT_FUNCTION(__umodsi3)
-#if __ARM_ARCH_7S__
+#if __ARM_ARCH_EXT_IDIV__
tst r1, r1
beq LOCAL_LABEL(divzero)
udiv r2, r0, r1
@@ -57,13 +57,16 @@ LOCAL_LABEL(mainLoop):
// this way, we can merge the two branches which is a substantial win for
// such a tight loop on current ARM architectures.
subs r, a, b, lsl i
+ it hs
movhs a, r
+ it ne
subsne i, i, #1
bhi LOCAL_LABEL(mainLoop)
// Do the final test subtraction and update of remainder (i == 0), as it is
// not performed in the main loop.
subs r, a, b
+ it hs
movhs a, r
bx lr
#endif