summaryrefslogtreecommitdiffstats
path: root/arch/metag/lib/divsi3.S
diff options
context:
space:
mode:
authorJames Hogan <jhogan@kernel.org>2017-10-24 13:07:54 +0100
committerJames Hogan <jhogan@kernel.org>2018-02-22 11:07:21 +0000
commitbb6fb6dfcc17cddac11ac295861f7608194447a7 (patch)
tree47ee071a415546dd01adbf628f61acb80473d476 /arch/metag/lib/divsi3.S
parent91ab883eb21325ad80f3473633f794c78ac87f51 (diff)
downloadop-kernel-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.zip
op-kernel-dev-bb6fb6dfcc17cddac11ac295861f7608194447a7.tar.gz
metag: Remove arch/metag/
The earliest Meta architecture port of Linux I have a record of was an import of a Meta port of Linux v2.4.1 in February 2004, which was worked on significantly over the next few years by Graham Whaley, Will Newton, Matt Fleming, myself and others. Eventually the port was merged into mainline in v3.9 in March 2013, not long after Imagination Technologies bought MIPS Technologies and shifted its CPU focus over to the MIPS architecture. As a result, though the port was maintained for a while, kept on life support for a while longer, and useful for testing a few specific drivers for which I don't have ready access to the equivalent MIPS hardware, it is now essentially dead with no users. It is also stuck using an out-of-tree toolchain based on GCC 4.2.4 which is no longer maintained, now struggles to build modern kernels due to toolchain bugs, and doesn't itself build with a modern GCC. The latest buildroot port is still using an old uClibc snapshot which is no longer served, and the latest uClibc doesn't build with GCC 4.2.4. So lets call it a day and drop the Meta architecture port from the kernel. RIP Meta. Signed-off-by: James Hogan <jhogan@kernel.org> Link: https://lkml.kernel.org/r/95906b76-6ce1-3f84-eaba-c29b4ae952eb@roeck-us.net Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Graham Whaley <graham.whaley@gmail.com> Cc: linux-metag@vger.kernel.org
Diffstat (limited to 'arch/metag/lib/divsi3.S')
-rw-r--r--arch/metag/lib/divsi3.S101
1 files changed, 0 insertions, 101 deletions
diff --git a/arch/metag/lib/divsi3.S b/arch/metag/lib/divsi3.S
deleted file mode 100644
index 9e31abe..0000000
--- a/arch/metag/lib/divsi3.S
+++ /dev/null
@@ -1,101 +0,0 @@
-! SPDX-License-Identifier: GPL-2.0
-! Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
-! Imagination Technologies Ltd
-!
-! Integer divide routines.
-!
-
- .text
- .global ___udivsi3
- .type ___udivsi3,function
- .align 2
-___udivsi3:
-!!
-!! Since core is signed divide case, just set control variable
-!!
- MOV D1Re0,D0Ar2 ! Au already in A1Ar1, Bu -> D1Re0
- MOV D0Re0,#0 ! Result is 0
- MOV D0Ar4,#0 ! Return positive result
- B $LIDMCUStart
- .size ___udivsi3,.-___udivsi3
-
-!!
-!! 32-bit division signed i/p - passed signed 32-bit numbers
-!!
- .global ___divsi3
- .type ___divsi3,function
- .align 2
-___divsi3:
-!!
-!! A already in D1Ar1, B already in D0Ar2 -> make B abs(B)
-!!
- MOV D1Re0,D0Ar2 ! A already in A1Ar1, B -> D1Re0
- MOV D0Re0,#0 ! Result is 0
- XOR D0Ar4,D1Ar1,D1Re0 ! D0Ar4 -ive if result is -ive
- ABS D1Ar1,D1Ar1 ! abs(A) -> Au
- ABS D1Re0,D1Re0 ! abs(B) -> Bu
-$LIDMCUStart:
- CMP D1Ar1,D1Re0 ! Is ( Au > Bu )?
- LSR D1Ar3,D1Ar1,#2 ! Calculate (Au & (~3)) >> 2
- CMPHI D1Re0,D1Ar3 ! OR ( (Au & (~3)) <= (Bu << 2) )?
- LSLSHI D1Ar3,D1Re0,#1 ! Buq = Bu << 1
- BLS $LIDMCUSetup ! Yes: Do normal divide
-!!
-!! Quick divide setup can assume that CurBit only needs to start at 2
-!!
-$LIDMCQuick:
- CMP D1Ar1,D1Ar3 ! ( A >= Buq )?
- ADDCC D0Re0,D0Re0,#2 ! If yes result += 2
- SUBCC D1Ar1,D1Ar1,D1Ar3 ! and A -= Buq
- CMP D1Ar1,D1Re0 ! ( A >= Bu )?
- ADDCC D0Re0,D0Re0,#1 ! If yes result += 1
- SUBCC D1Ar1,D1Ar1,D1Re0 ! and A -= Bu
- ORS D0Ar4,D0Ar4,D0Ar4 ! Return neg result?
- NEG D0Ar2,D0Re0 ! Calculate neg result
- MOVMI D0Re0,D0Ar2 ! Yes: Take neg result
-$LIDMCRet:
- MOV PC,D1RtP
-!!
-!! Setup for general unsigned divide code
-!!
-!! D0Re0 is used to form the result, already set to Zero
-!! D1Re0 is the input Bu value, this gets trashed
-!! D0Ar6 is curbit which is set to 1 at the start and shifted up
-!! D0Ar4 is negative if we should return a negative result
-!! D1Ar1 is the input Au value, eventually this holds the remainder
-!!
-$LIDMCUSetup:
- CMP D1Ar1,D1Re0 ! Is ( Au < Bu )?
- MOV D0Ar6,#1 ! Set curbit to 1
- BCS $LIDMCRet ! Yes: Return 0 remainder Au
-!!
-!! Calculate alignment using FFB instruction
-!!
- FFB D1Ar5,D1Ar1 ! Find first bit of Au
- ANDN D1Ar5,D1Ar5,#31 ! Handle exceptional case.
- ORN D1Ar5,D1Ar5,#31 ! if N bit set, set to 31
- FFB D1Ar3,D1Re0 ! Find first bit of Bu
- ANDN D1Ar3,D1Ar3,#31 ! Handle exceptional case.
- ORN D1Ar3,D1Ar3,#31 ! if N bit set, set to 31
- SUBS D1Ar3,D1Ar5,D1Ar3 ! calculate diff, ffbA - ffbB
- MOV D0Ar2,D1Ar3 ! copy into bank 0
- LSLGT D1Re0,D1Re0,D1Ar3 ! ( > 0) ? left shift B
- LSLGT D0Ar6,D0Ar6,D0Ar2 ! ( > 0) ? left shift curbit
-!!
-!! Now we start the divide proper, logic is
-!!
-!! if ( A >= B ) add curbit to result and subtract B from A
-!! shift curbit and B down by 1 in either case
-!!
-$LIDMCLoop:
- CMP D1Ar1, D1Re0 ! ( A >= B )?
- ADDCC D0Re0, D0Re0, D0Ar6 ! If yes result += curbit
- SUBCC D1Ar1, D1Ar1, D1Re0 ! and A -= B
- LSRS D0Ar6, D0Ar6, #1 ! Shift down curbit, is it zero?
- LSR D1Re0, D1Re0, #1 ! Shift down B
- BNZ $LIDMCLoop ! Was single bit in curbit lost?
- ORS D0Ar4,D0Ar4,D0Ar4 ! Return neg result?
- NEG D0Ar2,D0Re0 ! Calculate neg result
- MOVMI D0Re0,D0Ar2 ! Yes: Take neg result
- MOV PC,D1RtP
- .size ___divsi3,.-___divsi3
OpenPOWER on IntegriCloud