[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240705022334.1378363-2-nico@fluxnic.net>
Date: Thu, 4 Jul 2024 22:20:28 -0400
From: Nicolas Pitre <nico@...xnic.net>
To: Arnd Bergmann <arnd@...db.de>,
Russell King <linux@...linux.org.uk>
Cc: Nicolas Pitre <npitre@...libre.com>,
linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] ARM: div64: remove custom __arch_xprod_64()
From: Nicolas Pitre <npitre@...libre.com>
Turns out that the compiler does a better job with the generic C version
these days. In any case, an even better generic implementation is
coming next, making this code doubly obsolete.
Signed-off-by: Nicolas Pitre <npitre@...libre.com>
---
arch/arm/include/asm/div64.h | 52 ------------------------------------
1 file changed, 52 deletions(-)
diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h
index 4b69cf8504..99b80db595 100644
--- a/arch/arm/include/asm/div64.h
+++ b/arch/arm/include/asm/div64.h
@@ -52,58 +52,6 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
#else
-static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
-{
- unsigned long long res;
- register unsigned int tmp asm("ip") = 0;
-
- if (!bias) {
- asm ( "umull %Q0, %R0, %Q1, %Q2\n\t"
- "mov %Q0, #0"
- : "=&r" (res)
- : "r" (m), "r" (n)
- : "cc");
- } else if (!(m & ((1ULL << 63) | (1ULL << 31)))) {
- res = m;
- asm ( "umlal %Q0, %R0, %Q1, %Q2\n\t"
- "mov %Q0, #0"
- : "+&r" (res)
- : "r" (m), "r" (n)
- : "cc");
- } else {
- asm ( "umull %Q0, %R0, %Q2, %Q3\n\t"
- "cmn %Q0, %Q2\n\t"
- "adcs %R0, %R0, %R2\n\t"
- "adc %Q0, %1, #0"
- : "=&r" (res), "+&r" (tmp)
- : "r" (m), "r" (n)
- : "cc");
- }
-
- if (!(m & ((1ULL << 63) | (1ULL << 31)))) {
- asm ( "umlal %R0, %Q0, %R1, %Q2\n\t"
- "umlal %R0, %Q0, %Q1, %R2\n\t"
- "mov %R0, #0\n\t"
- "umlal %Q0, %R0, %R1, %R2"
- : "+&r" (res)
- : "r" (m), "r" (n)
- : "cc");
- } else {
- asm ( "umlal %R0, %Q0, %R2, %Q3\n\t"
- "umlal %R0, %1, %Q2, %R3\n\t"
- "mov %R0, #0\n\t"
- "adds %Q0, %1, %Q0\n\t"
- "adc %R0, %R0, #0\n\t"
- "umlal %Q0, %R0, %R2, %R3"
- : "+&r" (res), "+&r" (tmp)
- : "r" (m), "r" (n)
- : "cc");
- }
-
- return res;
-}
-#define __arch_xprod_64 __arch_xprod_64
-
#include <asm-generic/div64.h>
#endif
--
2.45.2
Powered by blists - more mailing lists