Commit 156eee04 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

configure.in app/base/base.c added (untested) check for altivec assembly

2003-07-04  Sven Neumann  <sven@gimp.org>

	* configure.in
	* app/base/base.c
	* app/base/cpu-accel.c: added (untested) check for altivec assembly
	and enabled the run-time altivec check.
parent 129f9492
2003-07-04 Sven Neumann <sven@gimp.org>
* configure.in: minor fixes to the checks for assembler support.
* configure.in
* app/base/base.c
* app/base/cpu-accel.c: added (untested) check for altivec assembly
and enabled the run-time altivec check.
2003-07-04 Michael Natterer <mitch@gimp.org>
......@@ -71,25 +71,27 @@ base_init (GimpBaseConfig *config,
base_config = config;
#ifdef USE_MMX
if (use_mmx)
{
#ifdef ARCH_X86
g_printerr ("Testing CPU features...\n");
g_printerr (" mmx : %s\n",
(cpu_accel() & CPU_ACCEL_X86_MMX) ? "yes" : "no");
g_printerr (" 3dnow : %s\n",
(cpu_accel() & CPU_ACCEL_X86_3DNOW) ? "yes" : "no");
g_printerr (" mmxext : %s\n",
(cpu_accel() & CPU_ACCEL_X86_MMXEXT) ? "yes" : "no");
g_printerr (" sse : %s\n",
(cpu_accel() & CPU_ACCEL_X86_SSE) ? "yes" : "no");
g_printerr (" sse2 : %s\n",
(cpu_accel() & CPU_ACCEL_X86_SSE2) ? "yes" : "no");
g_printerr ("\n");
#ifdef ARCH_X86
g_printerr (" mmx : %s\n",
(cpu_accel() & CPU_ACCEL_X86_MMX) ? "yes" : "no");
g_printerr (" 3dnow : %s\n",
(cpu_accel() & CPU_ACCEL_X86_3DNOW) ? "yes" : "no");
g_printerr (" mmxext : %s\n",
(cpu_accel() & CPU_ACCEL_X86_MMXEXT) ? "yes" : "no");
g_printerr (" sse : %s\n",
(cpu_accel() & CPU_ACCEL_X86_SSE) ? "yes" : "no");
g_printerr (" sse2 : %s\n",
(cpu_accel() & CPU_ACCEL_X86_SSE2) ? "yes" : "no");
#endif
}
#ifdef ARCH_PPC
g_printerr (" altivec : %s\n",
(cpu_accel() & CPU_ACCEL_PPC_ALTIVEC) ? "yes" : "no");
#endif
g_printerr ("\n");
}
tile_cache_init (config->tile_cache_size);
......
......@@ -120,7 +120,7 @@ sigill_handler (gint n)
#endif /* ARCH_X86 */
#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
#if defined (ARCH_PPC) && defined (USE_ALTIVEC)
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
......@@ -138,7 +138,8 @@ sigill_handler (gint sig)
siglongjmp (jmpbuf, 1);
}
static guint32 arch_accel (void)
static guint32
arch_accel (void)
{
signal (SIGILL, sigill_handler);
if (sigsetjmp (jmpbuf, 1))
......@@ -165,7 +166,7 @@ static guint32 arch_accel (void)
guint32
cpu_accel (void)
{
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (USE_ALTIVEC))
static guint32 accel = ~0U;
if (accel != ~0U)
......@@ -193,7 +194,7 @@ cpu_accel (void)
return accel;
#else /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */
#else /* !ARCH_X86 && !ARCH_PPC/USE_ALTIVEC */
return 0;
#endif
}
......@@ -441,12 +441,39 @@ if test "x$enable_mmx" = xyes; then
rm conftest*
ac_ext="$save_ac_ext"
else
enable_mmx=no
enable_sse=no
fi
AM_CONDITIONAL(HAVE_ASM_MMX, test x$enable_mmx = xyes)
############################
# Check for Altivec assembly
############################
AC_ARG_ENABLE(altivec,
[ --enable-altivec enable Altivec support (default=auto)],,
enable_altivec=$have_ppc)
if test "x$enable_altivec" = xyes; then
dnl Necessary for assembler sources
save_ac_ext="$ac_ext"
ac_ext=S
AC_MSG_CHECKING(whether we can compile Altivec code)
echo " vand %v0, %v0, %v0" > conftest.S
if AC_TRY_EVAL(ac_compile); then
AC_DEFINE(USE_ALTIVEC, 1, [Define to 1 if Altivec assembly is available.])
AC_MSG_RESULT(yes)
else
enable_altivec=no
AC_MSG_RESULT(no)
AC_MSG_WARN([The assembler does not support the Altivec command set.])
fi
rm conftest*
ac_ext="$save_ac_ext"
fi
###################################
......
......@@ -120,7 +120,7 @@ sigill_handler (gint n)
#endif /* ARCH_X86 */
#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
#if defined (ARCH_PPC) && defined (USE_ALTIVEC)
static sigjmp_buf jmpbuf;
static volatile sig_atomic_t canjump = 0;
......@@ -138,7 +138,8 @@ sigill_handler (gint sig)
siglongjmp (jmpbuf, 1);
}
static guint32 arch_accel (void)
static guint32
arch_accel (void)
{
signal (SIGILL, sigill_handler);
if (sigsetjmp (jmpbuf, 1))
......@@ -165,7 +166,7 @@ static guint32 arch_accel (void)
guint32
cpu_accel (void)
{
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (USE_ALTIVEC))
static guint32 accel = ~0U;
if (accel != ~0U)
......@@ -193,7 +194,7 @@ cpu_accel (void)
return accel;
#else /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */
#else /* !ARCH_X86 && !ARCH_PPC/USE_ALTIVEC */
return 0;
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment