summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-08-12 00:28:27 +0200
committerKevin Ryde <user42@zip.com.au>2001-08-12 00:28:27 +0200
commit9619af468d4f3833825f1bfdeb112068a9cd29c8 (patch)
treebf37354baa53428ccf3ea3009289fec3c868b473 /acinclude.m4
parenta5cf0d425fbb19e12111b882be11c7f2b94a6b3b (diff)
downloadgmp-9619af468d4f3833825f1bfdeb112068a9cd29c8.tar.gz
* acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m452
1 files changed, 52 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 86ead95bc..b71d67233 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -25,6 +25,22 @@ define(X86_PATTERN,
[[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*]])
+dnl GMP_STRIP_PATH(subdir)
+dnl ----------------------
+dnl Strip entries */subdir from $path.
+
+define(GMP_STRIP_PATH,
+[tmp_path=
+for i in $path; do
+ case $i in
+ */$1) ;;
+ *) tmp_path="$tmp_path $i" ;;
+ esac
+done
+path="$tmp_path"
+])
+
+
dnl GMP_INCLUDE_GMP_H
dnl -----------------
dnl Expand to the right way to #include gmp-h.in. This must be used
@@ -1141,6 +1157,42 @@ fi
])
+dnl GMP_ASM_X86_SSE2([ACTION-IF-FOUND][,ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------
+dnl Determine whether the assembler supports SSE2 instructions.
+dnl
+dnl This macro is wanted before GMP_ASM_TEXT, so ".text" is hard coded
+dnl here. ".text" is believed to be correct on all x86 systems, certainly
+dnl it's all GMP_ASM_TEXT gives currently. Actually ".text" probably isn't
+dnl needed at all, at least for just checking instruction syntax.
+
+AC_DEFUN(GMP_ASM_X86_SSE2,
+[AC_CACHE_CHECK([if the assembler knows about SSE2 instructions],
+ gmp_cv_asm_x86_sse2,
+[GMP_TRY_ASSEMBLE(
+[ .text
+ paddq %mm0, %mm1],
+ [gmp_cv_asm_x86_sse2=yes],
+ [gmp_cv_asm_x86_sse2=no])
+])
+case $gmp_cv_asm_x86_sse2 in
+yes)
+ ifelse([$1],,:,[$1])
+ ;;
+*)
+ AC_MSG_WARN([+----------------------------------------------------------])
+ AC_MSG_WARN([| WARNING WARNING WARNING])
+ AC_MSG_WARN([| Host CPU has SSE2 code, but it can't be assembled by])
+ AC_MSG_WARN([| $CCAS $CFLAGS])
+ AC_MSG_WARN([| Non-SSE2 replacements will be used.])
+ AC_MSG_WARN([| This will be an inferior build.])
+ AC_MSG_WARN([+----------------------------------------------------------])
+ ifelse([$2],,:,[$2])
+ ;;
+esac
+])
+
+
dnl GMP_ASM_X86_MCOUNT
dnl ------------------
dnl Find out how to call mcount for profiling on an x86 system.