[Gmp-commit] /var/hg/gmp-5.1: Bring in selected mainline changes.
mercurial at gmplib.org
mercurial at gmplib.org
Wed May 15 19:15:50 CEST 2013
details: /var/hg/gmp-5.1/rev/edd85862baee
changeset: 15411:edd85862baee
user: Torbjorn Granlund <tege at gmplib.org>
date: Wed May 15 19:15:44 2013 +0200
description:
Bring in selected mainline changes.
diffstat:
ChangeLog | 27 +++++++++++++-
configure.ac | 15 +++++--
tests/arm32call.asm | 83 +++++++++++++++++++++++++++++++++++++++++++++
tests/arm32check.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 214 insertions(+), 7 deletions(-)
diffs (truncated from 313 to 300 lines):
diff -r 3b886a0ae8ca -r edd85862baee ChangeLog
--- a/ChangeLog Wed May 15 01:01:44 2013 +0200
+++ b/ChangeLog Wed May 15 19:15:44 2013 +0200
@@ -1,3 +1,7 @@
+2013-05-14 Torbjorn Granlund <tege at gmplib.org>
+
+ * configure.ac (arm1156): Don't fall back to plain v6 compiler option.
+
2013-05-10 Torbjorn Granlund <tege at gmplib.org>
* mpn/x86/p6/mmx/gmp-mparam.h: Set down SQR_TOOM2_THRESHOLD to parent
@@ -7,10 +11,29 @@
* mpn/x86_64/bd1/mul_1.asm: Fix typo.
+2013-04-29 Torbjorn Granlund <tege at gmplib.org>
+
+ * configure.ac (sparc-*-*): Recognise t5 along with t3 and t4.
+ Remove sparc64/ultrasparct1 from path_64 for T3, T3, and T5.
+
2013-04-27 Mike Frysinger <vapier at gentoo.org>
* configure.ac (arm*-*-*): Set up path also for plainest CPU variants.
+2013-03-19 Torbjorn Granlund <tege at gmplib.org>
+
+ * tests/arm32check.c: Get printing of clobbered register right.
+
+ * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add arm32call.asm and
+ arm32check.c.
+
+2013-03-18 Torbjorn Granlund <tege at gmplib.org>
+
+ * configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
+
+ * tests/arm32call.asm: New file.
+ * tests/arm32check.c: New file.
+
2012-03-17 Marc Glisse <marc.glisse at inria.fr>
* tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: New file.
@@ -36,8 +59,8 @@
* mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
- * mini-gmp/tests/t-reuse.c: Fix typo causing the same negation condition
- to be applied to all operands. (See 2013-02-03, Torbjorn)
+ * mini-gmp/tests/t-reuse.c: Fix typo causing the same negation
+ condition to be applied to all operands. (See 2013-02-03, Torbjorn)
2013-02-17 Marc Glisse <marc.glisse at inria.fr>
diff -r 3b886a0ae8ca -r edd85862baee configure.ac
--- a/configure.ac Wed May 15 01:01:44 2013 +0200
+++ b/configure.ac Wed May 15 19:15:44 2013 +0200
@@ -570,6 +570,8 @@
gcc_cflags_maybe="-marm"
gcc_testlist="gcc-arm-umodsi"
GMP_INCLUDE_MPN(arm/arm-defs.m4)
+ CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
+
case $host_cpu in
armsa1 | armv4*)
path="arm"
@@ -585,7 +587,7 @@
;;
arm1156)
path="arm/v6t2 arm/v6 arm/v5 arm"
- gcc_cflags_arch="-march=armv6"
+ gcc_cflags_arch="-march=armv6t2"
;;
armcortexa9)
path="arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
@@ -1260,7 +1262,7 @@
path="sparc32/v8/supersparc sparc32/v8 sparc32" ;;
[sparc64 | sparcv9* | ultrasparc | ultrasparc[234]*])
path="sparc32/v9 sparc32/v8 sparc32" ;;
- [ultrasparct[1234]])
+ [ultrasparct[12345]])
path="sparc32/ultrasparct1 sparc32/v8 sparc32" ;;
*)
path="sparc32" ;;
@@ -1281,6 +1283,8 @@
# abilist="64" only.
#
case $host_cpu in
+ [ultrasparct[345]])
+ gcc_32_cflags="$gcc_cflags -Wa,-xarch=v8plusd" ;;
sparc64 | sparcv9* | ultrasparc*)
gcc_32_cflags="$gcc_cflags -Wa,-xarch=v8plus" ;;
esac
@@ -1321,6 +1325,7 @@
case $host_cpu in
sparcv8 | microsparc | supersparc | turbosparc)
cc_cflags_arch="-xarch=v8" ;;
+ [ultrasparct[345]]) cc_cflags_arch="-xarch=v8plusd" ;;
sparc64 | sparcv9* | ultrasparc*) cc_cflags_arch="-xarch=v8plus" ;;
*) cc_cflags_arch="-xarch=v7" ;;
esac
@@ -1377,7 +1382,7 @@
path_64="sparc64/ultrasparc1234 sparc64" ;;
[ultrasparc[34]])
path_64="sparc64/ultrasparc34 sparc64/ultrasparc1234 sparc64" ;;
- [ultrasparct[1234]])
+ [ultrasparct[12345]])
path_64="sparc64/ultrasparct1 sparc64" ;;
*)
path_64="sparc64"
@@ -1636,7 +1641,7 @@
path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86"
path_64="x86_64/coreinhm x86_64/core2 x86_64"
;;
- coreisbr)
+ coreisbr | coreihwl | coreibwl)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86"
@@ -3417,7 +3422,7 @@
power*-*-aix*)
GMP_INCLUDE_MPN(powerpc32/aix.m4)
;;
- sparcv9*-*-* | ultrasparc*-*-* | sparc64-*-*)
+ *sparc*-*-*)
case $ABI in
64)
GMP_ASM_SPARC_REGISTER
diff -r 3b886a0ae8ca -r edd85862baee tests/arm32call.asm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/arm32call.asm Wed May 15 19:15:44 2013 +0200
@@ -0,0 +1,83 @@
+dnl ARM32 calling conventions checking.
+
+dnl Copyright 2000, 2003, 2004, 2006, 2007, 2010, 2013 Free Software
+dnl Foundation, Inc.
+
+dnl This file is part of the GNU MP Library test suite.
+
+dnl The GNU MP Library test suite is free software; you can redistribute it
+dnl and/or modify it under the terms of the GNU General Public License as
+dnl published by the Free Software Foundation; either version 3 of the
+dnl License, or (at your option) any later version.
+
+dnl The GNU MP Library test suite is distributed in the hope that it will be
+dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+dnl Public License for more details.
+
+dnl You should have received a copy of the GNU General Public License along
+dnl with the GNU MP Library test suite. If not, see
+dnl http://www.gnu.org/licenses/.
+
+
+dnl The current version of the code attempts to keep the call/return
+dnl prediction stack valid, but matching calls and returns.
+
+include(`../config.m4')
+
+
+C int calling_conventions (...);
+C
+C The global variable "calling_conventions_function" is the function to
+C call, with the arguments as passed here.
+
+define(`WANT_CALLEE_SAVES', eval(4*0))
+define(`SAVE_CALLEE_SAVES', eval(4*8))
+define(`RETADDR', eval(4*16))
+define(`GOT_CALLEE_SAVES', eval(4*17))
+define(`JUNK_PARAMS', eval(4*25))
+
+ TEXT
+ ALIGN(32)
+PROLOGUE(calling_conventions)
+ LEA( r12, calling_conventions_values)
+
+ C Preserve callee-saves registers, including the link register r14
+ add r12, r12, #SAVE_CALLEE_SAVES
+ stm r12, {r4-r11,r14}
+ sub r12, r12, #SAVE_CALLEE_SAVES
+
+ C Put chosen junk into callee-saves registers
+ add r12, r12, #WANT_CALLEE_SAVES
+ ldm r12, {r4-r11}
+ sub r12, r12, #WANT_CALLEE_SAVES
+
+ C No callee-saves registers on arm except r12 and parameter registers
+ C
+
+ C Make the actual call
+ LEA( r12, calling_conventions_function)
+ ldr r12, [r12]
+ mov r14, pc
+ bx r12
+
+ LEA( r12, calling_conventions_values)
+
+ C Save callee-saves registers after call
+ add r12, r12, #GOT_CALLEE_SAVES
+ stm r12, {r4-r11}
+ sub r12, r12, #GOT_CALLEE_SAVES
+
+ C Restore callee-saves registers, including the link register r14
+ add r12, r12, #SAVE_CALLEE_SAVES
+ ldm r12, {r4-r11,r14}
+ sub r12, r12, #SAVE_CALLEE_SAVES
+
+ C Overwrite parameter registers. Note that we overwrite r1, which
+ C could hold one half of a 64-bit return value, since we don't use that
+ C in GMP.
+ add r12, r12, #JUNK_PARAMS
+ ldm r12, {r1-r3}
+
+ bx r14
+EPILOGUE()
diff -r 3b886a0ae8ca -r edd85862baee tests/arm32check.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/arm32check.c Wed May 15 19:15:44 2013 +0200
@@ -0,0 +1,96 @@
+/* ARM32 calling conventions checking.
+
+Copyright 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library test suite.
+
+The GNU MP Library test suite is free software; you can redistribute it
+and/or modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 3 of the License,
+or (at your option) any later version.
+
+The GNU MP Library test suite is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+the GNU MP Library test suite. If not, see http://www.gnu.org/licenses/. */
+
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "tests.h"
+
+
+/* Vector if constants and register values. */
+mp_limb_t calling_conventions_values[29] =
+{
+ 0x12345678, /* 0 want_r4 */
+ 0x87654321, /* 1 want_r5 */
+ 0x89ABCDEF, /* 2 want_r6 */
+ 0xFEDCBA98, /* 3 want_r7 */
+ 0xDEADBEEF, /* 4 want_r8 */
+ 0xBADECAFE, /* 5 want_r9 */
+ 0xFFEEDDCC, /* 6 want_r10 */
+ 0xBBAA9988, /* 7 want_r11 */
+
+ 0x00000000, /* 8 save_r4 */
+ 0x00000000, /* 9 save_r5 */
+ 0x00000000, /* 10 save_r6 */
+ 0x00000000, /* 11 save_r7 */
+ 0x00000000, /* 12 save_r8 */
+ 0x00000000, /* 13 save_r9 */
+ 0x00000000, /* 14 save_r10 */
+ 0x00000000, /* 15 save_r11 */
+ 0x00000000, /* 16 save_r14 */
+
+ 0x00000000, /* 17 got_r4 */
+ 0x00000000, /* 18 got_r5 */
+ 0x00000000, /* 19 got_r6 */
+ 0x00000000, /* 20 got_r7 */
+ 0x00000000, /* 21 got_r8 */
+ 0x00000000, /* 22 got_r9 */
+ 0x00000000, /* 23 got_r10 */
+ 0x00000000, /* 24 got_r11 */
+
+ 0x00112233, /* 25 junk_r0 */
+ 0x44556677, /* 26 junk_r1 */
+ 0x12344321, /* 27 junk_r2 */
+ 0x56788765, /* 28 junk_r3 */
+};
+
+/* Index starts for various regions in above vector. */
+#define WANT_CALLEE_SAVES 0
+#define SAVE_CALLEE_SAVES 8
+#define RETADDR 16
+#define GOT_CALLEE_SAVES 17
+#define JUNK_PARAMS 25
+
+/* Return 1 if ok, 0 if not */
+
+int
+calling_conventions_check (void)
+{
+ const char *header = "Violated calling conventions:\n";
+ int ret = 1;
+ int i;
+
+#define CHECK(callreg, regnum, value) \
+ if (callreg != value) \
+ { \
+ printf ("%s r%d got 0x%08lX want 0x%08lX\n", \
+ header, regnum, callreg, value); \
More information about the gmp-commit
mailing list