Skip to contentSkip to conversation

arm/div64: Drop do_div() macro for GCC version < 4

PATCH In review Michal Orzel 3 participants 3 messages Sep 3, 2024 – Sep 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm/div64: Drop do_div() macro for GCC version < 4

As stated in README, the minimum supported GCC version for arm32 is 4.9, therefore drop the custom do_div() macro in favor of using the optimized version.

---
To be merged after:
https://lore.kernel.org/xen-devel/[email protected]

---
 xen/arch/arm/include/asm/div64.h | 16 ----------------
 1 file changed, 16 deletions(-)
xen/arch/arm/include/asm/div64.h +0 -16
index da1f1fcbd503..8fe17f0ff27c 100644
@@ -54,20 +54,6 @@
 	__rem;							\
 })
 
-#if __GNUC__ < 4
-
-/*
- * gcc versions earlier than 4.0 are simply too problematic for the
- * optimized implementation below. First there is gcc PR 15089 that
- * tend to trig on more complex constructs, spurious .global __udivsi3
- * are inserted even if none of those symbols are referenced in the
- * generated code, and those gcc versions are not able to do constant
- * propagation on long long values anyway.
- */
-#define do_div(n, base) __do_div_asm(n, base)
-
-#elif __GNUC__ >= 4
-
 #include <xen/bug.h>
 
 /*
@@ -217,8 +203,6 @@
 	__r;								\
 })
 
-#endif /* GCC version */
-
 #endif /* BITS_PER_LONG */
 
 #endif
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#2 lore raw
In reply to Michal Orzel
Quoted 6 lines · Michal Orzel

As stated in README, the minimum supported GCC version for arm32 is 4.9, therefore drop the custom do_div() macro in favor of using the optimized version.

Quoted 44 lines

---
To be merged after:
https://lore.kernel.org/xen-devel/[email protected]

---
 xen/arch/arm/include/asm/div64.h | 16 ----------------
 1 file changed, 16 deletions(-)
xen/arch/arm/include/asm/div64.h +0 -16
index da1f1fcbd503..8fe17f0ff27c 100644
@@ -54,20 +54,6 @@
 	__rem;							\
 })
 
-#if __GNUC__ < 4
-
-/*
- * gcc versions earlier than 4.0 are simply too problematic for the
- * optimized implementation below. First there is gcc PR 15089 that
- * tend to trig on more complex constructs, spurious .global __udivsi3
- * are inserted even if none of those symbols are referenced in the
- * generated code, and those gcc versions are not able to do constant
- * propagation on long long values anyway.
- */
-#define do_div(n, base) __do_div_asm(n, base)
-
-#elif __GNUC__ >= 4
-
 #include <xen/bug.h>
 
 /*
@@ -217,8 +203,6 @@
 	__r;								\
 })
 
-#endif /* GCC version */
-
 #endif /* BITS_PER_LONG */
 
 #endif
Signature · 1 line
2.25.1