Commit 545c1985 authored by Helvetix Victorinox's avatar Helvetix Victorinox

app/composite/gimp-composite-altivec-test.c

* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-mmx-test.c
* app/composite/gimp-composite-mmx-installer.c
* app/composite/gimp-composite-sse-test.c
* app/composite/gimp-composite-sse-installer.c
* app/composite/gimp-composite-sse2-test.c
* app/composite/gimp-composite-sse2-installer.c
* app/composite/gimp-composite-vis-test.c
* app/composite/gimp-composite-vis-installer.c:
  Regenerated.

* app/composite/gimp-composite-altivec.[ch]
* app/composite/gimp-composite-mmx.[ch]
* app/composite/gimp-composite-sse.[ch]
* app/composite/gimp-composite-sse2.[ch]
* app/composite/gimp-composite-vis.[ch]
* app/composite/make-installer.py:
  Make it such that when a test is run on the wrong kind of
  machine, don't fail without an explanation.
parent 3f76868a
2003-09-26 Helvetix Victorinox <helvetix@gimp.org>
* app/composite/gimp-composite-altivec-test.c
* app/composite/gimp-composite-mmx-test.c
* app/composite/gimp-composite-mmx-installer.c
* app/composite/gimp-composite-sse-test.c
* app/composite/gimp-composite-sse-installer.c
* app/composite/gimp-composite-sse2-test.c
* app/composite/gimp-composite-sse2-installer.c
* app/composite/gimp-composite-vis-test.c
* app/composite/gimp-composite-vis-installer.c:
Regenerated.
* app/composite/gimp-composite-altivec.[ch]
* app/composite/gimp-composite-mmx.[ch]
* app/composite/gimp-composite-sse.[ch]
* app/composite/gimp-composite-sse2.[ch]
* app/composite/gimp-composite-vis.[ch]
* app/composite/make-installer.py:
Make it such that when a test is run on the wrong kind of
machine, don't fail without an explanation.
2003-09-27 Simon Budig <simon@gimp.org>
This still is very much in progress. I just want to commit this
......@@ -20,6 +20,10 @@ int
gimp_composite_3dnow_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_3DNOW) && defined(ARCH_X86)
if (gimp_composite_3dnow_init () == 0) {
printf("gimp_composite_3dnow: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -20,6 +20,10 @@ int
gimp_composite_altivec_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_ALTIVEC) && defined(ARCH_PPC)
if (gimp_composite_altivec_init () == 0) {
printf("gimp_composite_altivec: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -35,9 +35,15 @@
#endif /* __GNUC__ > 3 */
#endif /* ARCH_PPC */
void
int
gimp_composite_altivec_init (void)
{
#ifdef ARCH_PPC
if (cpu & CPU_ACCEL_PPC_ALTIVEC)
{
return (1);
}
#endif
return (0);
}
#ifndef gimp_composite_altivec_h
#define gimp_composite_altivec_h
extern void gimp_composite_altivec_init (void);
extern int gimp_composite_altivec_init (void);
/*
* The function gimp_composite_*_install() is defined in the code generated by make-install.py
......
......@@ -20,6 +20,10 @@ int
gimp_composite_mmx_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_MMX) && defined(ARCH_X86)
if (gimp_composite_mmx_init () == 0) {
printf("gimp_composite_mmx: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -40,6 +40,7 @@
#include <glib-object.h>
#include "base/base-types.h"
#include "base/cpu-accel.h"
#include "gimp-composite.h"
#include "gimp-composite-mmx.h"
......@@ -2214,8 +2215,16 @@ xxxgimp_composite_valueonly_va8_va8_va8_mmx (GimpCompositeContext *_op)
#endif /* ARCH_X86 */
#endif /* USE_MMX */
void
int
gimp_composite_mmx_init (void)
{
#if defined(USE_MMX) && defined(ARCH_X86)
guint32 cpu = cpu_accel ();
if (cpu & CPU_ACCEL_X86_MMX)
{
return (1);
}
#endif
return (0);
}
#ifndef gimp_composite_mmx_h
#define gimp_composite_mmx_h
extern void gimp_composite_mmx_init (void);
extern int gimp_composite_mmx_init (void);
/*
* The function gimp_composite_*_install() is defined in the code generated by make-install.py
......
......@@ -20,6 +20,10 @@ int
gimp_composite_sse_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86)
if (gimp_composite_sse_init () == 0) {
printf("gimp_composite_sse: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -41,6 +41,7 @@
#include <glib-object.h>
#include "base/base-types.h"
#include "base/cpu-accel.h"
#include "gimp-composite.h"
#include "gimp-composite-sse.h"
......@@ -2281,8 +2282,17 @@ xxxgimp_composite_valueonly_va8_va8_va8_sse (GimpCompositeContext *_op)
#endif /* ARCH_X86 */
#endif /* USE_SSE */
void
int
gimp_composite_sse_init (void)
{
#if defined(USE_SSE) && defined(ARCH_X86)
guint32 cpu = cpu_accel ();
if (cpu & CPU_ACCEL_X86_SSE || cpu & CPU_ACCEL_X86_MMXEXT)
{
return (1);
}
#endif
return (0);
}
#ifndef gimp_composite_sse_h
#define gimp_composite_sse_h
extern void gimp_composite_sse_init (void);
extern int gimp_composite_sse_init (void);
#ifdef USE_MMX
#ifdef ARCH_X86
......
......@@ -20,6 +20,10 @@ int
gimp_composite_sse2_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_SSE) && defined(ARCH_X86)
if (gimp_composite_sse2_init () == 0) {
printf("gimp_composite_sse2: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -33,6 +33,7 @@
#include <glib-object.h>
#include "base/base-types.h"
#include "base/cpu-accel.h"
#include "gimp-composite.h"
#include "gimp-composite-sse2.h"
......@@ -807,7 +808,16 @@ gimp_composite_swap_rgba8_rgba8_rgba8_sse2 (GimpCompositeContext *_op)
#endif /* defined(USE_SSE) */
void
int
gimp_composite_sse2_init (void)
{
#if defined(USE_SSE) && defined(ARCH_X86)
guint32 cpu = cpu_accel ();
if (cpu & CPU_ACCEL_X86_SSE || cpu & CPU_ACCEL_X86_MMXEXT)
{
return (1);
}
#endif
return (0);
}
#ifndef gimp_composite_sse2_h
#define gimp_composite_sse2_h
extern void gimp_composite_sse2_init (void);
extern int gimp_composite_sse2_init (void);
/*
* The function gimp_composite_*_install() is defined in the code generated by make-install.py
......
......@@ -20,6 +20,10 @@ int
gimp_composite_vis_test (int iterations, int n_pixels)
{
#if (__GNUC__ >= 3) && defined(USE_VIS) && defined(ARCH_SPARC)
if (gimp_composite_vis_init () == 0) {
printf("gimp_composite_vis: Instruction set is not available.\n");
return (0);
}
GimpCompositeContext generic_ctx;
GimpCompositeContext special_ctx;
double ft0;
......
......@@ -41,8 +41,12 @@
#endif /* defined(ARCH_SPARC) */
#endif /* defined(USE_VIS) */
void
int
gimp_composite_vis_init (void)
{
#ifdef ARCH_SPARC
return (1);
#else
return (0);
#endif
}
#ifndef gimp_composite_vis_h
#define gimp_composite_vis_h
extern void gimp_composite_vis_init (void);
extern int gimp_composite_vis_init (void);
/*
* The function gimp_composite_*_install() is defined in the code generated by make-install.py
......
......@@ -277,6 +277,11 @@ def gimp_composite_regression(fpout, function_tables, options):
print >>fpout, '#if %s' % (r)
pass
print >>fpout, ' if (%s_init () == 0) {' % (functionnameify(options.file))
print >>fpout, ' printf("%s: Instruction set is not available.\\n");' % (functionnameify(options.file))
print >>fpout, ' return (0);'
print >>fpout, ' }'
print >>fpout, ' GimpCompositeContext generic_ctx;'
print >>fpout, ' GimpCompositeContext special_ctx;'
print >>fpout, ' double ft0;'
......@@ -319,7 +324,7 @@ def gimp_composite_regression(fpout, function_tables, options):
generic_table = function_tables
composite_modes.sort();
for mode in composite_modes:
for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format):
......
......@@ -1154,3 +1154,6 @@ the ones in dialog size).
<para>
<inlinegraphic fileref="stock-wilber-eek-64.png" format="png"></inlinegraphic>
</para>
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