diff mbox

[RFC,LIBGCC,2,of,2] 64 bit divide implementation for processor without hw divide instruction

Message ID 52900AEC.2060301@linaro.org
State Superseded
Headers show

Commit Message

Kugan Vivekanandarajah Nov. 23, 2013, 1:54 a.m. UTC
Hi All,

This RFC patch enables new divide algorithm for ARMV7-A

Regression tested on arm-none-linux-gnueabi with no issues.

OK?

Thanks,
Kugan

+2013-11-22  Kugan Vivekanandarajah  <kuganv@linaro.org>
+
+	* libgcc/config/arm/pbapi-lib.h (HAVE_NO_HW_DIVIDE): Define for
+	__ARM_ARCH_7_A__.
+

Comments

Richard Earnshaw Nov. 26, 2013, 3:07 p.m. UTC | #1
On 23/11/13 01:54, Kugan wrote:
> Hi All,
> 
> This RFC patch enables new divide algorithm for ARMV7-A
> 
> Regression tested on arm-none-linux-gnueabi with no issues.
> 
> OK?
> 
> Thanks,
> Kugan
> 
> +2013-11-22  Kugan Vivekanandarajah  <kuganv@linaro.org>
> +
> +	* libgcc/config/arm/pbapi-lib.h (HAVE_NO_HW_DIVIDE): Define for

It's bpabi-lib.h

> +	__ARM_ARCH_7_A__.
> +
> 
> 

No, this will:
1) Do the wrong thing for Cortex-a7, A12 and A15 (which all have HW
divide, and currently define __ARM_ARCH_7_A__).
2) Do the wrong thing for v7-M and v7-R devices, which have Thumb HW
division instructions.
3) Do the wrong thing for all pre-v7 devices, which don't have HW division.

I think the correct solution is to test !defined(__ARM_ARCH_EXT_IDIV__)

R.

> p2.txt
> 
> 
> diff --git a/libgcc/config/arm/bpabi-lib.h b/libgcc/config/arm/bpabi-lib.h
> index e0e46a6..85171c8 100644
> --- a/libgcc/config/arm/bpabi-lib.h
> +++ b/libgcc/config/arm/bpabi-lib.h
> @@ -75,3 +75,7 @@
>     helper functions - not everything in libgcc - in the interests of
>     maintaining backward compatibility.  */
>  #define LIBGCC2_FIXEDBIT_GNU_PREFIX
> +
> +#if defined(__ARM_ARCH_7A__)
> +# define HAVE_NO_HW_DIVIDE
> +#endif
>
diff mbox

Patch

diff --git a/libgcc/config/arm/bpabi-lib.h b/libgcc/config/arm/bpabi-lib.h
index e0e46a6..85171c8 100644
--- a/libgcc/config/arm/bpabi-lib.h
+++ b/libgcc/config/arm/bpabi-lib.h
@@ -75,3 +75,7 @@ 
    helper functions - not everything in libgcc - in the interests of
    maintaining backward compatibility.  */
 #define LIBGCC2_FIXEDBIT_GNU_PREFIX
+
+#if defined(__ARM_ARCH_7A__)
+# define HAVE_NO_HW_DIVIDE
+#endif