(___modsi3): Correctly set SIGN register for modulo involving negative
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 22 Jun 1995 22:52:32 +0000 (18:52 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 22 Jun 1995 22:52:32 +0000 (18:52 -0400)
numbers.

From-SVN: r10029

gcc/config/arm/lib1funcs.asm

index 73137c0065873f02d93109b542ff6581e44f642e..0be7b13794fef087d311f9e50210629d477d4fdf 100644 (file)
@@ -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