summaryrefslogtreecommitdiffstats
path: root/arch/m68k/lib/ashrdi3.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@linux-m68k.org>2023-09-13 09:13:50 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2023-10-06 10:03:01 +0200
commita0938a8e2fb3de5f7d570f3f283e79d4a23b6fe5 (patch)
tree719bdfce29416d3fbf22f4ec7a6b5e1afd08b7a0 /arch/m68k/lib/ashrdi3.c
parentm68k: emu: Replace strlcpy() with strscpy() (diff)
downloadlinux-a0938a8e2fb3de5f7d570f3f283e79d4a23b6fe5.tar.xz
linux-a0938a8e2fb3de5f7d570f3f283e79d4a23b6fe5.zip
m68k: Use kernel's generic libgcc functions
The arch/m68k/lib versions of the libgcc functions: ashldi3, ashrdi3 and lshrdi3 were taken directly from an older version of gcc. We can use the kernel's own generic lib versions of these - they are virtually identical. Switch to those and remove the m68k local ones. Signed-off-by: Greg Ungerer <gerg@linux-m68k.org> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20230913071350.1939818-1-gerg@kernel.org Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/lib/ashrdi3.c')
-rw-r--r--arch/m68k/lib/ashrdi3.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/arch/m68k/lib/ashrdi3.c b/arch/m68k/lib/ashrdi3.c
deleted file mode 100644
index 5837b1dd3334..000000000000
--- a/arch/m68k/lib/ashrdi3.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
-/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
-This file is part of GNU CC.
-
-GNU CC is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU CC is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details. */
-
-#include <linux/compiler.h>
-#include <linux/export.h>
-
-#define BITS_PER_UNIT 8
-
-typedef int SItype __mode(SI);
-typedef unsigned int USItype __mode(SI);
-typedef int DItype __mode(DI);
-typedef int word_type __mode(__word__);
-
-struct DIstruct {SItype high, low;};
-
-typedef union
-{
- struct DIstruct s;
- DItype ll;
-} DIunion;
-
-DItype
-__ashrdi3 (DItype u, word_type b)
-{
- DIunion w;
- word_type bm;
- DIunion uu;
-
- if (b == 0)
- return u;
-
- uu.ll = u;
-
- bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
- if (bm <= 0)
- {
- /* w.s.high = 1..1 or 0..0 */
- w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
- w.s.low = uu.s.high >> -bm;
- }
- else
- {
- USItype carries = (USItype)uu.s.high << bm;
- w.s.high = uu.s.high >> b;
- w.s.low = ((USItype)uu.s.low >> b) | carries;
- }
-
- return w.ll;
-}
-EXPORT_SYMBOL(__ashrdi3);