summaryrefslogtreecommitdiff
path: root/arch/h8300/lib/modsi3.S
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-02-23 08:47:20 +0100
committerChristoph Hellwig <hch@lst.de>2022-02-23 08:52:50 +0100
commit1c4b5ecb7ea190fa3e9f9d6891e6c90b60e04f24 (patch)
treea9444a92909dc4929e0d1e42301e1d3dbd16c35c /arch/h8300/lib/modsi3.S
parent5c1ee569660d4a205dced9cb4d0306b907fb7599 (diff)
remove the h8300 architecture
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'arch/h8300/lib/modsi3.S')
-rw-r--r--arch/h8300/lib/modsi3.S73
1 files changed, 0 insertions, 73 deletions
diff --git a/arch/h8300/lib/modsi3.S b/arch/h8300/lib/modsi3.S
deleted file mode 100644
index bdc8a002921d..000000000000
--- a/arch/h8300/lib/modsi3.S
+++ /dev/null
@@ -1,73 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include "libgcc.h"
-
-; numerator in A0/A1
-; denominator in A2/A3
- .global __modsi3
-__modsi3:
- PUSHP S2P
- bsr modnorm
- bsr __divsi3
- mov.l er3,er0
- bra exitdiv
-
- .global __umodsi3
-__umodsi3:
- bsr __udivsi3
- mov.l er3,er0
- rts
-
- .global __divsi3
-__divsi3:
- PUSHP S2P
- jsr divnorm
- bsr __udivsi3
-
- ; examine what the sign should be
-exitdiv:
- btst #3,S2L
- beq reti
-
- ; should be -ve
- neg.l A0P
-
-reti:
- POPP S2P
- rts
-
-divnorm:
- mov.l A0P,A0P ; is the numerator -ve
- stc ccr,S2L ; keep the sign in bit 3 of S2L
- bge postive
-
- neg.l A0P ; negate arg
-
-postive:
- mov.l A1P,A1P ; is the denominator -ve
- bge postive2
-
- neg.l A1P ; negate arg
- xor.b #0x08,S2L ; toggle the result sign
-
-postive2:
- rts
-
-;; Basically the same, except that the sign of the divisor determines
-;; the sign.
-modnorm:
- mov.l A0P,A0P ; is the numerator -ve
- stc ccr,S2L ; keep the sign in bit 3 of S2L
- bge mpostive
-
- neg.l A0P ; negate arg
-
-mpostive:
- mov.l A1P,A1P ; is the denominator -ve
- bge mpostive2
-
- neg.l A1P ; negate arg
-
-mpostive2:
- rts
-
- .end