[Gmp-commit] /var/hg/gmp: Cleanup arm32 support and handle thumb-less armv4 c...

mercurial at gmplib.org mercurial at gmplib.org
Sat Dec 5 23:59:41 UTC 2015


details:   /var/hg/gmp/rev/8b7b76d0c0dc
changeset: 16985:8b7b76d0c0dc
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Sun Dec 06 00:57:30 2015 +0100
description:
Cleanup arm32 support and handle thumb-less armv4 chips.

diffstat:

 configure.ac              |  34 ++++++++++++----------------------
 mpn/arm/aorslsh1_n.asm    |   2 +-
 mpn/arm/arm-defs.m4       |   3 +++
 mpn/arm/bdiv_dbm1c.asm    |   2 +-
 mpn/arm/cnd_aors_n.asm    |   2 +-
 mpn/arm/com.asm           |   2 +-
 mpn/arm/copyd.asm         |   2 +-
 mpn/arm/copyi.asm         |   2 +-
 mpn/arm/dive_1.asm        |   4 ++--
 mpn/arm/invert_limb.asm   |   2 +-
 mpn/arm/logops_n.asm      |   2 +-
 mpn/arm/lshift.asm        |   2 +-
 mpn/arm/lshiftc.asm       |   2 +-
 mpn/arm/mod_34lsub1.asm   |   4 ++--
 mpn/arm/mode1o.asm        |   2 +-
 mpn/arm/rsh1aors_n.asm    |   2 +-
 mpn/arm/rshift.asm        |   2 +-
 mpn/arm/sec_tabselect.asm |   4 ++--
 mpn/arm/udiv.asm          |   2 +-
 19 files changed, 35 insertions(+), 42 deletions(-)

diffs (274 lines):

diff -r a267174fe00b -r 8b7b76d0c0dc configure.ac
--- a/configure.ac	Sun Dec 06 00:51:50 2015 +0100
+++ b/configure.ac	Sun Dec 06 00:57:30 2015 +0100
@@ -625,35 +625,23 @@
     # either enforce them, or organise to strip paths as the corresponding
     # options fail.
     case $host_cpu in
-      armv7*)
-	path="arm/v6t2 arm/v6 arm/v5 arm"
-	gcc_cflags_arch="-march=armv7-a"
+      armsa1 | arm7t* | arm9t* | armv4t*)
+	path="arm"
+	gcc_cflags_arch="-march=armv4"
 	;;
-      armv6t2*)
+      armxscale | arm7ej | arm9te | arm9e* | arm10* | armv5*)
+	path="arm/v5 arm"
+	gcc_cflags_arch="-march=armv5"
+	;;
+      arm1156 | armv6t2*)
 	path="arm/v6t2 arm/v6 arm/v5 arm"
 	gcc_cflags_arch="-march=armv6t2"
 	;;
-      armv6*)
+      arm11* | armv6*)
 	path="arm/v6 arm/v5 arm"
 	gcc_cflags_arch="-march=armv6"
 	;;
-      armsa1 | arm9tdmi | armv4*)
-	path="arm"
-	gcc_cflags_arch="-march=armv4"
-	;;
-      armxscale | arm9te | arm10 | armv5*)
-	path="arm/v5 arm"
-	gcc_cflags_arch="-march=armv5"
-	;;
-      arm11mpcore | arm1136 | arm1176*)
-	path="arm/v6 arm/v5 arm"
-	gcc_cflags_arch="-march=armv6"
-	;;
-      arm1156)
-	path="arm/v6t2 arm/v6 arm/v5 arm"
-	gcc_cflags_arch="-march=armv6t2"
-	;;
-      armcortexa5)
+      armcortexa5 | armv7*)
 	path="arm/v6t2 arm/v6 arm/v5 arm"
 	gcc_cflags_arch="-march=armv7-a"
 	;;
@@ -703,6 +691,8 @@
 	;;
       *)
 	path="arm"
+	gcc_cflags_arch="-march=armv4"
+	GMP_DEFINE_RAW(["define(<NOTHUMB>,1)"])
 	;;
     esac
     ;;
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/aorslsh1_n.asm
--- a/mpn/arm/aorslsh1_n.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/aorslsh1_n.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -163,5 +163,5 @@
 	REVCY(r12)
 L(rt0):	RETVAL(	r14)
 	pop	{r4-r10r11, r14}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/arm-defs.m4
--- a/mpn/arm/arm-defs.m4	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/arm-defs.m4	Sun Dec 06 00:57:30 2015 +0100
@@ -84,6 +84,9 @@
 ')dnl
 ')
 
