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

Michal Orzel posted 1 patch 2 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240903124834.2240364-1-michal.orzel@amd.com
xen/arch/arm/include/asm/div64.h | 16 ----------------
1 file changed, 16 deletions(-)
[PATCH] arm/div64: Drop do_div() macro for GCC version < 4
Posted by Michal Orzel 2 weeks, 2 days ago
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.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
To be merged after:
https://lore.kernel.org/xen-devel/20240902100355.3032079-2-andrew.cooper3@citrix.com
---
 xen/arch/arm/include/asm/div64.h | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/div64.h
index da1f1fcbd503..8fe17f0ff27c 100644
--- a/xen/arch/arm/include/asm/div64.h
+++ b/xen/arch/arm/include/asm/div64.h
@@ -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
-- 
2.25.1
Re: [PATCH] arm/div64: Drop do_div() macro for GCC version < 4
Posted by Stefano Stabellini 2 weeks, 2 days ago
On Tue, 3 Sep 2024, Michal Orzel wrote:
> 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.
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
> To be merged after:
> https://lore.kernel.org/xen-devel/20240902100355.3032079-2-andrew.cooper3@citrix.com
> ---
>  xen/arch/arm/include/asm/div64.h | 16 ----------------
>  1 file changed, 16 deletions(-)
> 
> diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/div64.h
> index da1f1fcbd503..8fe17f0ff27c 100644
> --- a/xen/arch/arm/include/asm/div64.h
> +++ b/xen/arch/arm/include/asm/div64.h
> @@ -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
> -- 
> 2.25.1
>
Re: [PATCH] arm/div64: Drop do_div() macro for GCC version < 4
Posted by Andrew Cooper 2 weeks, 2 days ago
On 03/09/2024 1:48 pm, Michal Orzel wrote:
> 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.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

FWIW, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>