diff options
author | Tor Andersson <tor@ghostscript.com> | 2004-11-26 03:20:37 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2004-11-26 03:20:37 +0100 |
commit | 6c9bcc6f41bb738c216fc810246f60576d9ec6e4 (patch) | |
tree | a98834bbc2491c417743760d2869d1c066962b16 /include | |
parent | e8696b4046767fcbfc05056c13f919fdeff65158 (diff) | |
download | mupdf-6c9bcc6f41bb738c216fc810246f60576d9ec6e4.tar.xz |
cpu dependent skeleton
Diffstat (limited to 'include')
-rw-r--r-- | include/fitz.h | 1 | ||||
-rw-r--r-- | include/fitz/cpudep.h | 26 | ||||
-rw-r--r-- | include/fitz/render.h | 4 |
3 files changed, 30 insertions, 1 deletions
diff --git a/include/fitz.h b/include/fitz.h index 4aa56011..8c38652f 100644 --- a/include/fitz.h +++ b/include/fitz.h @@ -4,6 +4,7 @@ #define _FITZ_H_ #include "fitz/sysdep.h" +#include "fitz/cpudep.h" #include "fitz/base.h" #include "fitz/math.h" diff --git a/include/fitz/cpudep.h b/include/fitz/cpudep.h new file mode 100644 index 00000000..261c3c79 --- /dev/null +++ b/include/fitz/cpudep.h @@ -0,0 +1,26 @@ +#if defined(ARCH_X86) || defined(ARCH_X86_64) +# define HAVE_CPUDEP +# define HAVE_MMX (1<<0) +# define HAVE_MMXEXT (1<<1) +# define HAVE_SSE (1<<2) +# define HAVE_SSE2 (1<<3) +# define HAVE_SSE3 (1<<4) +# define HAVE_3DNOW (1<<5) +# define HAVE_AMD64 (1<<6) + +#elif defined (ARCH_PPC) +# define HAVE_CPUDEP +# define HAVE_ALTIVEC (1<<7) + +#elif defined (ARCH_SPARC) +# define HAVE_CPUDEP +# define HAVE_VIS (1<<8) + +#endif + +/* call this before using fitz */ +extern void fz_cpudetect(); + +/* treat as constant! */ +extern unsigned fz_cpuflags; + diff --git a/include/fitz/render.h b/include/fitz/render.h index e2435382..d951b3da 100644 --- a/include/fitz/render.h +++ b/include/fitz/render.h @@ -3,6 +3,7 @@ typedef struct fz_rastfuncs_s fz_rastfuncs; #define FZ_BYTE unsigned char +/* TODO: use 'restrict' on pointers - they never alias, do they? */ #define FZ_PSRC \ unsigned char *src, int srcw, int srch #define FZ_PDST \ @@ -57,7 +58,8 @@ struct fz_renderer_s int flag; }; -void fz_defaultrastfuncs(fz_rastfuncs *); +extern void fz_loadrastfuncs(fz_rastfuncs *); +extern void fz_accelrastfuncs(fz_rastfuncs *); fz_error *fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem); void fz_droprenderer(fz_renderer *gc); |