[Gmp-commit] /var/hg/gmp: 4 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Apr 27 01:57:50 CEST 2013


details:   /var/hg/gmp/rev/c4eb790de4cc
changeset: 15755:c4eb790de4cc
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Apr 27 01:54:38 2013 +0200
description:
ARM v6 popham.

details:   /var/hg/gmp/rev/3c564c8a5dbc
changeset: 15756:3c564c8a5dbc
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Apr 27 01:54:56 2013 +0200
description:
ChangeLog

details:   /var/hg/gmp/rev/4d5ffc4a89bd
changeset: 15757:4d5ffc4a89bd
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Apr 27 01:57:22 2013 +0200
description:
(arm*-*-*): Set up path also for plainest CPU variants.

details:   /var/hg/gmp/rev/ae7de7fcd44b
changeset: 15758:ae7de7fcd44b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Apr 27 01:57:43 2013 +0200
description:
ChangeLog

diffstat:

 ChangeLog             |   10 +++
 configure.ac          |    2 +
 mpn/arm/v6/popham.asm |  127 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 139 insertions(+), 0 deletions(-)

diffs (160 lines):

diff -r 1f8b8bd8b2d8 -r ae7de7fcd44b ChangeLog
--- a/ChangeLog	Fri Apr 26 21:18:30 2013 +0200
+++ b/ChangeLog	Sat Apr 27 01:57:43 2013 +0200
@@ -1,3 +1,13 @@
+2013-04-27  Mike Frysinger  <vapier at gentoo.org>
+
+	* configure.ac (arm*-*-*): Set up path also for plainest CPU varaints.
+
+2013-04-27  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/arm/v6/popham.asm: New file.
+
+	* mpn/arm/v7a/cora15/cnd-aors_n.asm: New file.
+
 2013-04-26  Richard Henderson  <rth at twiddle.net>
 
 	* mpn/arm/neon/logops_n.asm: New file.
diff -r 1f8b8bd8b2d8 -r ae7de7fcd44b configure.ac
--- a/configure.ac	Fri Apr 26 21:18:30 2013 +0200
+++ b/configure.ac	Sat Apr 27 01:57:43 2013 +0200
@@ -582,6 +582,8 @@
     # options fail.
     case $host_cpu in
       armsa1 | arm9tdmi | armv4*)
+	path="arm"
+	gcc_cflags_arch="-march=armv4"
 	;;
       armxscale | arm9te | arm10 | armv5*)
 	path="arm/v5 arm"
diff -r 1f8b8bd8b2d8 -r ae7de7fcd44b mpn/arm/v6/popham.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/v6/popham.asm	Sat Apr 27 01:57:43 2013 +0200
@@ -0,0 +1,127 @@
+dnl  ARM mpn_popcount and mpn_hamdist.
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2013 Free Software Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library.
+
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 3 of the License, or (at
+dnl  your option) any later version.
+
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C		     popcount	      hamdist
+C		    cycles/limb	    cycles/limb
+C StrongARM		 -
+C XScale		 -
+C Cortex-A7		 ?
+C Cortex-A8		 ?
+C Cortex-A9		 8.94		 9.47
+C Cortex-A15		 5.67		 6.44
+
+C Architecture requirements:
+C v5	-
+C v5t	-
+C v5te	ldrd strd
+C v6	usada8
+C v6t2	-
+C v7a	-
+
+ifdef(`OPERATION_popcount',`
+  define(`func',`mpn_popcount')
+  define(`ap',		`r0')
+  define(`n',		`r1')
+  define(`a0',		`r2')
+  define(`a1',		`r3')
+  define(`s',		`r5')
+  define(`b_01010101',	`r6')
+  define(`b_00110011',	`r7')
+  define(`b_00001111',	`r8')
+  define(`zero',	`r9')
+  define(`POPC',	`$1')
+  define(`HAMD',	`dnl')
+')
+ifdef(`OPERATION_hamdist',`
+  define(`func',`mpn_hamdist')
+  define(`ap',		`r0')
+  define(`bp',		`r1')
+  define(`n',		`r2')
+  define(`a0',		`r6')
+  define(`a1',		`r7')
+  define(`b0',		`r4')
+  define(`b1',		`r5')
+  define(`s',		`r11')
+  define(`b_01010101',	`r8')
+  define(`b_00110011',	`r9')
+  define(`b_00001111',	`r10')
+  define(`zero',	`r3')
+  define(`POPC',	`dnl')
+  define(`HAMD',	`$1')
+')
+
+
+ASM_START()
+PROLOGUE(func)
+POPC(`	push	{ r4-r9 }	')
+HAMD(`	push	{ r4-r11 }	')
+
+	ldr	b_01010101, =0x55555555
+	mov	r12, #0
+	ldr	b_00110011, =0x33333333
+	mov	zero, #0
+	ldr	b_00001111, =0x0f0f0f0f
+
+	tst	n, #1
+	beq	L(evn)
+
+L(odd):	ldr	a1, [ap], #4		C 1 x 32 1-bit accumulators, 0-1
+HAMD(`	ldr	b1, [bp], #4	')	C 1 x 32 1-bit accumulators, 0-1
+HAMD(`	eor	a1, a1, b1	')
+	and	r4, b_01010101, a1, lsr #1
+	sub	a1, a1, r4
+	and	r4, a1, b_00110011
+	bic	r5, a1, b_00110011
+	add	r5, r4, r5, lsr #2	C 8 4-bit accumulators, 0-4
+	subs	n, n, #1
+	b	L(mid)
+
+L(evn):	mov	s, #0
+
+L(top):	ldrd	a0, a1, [ap], #8	C 2 x 32 1-bit accumulators, 0-1
+HAMD(`	ldrd	b0, b1, [bp], #8')
+HAMD(`	eor	a0, a0, b0	')
+HAMD(`	eor	a1, a1, b1	')
+	subs	n, n, #2
+	usada8	r12, s, zero, r12
+	and	r4, b_01010101, a0, lsr #1
+	sub	a0, a0, r4
+	and	r4, b_01010101, a1, lsr #1
+	sub	a1, a1, r4
+	and	r4, a0, b_00110011
+	bic	r5, a0, b_00110011
+	add	a0, r4, r5, lsr #2	C 8 4-bit accumulators, 0-4
+	and	r4, a1, b_00110011
+	bic	r5, a1, b_00110011
+	add	a1, r4, r5, lsr #2	C 8 4-bit accumulators, 0-4
+	add	r5, a0, a1		C 8 4-bit accumulators, 0-8
+L(mid):	and	r4, r5, b_00001111
+	bic	r5, r5, b_00001111
+	add	s, r4, r5, lsr #4	C 4 8-bit accumulators
+	bne	L(top)
+
+	usada8	r0, s, zero, r12
+POPC(`	pop	{ r4-r9 }	')
+HAMD(`	pop	{ r4-r11 }	')
+	bx	r14
+EPILOGUE()


More information about the gmp-commit mailing list