From 83750c274bae76086912ab1e136e7d75f6f976b6 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Thu, 22 Jun 1995 18:52:32 -0400 Subject: [PATCH] (___modsi3): Correctly set SIGN register for modulo involving negative numbers. From-SVN: r10029 --- gcc/config/arm/lib1funcs.asm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm index 73137c00658..0be7b13794f 100644 --- a/gcc/config/arm/lib1funcs.asm +++ b/gcc/config/arm/lib1funcs.asm @@ -135,7 +135,8 @@ NAME: stmdb sp!, REGLIST lr} ifelse(S, `true', ` @ compute sign of result; if neither is negative, no problem - eor SIGN, divisor, dividend @ compute sign + ifelse(OP, `div', `eor SIGN, divisor, dividend @ compute sign', + `mov SIGN, dividend') cmp divisor, #0 rsbmi divisor, divisor, #0 beq Ldiv_zero @@ -1266,7 +1267,7 @@ pc .req r15 ___modsi3: stmdb sp!, {r4, r5, r6, lr} @ compute sign of result; if neither is negative, no problem - eor r6, r1, r0 @ compute sign + mov r6, r0 cmp r1, #0 rsbmi r1, r1, #0 beq Ldiv_zero -- 2.30.2