Skip to content

Commit 884afaa

Browse files
Nicolas PitreRussell King
authored andcommitted
[ARM] 5320/1: fix assembly constraints in implementation of do_div()
Those inline assembly segments using the umlal instruction must have the & modifier so to be sure that a purely input register won't alias one of the registers used as input+output. In most cases, the inputs are still used after the outputs are touched, and most binutil versions insist on "rdhi, rdlo and rm must all be different" even for ARMv6+. Signed-off-by: Nicolas Pitre <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent f80a3bb commit 884afaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm/include/asm/div64.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
__res = __m; \
166166
asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t" \
167167
"mov %Q0, #0" \
168-
: "+r" (__res) \
168+
: "+&r" (__res) \
169169
: "r" (__m), "r" (__n) \
170170
: "cc" ); \
171171
} else { \
@@ -182,7 +182,7 @@
182182
"umlal %R0, %Q0, %Q1, %R2\n\t" \
183183
"mov %R0, #0\n\t" \
184184
"umlal %Q0, %R0, %R1, %R2" \
185-
: "+r" (__res) \
185+
: "+&r" (__res) \
186186
: "r" (__m), "r" (__n) \
187187
: "cc" ); \
188188
} else { \
@@ -192,7 +192,7 @@
192192
"adds %Q0, %1, %Q0\n\t" \
193193
"adc %R0, %R0, #0\n\t" \
194194
"umlal %Q0, %R0, %R2, %R3" \
195-
: "+r" (__res), "+r" (__z) \
195+
: "+&r" (__res), "+&r" (__z) \
196196
: "r" (__m), "r" (__n) \
197197
: "cc" ); \
198198
} \

0 commit comments

Comments
 (0)