summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2019-02-12 14:59:33 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-02-26 16:49:16 -0800
commite4ac1eccf0920f53c1e3532b7ccbc3155c178508 (patch)
treea4ac3d8a693005c4e29df782af6ea2a7a58659e4
parentc2c2776e3a5ee68a1d2a2bab09635692418db998 (diff)
downloadchrome-ec-e4ac1eccf0920f53c1e3532b7ccbc3155c178508.tar.gz
uldivmod.S: fix assembly so that it compiles with clang
Compared the disassembly between compiling with gcc before this change and compiling with clang after the change: arm-none-eabi-objdump --disassemble build/nocturne_fp/RW/core/cortex-m/uldivmod.o --- gcc-uldivmod.txt 2019-02-12 14:54:47.283162092 -0800 +++ clang-uldivmod.txt 2019-02-12 14:52:50.098690222 -0800 @@ -103,5 +103,5 @@ 000000b8 <__aeabi_ldiv0>: b8: 4c01 ldr r4, [pc, #4] ; (c0 <__aeabi_ldiv0+0x8>) ba: f7ff fffe bl 0 <exception_panic> - be: 0000 .short 0x0000 + be: bf00 nop c0: dead6660 .word 0xdead6660 BRANCH=nocturne,nami BUG=chromium:931797 TEST=compare disassembly (see above) Change-Id: I9ab7eb18ffa9bf3e319cdd1f81047577218a0dad Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1470777 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--core/cortex-m/uldivmod.S6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/cortex-m/uldivmod.S b/core/cortex-m/uldivmod.S
index 423036f790..da60793e67 100644
--- a/core/cortex-m/uldivmod.S
+++ b/core/cortex-m/uldivmod.S
@@ -88,7 +88,7 @@ L_sub_loop1:
eor r1, r5 @ undo add mask
adds r2, r6 @ undo subtract
- adc r3, r7
+ adc r3, r3, r7
L_done_sub1:
lsrs r7, #1 @ denom(r7:r6) >>= 1
@@ -114,7 +114,7 @@ L_divison_by_0:
L_fallback_32bits:
mov r1, r0
- udiv r0, r2 @ r0 = quotient
+ udiv r0, r0, r2 @ r0 = quotient
mul r3, r0, r2 @ r3 = quotient * divisor
sub r2, r1, r3 @ r2 = remainder
mov r1, #0
@@ -164,7 +164,7 @@ L_sub_loop4:
eor r0, r5 @ undo add mask
adds r2, r6 @ undo subtract
- adc r3, r7
+ adc r3, r3, r7
L_done_sub4:
lsrs r7, #1 @ denom(r7:r6) >>= 1