+define(`ret',`ifdef(`NOTHUMB',`mov	pc, ',`bx')')
+
+
 define(`EPILOGUE_cpu',
 `lea_list
 	SIZE(`$1',.-`$1')')
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/bdiv_dbm1c.asm
--- a/mpn/arm/bdiv_dbm1c.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/bdiv_dbm1c.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -109,5 +109,5 @@
 	str	r5, [qp]
 	sbc	r0, r5, r12
 	pop	{r4, r5, r6, r7, r8}
-	bx	lr
+	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/cnd_aors_n.asm
--- a/mpn/arm/cnd_aors_n.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/cnd_aors_n.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -130,5 +130,5 @@
 
 L(end):	RETVAL
 	pop	{r4-r11}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/com.asm
--- a/mpn/arm/com.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/com.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -71,5 +71,5 @@
 	bne	L(top)
 
 	ldmfd	sp!, { r7, r8, r9 }		C restore regs from stack
-L(rtn):	bx	lr
+L(rtn):	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/copyd.asm
--- a/mpn/arm/copyd.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/copyd.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -80,5 +80,5 @@
 
 L(end):	stmda	rp, { r3,r4,r5,r12 }
 	pop	{ r4-r5 }
-L(rtn):	bx	lr
+L(rtn):	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/copyi.asm
--- a/mpn/arm/copyi.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/copyi.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -75,5 +75,5 @@
 
 L(end):	stm	rp, { r3,r4,r5,r12 }
 	pop	{ r4-r5 }
-L(rtn):	bx	lr
+L(rtn):	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/dive_1.asm
--- a/mpn/arm/dive_1.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/dive_1.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -112,7 +112,7 @@
 	mul	r9, r4, cy
 	str	r9, [rp]
 	pop	{r4-r9}
-	bx	r14
+	ret	r14
 
 L(unnorm):
 	rsb	tnc, cnt, #32
@@ -136,7 +136,7 @@
 	mul	r9, r4, cy
 	str	r9, [rp]
 	pop	{r4-r9}
-	bx	r14
+	ret	r14
 EPILOGUE()
 
 	RODATA
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/invert_limb.asm
--- a/mpn/arm/invert_limb.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/invert_limb.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -52,7 +52,7 @@
 	adds	r1, r12, r0
 	adc	r3, r3, r0
 	rsb	r0, r3, r2
-	bx	lr
+	ret	lr
 EPILOGUE()
 
 	RODATA
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/logops_n.asm
--- a/mpn/arm/logops_n.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/logops_n.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -135,5 +135,5 @@
 	pop	{ r4, r5, r6, r7 }	C popping r8-r10 here strangely fails
 
 L(rtn):	pop	{ r8, r9, r10 }
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/lshift.asm
--- a/mpn/arm/lshift.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/lshift.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -84,5 +84,5 @@
 L(1):	str	r7, [rp, #-4]
 	mov	r0, r4, lsr tnc
 	pop	{r4, r6, r7, r8}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/lshiftc.asm
--- a/mpn/arm/lshiftc.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/lshiftc.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -91,5 +91,5 @@
 	str	r7, [rp, #-4]
 	mov	r0, r4, lsr tnc
 	pop	{r4, r6, r7, r8}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/mod_34lsub1.asm
--- a/mpn/arm/mod_34lsub1.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/mod_34lsub1.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -106,7 +106,7 @@
 	add	r0, r0, r12, lsr #8
 
 	pop	{ r4, r5, r6, r7 }
-	bx	lr
+	ret	lr
 
 L(le2):	cmn	n, #1
 	bne	L(1)
@@ -117,5 +117,5 @@
 	bic	r0, r2, #0xff000000
 	add	r0, r0, r2, lsr #24
 	pop	{ r4, r5, r6, r7 }
-	bx	lr
+	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/mode1o.asm
--- a/mpn/arm/mode1o.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/mode1o.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -88,5 +88,5 @@
 	addcc	r0, r0, #1
 
 	ldmfd	sp!, {r4, r5}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/rsh1aors_n.asm
--- a/mpn/arm/rsh1aors_n.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/rsh1aors_n.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -120,5 +120,5 @@
 	str	r4, [rp, #0]
 	mov	r0, r11
 	pop	{r4-r11}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/rshift.asm
--- a/mpn/arm/rshift.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/rshift.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -82,5 +82,5 @@
 L(1):	str	r7, [rp]
 	mov	r0, r4, lsl tnc
 	pop	{r4, r6, r7, r8}
-	bx	r14
+	ret	r14
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/sec_tabselect.asm
--- a/mpn/arm/sec_tabselect.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/sec_tabselect.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -109,7 +109,7 @@
 	bge	L(tp2)
 	stmia	rp, {r8,r9}
 	pop	{r4-r11, r14}
-	bx	lr
+	ret	lr
 
 L(n2):	cmp	j, #-2
 	bne	L(n1)
@@ -127,5 +127,5 @@
 	bge	L(tp1)
 	str	r8, [rp]
 L(n1):	pop	{r4-r11, r14}
-	bx	lr
+	ret	lr
 EPILOGUE()
diff -r a267174fe00b -r 8b7b76d0c0dc mpn/arm/udiv.asm
--- a/mpn/arm/udiv.asm	Sun Dec 06 00:51:50 2015 +0100
+++ b/mpn/arm/udiv.asm	Sun Dec 06 00:57:30 2015 +0100
@@ -61,7 +61,7 @@
 
 	str	n1, [rem_ptr]		C store remainder
 	adc	r0, n0, n0		C quotient: add last carry from divstep
-	bx	lr
+	ret	lr
 
 L(_large_divisor):
 	stmfd	sp!, { r8, lr }


More information about the gmp-commit mailing list