From c9b7cb672bfa0c22250a40316acc6ef0b9f5d6fe Mon Sep 17 00:00:00 2001 From: kazu Date: Fri, 14 Nov 2003 02:06:37 +0000 Subject: [PATCH] * config/h8300/lib1funcs.asm (divmodsi4): Replace all the uses of er4 with er3. Adjust all callers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73572 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/config/h8300/lib1funcs.asm | 30 ++++++++++++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc4c0ad..420ca4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-11-13 Kazu Hirata + + * config/h8300/lib1funcs.asm (divmodsi4): Replace all the uses + of er4 with er3. Adjust all callers. + 2003-11-13 Andrew Pinski * config/darwin.c (machopic_output_possible_stub_label): diff --git a/gcc/config/h8300/lib1funcs.asm b/gcc/config/h8300/lib1funcs.asm index 3e7d89f..7316429 100644 --- a/gcc/config/h8300/lib1funcs.asm +++ b/gcc/config/h8300/lib1funcs.asm @@ -442,7 +442,7 @@ ___modsi3: mov S0,A0 mov S1,A1 #else - mov.l S0P,A0P + mov.l er3,er0 #endif bra exitdiv @@ -455,10 +455,7 @@ ___udivsi3: bsr divmodsi4 bra reti #else - ;; H8/300H and H8S version of divmodsi4 does not clobber S1P or S2P. - PUSHP S0P bsr divmodsi4 - POPP S0P rts #endif @@ -473,11 +470,8 @@ ___umodsi3: mov S1,A1 bra reti #else - ;; H8/300H and H8S version of divmodsi4 does not clobber S1P or S2P. - PUSHP S0P bsr divmodsi4 - mov.l S0P,A0P - POPP S0P + mov.l er3,er0 rts #endif @@ -608,17 +602,17 @@ divmodsi4: divxu.w A1,A2P mov.w A2E,A0E divxu.w A1,A0P - mov.w A0E,S0 + mov.w A0E,A3 mov.w A2,A0E - extu.l S0P + extu.l A3P rts ; er0 = er0 / er1 - ; er4 = er0 % er1 + ; er3 = er0 % er1 ; trashes er1 er2 ; expects er1 >= 2^16 DenHighNonZero: - mov.l er0,er4 + mov.l er0,er3 mov.l er1,er2 #ifdef __H8300H__ divmod_L21: @@ -647,22 +641,22 @@ divmod_L24: ;; er0 contains shifted dividend ;; er1 contains divisor ;; er2 contains shifted divisor - ;; er4 contains dividend, later remainder + ;; er3 contains dividend, later remainder divxu.w r2,er0 ; r0 now contains the approximate quotient (AQ) extu.l er0 beq divmod_L25 subs #1,er0 ; er0 = AQ - 1 mov.w e1,r2 mulxu.w r0,er2 ; er2 = upper (AQ - 1) * divisor - sub.w r2,e4 ; dividend - 65536 * er2 + sub.w r2,e3 ; dividend - 65536 * er2 mov.w r1,r2 - mulxu.w r0,er2 ; compute er4 = remainder (tentative) - sub.l er2,er4 ; er4 = dividend - (AQ - 1) * divisor + mulxu.w r0,er2 ; compute er3 = remainder (tentative) + sub.l er2,er3 ; er3 = dividend - (AQ - 1) * divisor divmod_L25: - cmp.l er1,er4 ; is divisor < remainder? + cmp.l er1,er3 ; is divisor < remainder? blo divmod_L26 adds #1,er0 - sub.l er1,er4 ; correct the remainder + sub.l er1,er3 ; correct the remainder divmod_L26: rts -- 2.7.4