When configuring aRTS (1.5.6 - but I think the problem exists in 1.5.2 as
well), I noticed that configure fails to detect the availability of SSE
instructions or floating point to int conversion on x86_64.
The following patch fixes that.
diff -Naur arts-1.5.6/configure arts-1.5.6.new/configure
--- arts-1.5.6/configure 2007-01-15 22:45:45.000000000 -0800
+++ arts-1.5.6.new/configure 2007-01-31 23:10:21.000000000 -0800
@@ -38958,7 +38958,7 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
static inline long QRound (float inval)
{
long ret;
@@ -39047,7 +39047,7 @@
main ()
{
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
__asm__("movups %xmm0, (%esp)");
#else
/* IRIX's cc treats #error as a warning, make sure it errors out here */
diff -Naur arts-1.5.6/flow/cpuinfo.cc arts-1.5.6.new/flow/cpuinfo.cc
--- arts-1.5.6/flow/cpuinfo.cc 2005-09-10 01:13:33.000000000 -0700
+++ arts-1.5.6.new/flow/cpuinfo.cc 2007-01-31 23:16:20.000000000 -0800
@@ -29,7 +29,23 @@
using namespace Arts;
+#ifdef __x86_64__
+
+ /*
+ HACK: This assumes that x86_64 processors have all the MMX, 3DNow!,
+ and SSE instructions, which is true as far as I know, but I haven't
+ checked for other than K8.
+
+ It also bypasses the original codes' checking of the hardware CPUID
+ for that info, and hard codes it instead.
+ */
+
+int CpuInfo::s_flags = CpuMMX + CpuEMMX + Cpu3DNow + CpuSSE;
+#else
int CpuInfo::s_flags = 0;
+#endif
+
+
namespace Arts
{
@@ -53,7 +69,7 @@
void CpuInfoStartup::startup()
{
-#ifdef HAVE_X86_SSE
+#if defined(HAVE_X86_SSE) && !defined(__x86_64__)
/*
* Taken with thanks from mmx.h:
*
@@ -226,7 +242,7 @@
}
signal(SIGILL, oldHandler);
}
-#endif /* HAVE_X86_SSE */
+#endif /* HAVE_X86_SSE && ! __x86_64__*/
}
static CpuInfoStartup cpuInfoStartup;
Regards,
Jeff
--
http://linuxfromscratch.org/mailman/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page