Date: Wed, 24 Mar 1999 17:11:01 -0500
   From: Brian Paul <[EMAIL PROTECTED]>

   Have you given any thought to this?  In the original Mesa 3.1 beta
   there was a simple framework for hooking in optimized FP code.

I think the hook to install the routines should be all hidden away in
some header file and all ugly ifdefs removed.  Here is a suggested
layout:

1) Create a directory src/asm, here goes things like asm_386_xxx.S,
   asm_sparc_xxx.S etc.

2) Create src/asm.h  which looks something like:

   extern ... install_arch_xform_asm(...)
   extern ... install_arch_blend_asm(...)

   So files like src/xform.c call their function.

3) Under src/asm we have a "asm_none.c" file which just implements
   the above install_arch_*() functions as doing nothing.

4) Each asm support layer has several components, for example:

   asm_i386_xform.S             i386 vertex transformations
   asm_i386_blend.S             perhaps MMX blending routines
   asm_i386.c                   installs the routines

   and similarly for sparc etc.  asm_i386.c is where you can
   implement the checking of the processor type to install the
   correct routines for example.

5) src/asm/Makefile magic to compile in the appropriate stuff and
   create a libasm.o object which the toplevel makefile links into
   the final Mesa lib...

Comments?  I think it would be really nice to see all the ifdef
ASM_XXX stuff not be in the toplevel src/*.[ch] files, it's pretty
ugly.  Next we can clean up similar stuff from src/mmath.h for
example.

Later,
David S. Miller
[EMAIL PROTECTED]

   

Reply via email to